Warband Script Enhancer 2 (v1.1.2.0)

Users who are viewing this thread

Hi! :smile: I keep testing my Viking Conquest submod and I ran into this issue: Viking Conquest Balance mod adds scripted invasions and without WSE2 the script spawns around 7-10 parties each with 111 units, but with WSE2 the spawned parties only consist of 11 men. This is the part of the script that contains the spawns:

[anyone,"hh0", [],
"The Hooded One taught me rune magic and song spells, and bade me wander this land to find those heroes worthy of help. I do not possess my master's power to reform the fundamental nature of this world, but in his absence I will make what attempt I can. Careful, there is no sense of balance or restraint to my powers, and making reckless wishes may unbalance or even unmake the world. You have been warned.", "hh_talk", []],

[anyone,"hh_pretalk", [], "Then is fulfilled Hlin's second sorrow, when Odin goes to fight with the wolf, and Beli's slayer, bright, against Surtr. Then shall Frigg's sweet friend fall. A sword age, a wind age, a wolf age. No longer is there mercy among men.", "hh0",[]],


[anyone|plyr,"hh_talk", [], "I seek knowledge and wisdom.", "hh_know",[]],
[anyone|plyr,"hh_talk", [], "I seek glory and great deeds.", "hh_world",[]],
[anyone|plyr,"hh_talk", [], "I seek to change my fate.", "hh_self",[]],
[anyone|plyr,"hh_talk", [], "I do not seek to cheat destiny, at least not yet.", "close_window",[]],


[anyone,"hh_know", [], "From great Yggdrasill grows the root that runs to the home of the frost giants, and underneath lies the Well of Mimir. Wisdom and Intelligence are hidden there. The Allfather went there and asked for one drink from the well, but he did not get this until he gave one of his eyes as a pledge.", "hh_know1",[]],

[anyone,"hh_world", [], "When the Aesir saw that the Wolf was fully bound, they took the chain and passed it through a great rock, and fixed the rock deep down into the earth. Then they took a great stone and drove it yet deeper into the earth. The Wolf gaped terribly, and thrashed about and strove to bite them. There he lies till the Weird of the Gods, when he shall be the slayer of Odin.", "hh_world1",[]],

[anyone,"hh_self", [], "Thor became angry and using the sea floor to brace himself, he began pulling the Midgard Serpent up on board. It can be said that no one has seen a more terrifying sight than this: Thor, narrowing his eyes at the serpent, while the serpent spits out poison and stares straight back from below.", "hh_self1",[]],

[anyone|plyr,"hh_know1", [], "Teach me to Save myself from Corruption of my Warband.", "hh_know2",[]],
[anyone|plyr,"hh_know1", [], "I wish to Patch the imperfections of the world.", "hh_know3",[]],
[anyone|plyr,"hh_know1", [], "Teach me the magic to find your master.", "hh_know4",[]],

[anyone,"hh_know2", [], "Yes, Save, Corruption, Warband. The Hooded One has told me that no realm is immune, but there is a chant that can avoid such corruption. It is meaningless to us, but if the Gods are watching, perhaps they will hear it and act to protect you. The chant begins: Only save in scenes, like castles or towns. Never save on the world map. This will avoid almost all chance of save corruption in any Warband mod. Just in case, also keep backups of your saves, either rotating save slots as you play, or else backing up your folder to a cloud service.", "hh_know",[]],

[anyone,"hh_know3", [], "The Hooded One has spoken of strange songs with the power to weave the threads of fate, like Patches on torn clothing. At times he sings the song magic loudly, reaching to the far realms of ModDB and Nexus, but to do so is draining, and so only done once he has composed a great ballad, perhaps once a year. But he is always humming small verses quietly in his home, the land of Balance on Discord, and such Patches may be obtained there.", "hh_know",[]],

[anyone,"hh_know4", [], "The Hooded One may be reached by two paths. The first path, traveling to the land of Google and searching there for a Hooded Horse, which will take you to a Site where a Link may be found to be invited to his realm of Discord. The second path, invoking a strange rune: discord.gg/b5ddSHK", "hh_know",[]],

[anyone|plyr,"hh_world1", [], "I have a vision of a great army riding from the south.", "hh_world2",[]],
[anyone|plyr,"hh_world1", [], "I have a vision of a fleet of warships filled with gleaming mail.", "hh_world3",[]],
[anyone|plyr,"hh_world1", [], "I have a vision of clans of Goidels rising up in revolt.", "hh_world4",[]],
[anyone|plyr,"hh_world1", [], "I have a vision of armed men filling the fjords.", "hh_world5",[]],
[anyone|plyr,"hh_world1", [], "I have a vision of ruins and camps I once cleared, filled anew with foes.", "hh_world6",[]],

[anyone,"hh_world2", [ (str_clear, s4),
(str_clear, s11),
(str_clear, s12),
(str_clear, s13),
], "{!}{s4}", "hh_pretalk",[
(str_store_string, s11, "@Indeed, as we speak more than a thousand Franks are invading Friese. Go quickly, or the Frisians are surely doomed. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s12, "@Indeed, as we speak more than a thousand Franks are invading Danmark. Go quickly, or the Danes are surely doomed. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s13, "@Indeed, as we speak more than a thousand Franks are invading West Seaxe. Go quickly, or the Saxons are surely doomed. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(store_random_in_range, ":random", 11, 14),
(str_store_string_reg, s4, ":random"),

(set_spawn_radius,7),
(store_mul, ":min", "$spawn_party_max_size", 55),
(store_mul, ":max", "$spawn_party_max_size", 45),
(set_party_creation_random_limits, ":min", ":max"),
(try_begin),
(eq, ":random", 11),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(spawn_around_party,"p_town_11","pt_frank_looters_2"),
(else_try),
(eq, ":random", 12),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(spawn_around_party,"p_town_4","pt_frank_looters_2"),
(else_try),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(spawn_around_party,"p_town_16","pt_frank_looters_2"),
(try_end),
]],
[anyone,"hh_world3", [(str_clear, s4),
(str_clear, s11),
(str_clear, s12),
(str_clear, s13),], "{!}{s4}", "hh_pretalk",[

(str_store_string, s11, "@yes, the Britons face a great invasion. Hurry, or the people of Ynys Mon will suffer greatly. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s12, "@yes, the Angles face a great invasion. Hurry, or the people of Dunwic will suffer greatly. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s13, "@yes, the Saxons and Angles face a great invasion. Hurry, or the people of Lundenwic will suffer greatly. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(store_random_in_range, ":random", 11, 14),
(str_store_string_reg, s4, ":random"),


(set_spawn_radius,7),
(store_mul, ":min", "$spawn_party_max_size", 55),
(store_mul, ":max", "$spawn_party_max_size", 45),
(set_party_creation_random_limits, ":min", ":max"),
(try_begin),
(eq, ":random", 11),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_steppe_bandits"),
(spawn_around_party,"p_town_13","pt_steppe_bandits"),
(spawn_around_party,"p_town_13","pt_steppe_bandits"),
(spawn_around_party,"p_town_13","pt_sea_raiders2"),
(spawn_around_party,"p_town_13","pt_taiga_bandits"),
(spawn_around_party,"p_town_13","pt_taiga_bandits"),
(spawn_around_party,"p_town_13","pt_taiga_bandits"),
(spawn_around_party,"p_town_13","pt_taiga_bandits"),
(spawn_around_party,"p_town_13","pt_taiga_bandits"),
(else_try),
(eq, ":random", 12),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_steppe_bandits"),
(spawn_around_party,"p_town_14","pt_steppe_bandits"),
(spawn_around_party,"p_town_14","pt_steppe_bandits"),
(spawn_around_party,"p_town_14","pt_sea_raiders2"),
(spawn_around_party,"p_town_14","pt_taiga_bandits"),
(spawn_around_party,"p_town_14","pt_taiga_bandits"),
(spawn_around_party,"p_town_14","pt_taiga_bandits"),
(spawn_around_party,"p_town_14","pt_taiga_bandits"),
(spawn_around_party,"p_town_14","pt_taiga_bandits"),
(else_try),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_steppe_bandits"),
(spawn_around_party,"p_town_12","pt_steppe_bandits"),
(spawn_around_party,"p_town_12","pt_steppe_bandits"),
(spawn_around_party,"p_town_12","pt_sea_raiders2"),
(spawn_around_party,"p_town_12","pt_taiga_bandits"),
(spawn_around_party,"p_town_12","pt_taiga_bandits"),
(spawn_around_party,"p_town_12","pt_taiga_bandits"),
(spawn_around_party,"p_town_12","pt_taiga_bandits"),
(spawn_around_party,"p_town_12","pt_taiga_bandits"),
(try_end),


]],
[anyone,"hh_world4", [(str_clear, s4),
(str_clear, s11),
(str_clear, s12),
(str_clear, s13),], "{!}{s4}", "hh_pretalk",[

(str_store_string, s11, "@You see true. It is a dark day for the people of Maistiu and all the surrounding lands. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s12, "@You see true. It is a dark day for the people of Aileach and all the surrounding lands. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s13, "@You see true. It is a dark day for the people of Rath Celtair and all the surrounding lands. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(store_random_in_range, ":random", 11, 14),
(str_store_string_reg, s4, ":random"),




(set_spawn_radius,7),
(store_mul, ":min", "$spawn_party_max_size", 55),
(store_mul, ":max", "$spawn_party_max_size", 45),
(set_party_creation_random_limits, ":min", ":max"),
(try_begin),
(eq, ":random", 11),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(spawn_around_party,"p_town_21","pt_fianna"),
(else_try),
(eq, ":random", 12),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(spawn_around_party,"p_town_25","pt_fianna"),
(else_try),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(spawn_around_party,"p_town_20","pt_fianna"),
(try_end),


]],

[anyone,"hh_world5", [(str_clear, s4),
(str_clear, s11),
(str_clear, s12),
(str_clear, s13),], "{!}{s4}", "hh_pretalk",[


(str_store_string, s11, "@Sadly, this has come to pass. Swedish troops are pouring into Norway, and there is little hope for the people if you do not come to their aid. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s12, "@Sadly, this has come to pass. Swedish troops are pouring into Denmark, and there is little hope for the people if you do not come to their aid. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(str_store_string, s13, "@Sadly, this has come to pass. Swedish troops are pouring into Alba, and there is little hope for the people if you do not come to their aid. Do not raise such a matter with me again until the threat is dealt with, unless you seek even more desperate a situation."),
(store_random_in_range, ":random", 11, 14),
(str_store_string_reg, s4, ":random"),



(set_spawn_radius,7),
(store_mul, ":min", "$spawn_party_max_size", 55),
(store_mul, ":max", "$spawn_party_max_size", 45),
(set_party_creation_random_limits, ":min", ":max"),
(try_begin),
(eq, ":random", 11),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(spawn_around_party,"p_town_5","pt_taiga_bandits"),
(else_try),
(eq, ":random", 12),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(spawn_around_party,"p_town_4","pt_taiga_bandits"),
(else_try),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(spawn_around_party,"p_town_19","pt_taiga_bandits"),
(try_end),


]],

Any idea how to fix it?
 
Hmm I'm not a programmer, no idea how I can do it. In my understanding WSE2 may use its own methods of spawning that are different from vanilla, but I wouldn't know how different or what could go wrong
 
I am getting mouse position on world map with the new operation and telling an ai to go to that position. While Ai party goes to that position i press X button on right corner of the screen.


Code:
    (1, 0, 0,
    [
        (eq, "$no_pause", 1),
    ],
    [
        (set_fixed_point_multiplier, 100),
        (party_get_position, pos1, "$my_party_id"),
        (get_main_party, ":main_party"),
        (party_set_position, ":main_party", pos1),

        # (copy_position, pos2, pos1),
        # (position_get_screen_projection, pos2, pos1),

        (position_get_x, reg1, pos1),
        (position_get_y, reg2, pos1),
        (assign, reg3, "$last_posx"),
        (assign, reg4, "$last_posy"),

        # (display_message, "@party pos: {reg1},{reg2} | target_pos: {reg3},{reg4}"),

        (val_sub, reg1, reg3),
        (val_sub, reg2, reg4),
        (try_begin),
            (lt, reg1, 0),
            (val_mul, reg1, -1),
        (try_end),
        (try_begin),
            (lt, reg2, 0),
            (val_mul, reg2, -1),
        (try_end),

        # (display_message, "@distance to accurate pos: {reg1},{reg2}"),

        (try_begin),
            (le, reg1, 0),
            (le, reg2, 0),
            (rest_for_hours_interactive, 999999, 1, 1),
            (party_set_ai_behavior, "$my_party_id", ai_bhvr_hold),
            (assign, "$no_pause", 0),
        (try_end),
    ]),

    (0, 0, 0,
    [
        (key_clicked, key_left_mouse_button),
    ],
    [
        (assign, "$no_pause", 1),
        (set_fixed_point_multiplier, 100),
        (get_mouse_map_coordinates, pos1),
        (position_get_x, "$last_posx", pos1),
        (position_get_y, "$last_posy", pos1),
        (party_set_ai_target_position, "$my_party_id", pos1),
        (party_set_ai_behavior, "$my_party_id", ai_bhvr_travel_to_point),
    ]),

$my_party_id is an ai party btw.
any advancements? @K700 ?
 
1.0.9.0
-Fixed prop_instance_intersects_with_prop_instance, set_party_creation_random_limits operations.
-Fixed memory leak for arrays operations.
 
Hello there, I came to report some AI problems, WSE2 seems to currently introduce into Warband.

In particular, problem i ve noticed personally, while playing with Prophesy of Pendor mod, is that in sieges units that have ranged capabilities seem to prefer blindly rushing the ladder. Here s an example:

I am defending a city from an attack of Noldor Lord, which has mostly archers in his army. Without WSE as soon as enemies spawn they start shooting at the city walls (while moving). Here s a screen.

The devastation is very real.

With WSE however the whole group of spawned units instead prefers to just rush the ladder, not even stopping to shoot at the walls, which leads to massive mindless losses on the AI part. Here s, once again a screenshot:

The log clearly shows how enemies incur losses while not even trying to shoot back, until they reach the ladder and literally have nowhere to go. Only then they start to shoot back.

Other people on Prophesy of Pendor's discord also report some weird AI quirks, like soldiers sometimes endlessly running to the side of the battlefield, instead of trying to pursue player's forces. I hope it helps you identify the problem. Let me know what other information you guys need to fix AI. WSE is a LOT more performant, so i d love to help making it even better.
 
Back
Top Bottom