Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
You can add as many tiers as you like.
Code:
#overriding troop info for factions in quick start mode.
slot_faction_quick_battle_tier_1_infantry      = 41
slot_faction_quick_battle_tier_2_infantry      = 42
slot_faction_quick_battle_tier_3_infantry      = 43

slot_faction_quick_battle_tier_1_cavalry       = 44
slot_faction_quick_battle_tier_2_cavalry       = 45
slot_faction_quick_battle_tier_3_cavalry       = 46

slot_faction_quick_battle_tier_1_archer        = 47
slot_faction_quick_battle_tier_2_archer        = 48
slot_faction_quick_battle_tier_3_archer        = 49

slot_faction_quick_battle_bearer_infantry      = 50

And after you declare them for each faction in script_game_quick_start, go down to the following:
Code:
     (store_mul, ":rand_min", ":num_infantry", 15),
     (val_div, ":rand_min", 100),
     (store_mul, ":rand_max", ":num_infantry", 45),
     (val_div, ":rand_max", 100),
     (store_random_in_range, ":num_tier_2_infantry", ":rand_min", ":rand_max"),
     (store_sub, ":num_tier_1_infantry", ":num_infantry", ":num_tier_2_infantry"),
This is where the troop ratio per tier is calculated. Do some basic math here to get the amount for your new tier. Don't forget to subtract from the total.
Code:
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_2_infantry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_2_infantry"),
     (val_add, ":cur_entry_point", 1),
This is where the troops are spawned. You could just copy-paste this and change tier_2 to tier_3, but your might run out of spawn-points.

For archers in siege mode (divide_archer_entry_points = 1) the spawn point setup is more complicated, as they are spread out. Again, do some copy-pasting to figure this out.
 
Somebody said:
And after you declare them for each faction in script_game_quick_start, go down to the following:
Code:
     (store_mul, ":rand_min", ":num_infantry", 15),
     (val_div, ":rand_min", 100),
     (store_mul, ":rand_max", ":num_infantry", 45),
     (val_div, ":rand_max", 100),
     (store_random_in_range, ":num_tier_2_infantry", ":rand_min", ":rand_max"),
     (store_sub, ":num_tier_1_infantry", ":num_infantry", ":num_tier_2_infantry"),
This is where the troop ratio per tier is calculated. Do some basic math here to get the amount for your new tier. Don't forget to subtract from the total.

I'm not a scripter, I don't understand these codes, can you explain mor detail or an example?
 
That was the example.
:rand_min is 15% of the number of infantry. (num_infantry multiplied by 15 and divided by 100).
:rand_max is 45% of the number of infantry. (num_infantry multiplied by 45 and divided by 100).
A random number (of tier 2 infantry) is stored between these two.
The number of tier 1 infantry is calculated from the total num_infantry subtracted by the generated number of tier 2 infantry.
 
I have a new trouble, in siege mode, my spawn point Archers is no problem, but in open field mode, all archers both mine and enemy spawn at center of map, not original points.
 
Somebody said:
You don't need to use banners_kingdoms.dds. Any banner will suffice, as long as you have the correct scene props, banner meshes, and mesh shields/projections, (map icons exist but aren't used). Those are just higher resolution than the regular banners. What you can do is modify the first 6 texture, and then make another copy, modifying the last 6 texture, and then copy the necessary meshes and make them use your new material.

So just copying the meshes, making a new material and texture would do?
By the way, I presume the last one is a bandit banner? I haven't seen it in-game I don't think.
 
The last one is a rebel banner. I assume it shows when two of the same factions are picked or something, but I've never seen it in action. Copy the appropriate meshes, textures, scene props, etc, but don't forget to reference them in module_meshes/scene_props/constants.

Panzercracker said:
I have a new trouble, in siege mode, my spawn point Archers is no problem, but in open field mode, all archers both mine and enemy spawn at center of map, not original points.
You probably forgot to do this for battle mode.
Code:
        (eq, ":divide_archer_entry_points", 0),
        (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_3_archer),
        (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_3_archers"),
        #(val_add, ":cur_entry_point", 1),
 
Is this  "(val_add, ":cur_entry_point", 1), "  commented out?

This is my code, but it still spawn at center of map
Code:
(faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_3_infantry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_3_infantry"),
     (val_add, ":cur_entry_point", 1),
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_2_infantry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_2_infantry"),
     (val_add, ":cur_entry_point", 1),
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_1_infantry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_1_infantry"),
     (val_add, ":cur_entry_point", 1),
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_3_cavalry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_3_cavalry"),
     (val_add, ":cur_entry_point", 1),
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_2_cavalry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_2_cavalry"),
     (val_add, ":cur_entry_point", 1),
     (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_1_cavalry),
     (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_1_cavalry"),
     (val_add, ":cur_entry_point", 1),

     (try_begin),
        (eq, ":divide_archer_entry_points", 0),
        (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_3_archer),
        (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_3_archers"),
        #(val_add, ":cur_entry_point", 1),
        (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_2_archer),
        (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_2_archers"),
        (val_add, ":cur_entry_point", 1),
        (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_1_archer),
        (set_visitors, ":cur_entry_point", ":cur_troop", ":num_tier_1_archers"),
        (val_add, ":cur_entry_point", 1),
     (else_try),
       (assign, ":cur_entry_point", 40), #archer positions begin point
       (store_div, ":num_tier_1_archers_ceil_8", ":num_tier_1_archers", 8),
       (val_mul, ":num_tier_1_archers_ceil_8", 8),
       (try_begin),
         (neq, ":num_tier_1_archers_ceil_8", ":num_tier_1_archers"),
         (val_div, ":num_tier_1_archers_ceil_8", 8),
         (val_add, ":num_tier_1_archers_ceil_8", 1),
         (val_mul, ":num_tier_1_archers_ceil_8", 8),
       (try_end),
       (store_div, ":num_tier_2_archers_ceil_8", ":num_tier_2_archers", 8),
       (val_mul, ":num_tier_2_archers_ceil_8", 8),
       (try_begin),
         (neq, ":num_tier_2_archers_ceil_8", ":num_tier_2_archers"),
         (val_div, ":num_tier_2_archers_ceil_8", 8),
         (val_add, ":num_tier_2_archers_ceil_8", 1),
         (val_mul, ":num_tier_2_archers_ceil_8", 8),
       (try_end),
       (store_div, ":num_tier_3_archers_ceil_8", ":num_tier_3_archers", 8),
       (val_mul, ":num_tier_3_archers_ceil_8", 8),
       (try_begin),
         (neq, ":num_tier_3_archers_ceil_8", ":num_tier_3_archers"),
         (val_div, ":num_tier_3_archers_ceil_8", 8),
         (val_add, ":num_tier_3_archers_ceil_8", 1),
         (val_mul, ":num_tier_3_archers_ceil_8", 8),
       (try_end),
       (store_add, ":num_archers_ceil_8", ":num_tier_1_archers_ceil_8", ":num_tier_2_archers_ceil_8", ":num_tier_3_archers_ceil_8"),
       (store_div, ":num_archers_per_entry_point", ":num_archers_ceil_8", 8),
       (assign, ":left_tier_1_archers", ":num_tier_1_archers"),
       (assign, ":left_tier_2_archers", ":num_tier_2_archers"),
       (assign, ":left_tier_3_archers", ":num_tier_3_archers"),
       (assign, ":end_cond", 1000),
       (try_for_range, ":unused", 0, ":end_cond"),
         (try_begin),
           (gt, ":left_tier_3_archers", 0),
           (assign, ":used_tier_3_archers", ":num_archers_per_entry_point"),
           (val_min, ":used_tier_3_archers", ":left_tier_3_archers"),
           (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_3_archer),
           (set_visitors, ":cur_entry_point", ":cur_troop", ":used_tier_3_archers"),
           (val_add, ":cur_entry_point", 1),
           (val_sub, ":left_tier_3_archers", ":used_tier_3_archers"),
         (else_try),
           (gt, ":left_tier_2_archers", 0),
           (assign, ":used_tier_2_archers", ":num_archers_per_entry_point"),
           (val_min, ":used_tier_2_archers", ":left_tier_2_archers"),
           (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_2_archer),
           (set_visitors, ":cur_entry_point", ":cur_troop", ":used_tier_2_archers"),
           (val_add, ":cur_entry_point", 1),
           (val_sub, ":left_tier_2_archers", ":used_tier_2_archers"),
         (else_try),
           (gt, ":left_tier_1_archers", 0),
           (assign, ":used_tier_1_archers", ":num_archers_per_entry_point"),
           (val_min, ":used_tier_1_archers", ":left_tier_1_archers"),
           (faction_get_slot, ":cur_troop", ":faction_no", slot_faction_quick_battle_tier_1_archer),
           (set_visitors, ":cur_entry_point", ":cur_troop", ":used_tier_1_archers"),
           (val_add, ":cur_entry_point", 1),
           (val_sub, ":left_tier_1_archers", ":used_tier_1_archers"),
         (else_try),
           (assign, ":end_cond", 0),
         (try_end),
       (try_end),
     (try_end),
     ]),
 
Somebody said:
Alright, culture setup basically allows a meta-faction of sorts to exist. For example, if the Kingdom of Swadia is wiped out, their culture (Swadian) still exists in their original villages and towns, etc. The culture is not a kingdom - just a placeholder of sorts for the basic tier1-5 troops, town walkers, etc, for now. Make sure you join the actual fac_kingdom_1-6.

Have you tried looking at it in module_scripts? Basically it resets a bunch of ai stuff, a bunch of variables relating to when you swore an oath, resets relations, rearranges center ownership, cancels quests, moves your wife around, free any companion prisoners to your new faction, etc,
Thank you times a hundred, this was just what I needed to know
 
Hi I am new to the whole modding thing and have been looking through various tutorials.

However I haven't found out what to do with the following error (i am using the module system and python):

Exporting scripts...
Error: Unrecognized tag:sad:$geoffreyin object:sad:$geoffrey_duel
ERROR: Illegal Identifier:sad:$geoffrey_duel

I was looking at the Module system dicumentation threads, but it is unfinished and I am not sure what to do to make a variable work.

Thanks.


 
Another problem I'm afraid.
:?:
I seem to have missed something out when making a quest. I used Winter's example in the Module system documentation (involving geoffrey and constable hareck) but as its not finished I am not sure what else I need to do.
I have successfully made a dialogue that results in the quest being given to you and the party you are meant to defeat spawns correctly. However when the party is defeated, the dialogue that is meant to follow it (when you report back) doesn't appear.
It is supposed to be triggered by changing  the variable $geoffrey_duel 1 to $geoffrey_duel 2.

How (and where) do I assign a variable to change when a party is defeated?

Many thanks.
 
Hey : ) Long time since I posted any question so here goes one. Basically, I want to assign sounds for certain keys and obviously, when you press the key, it plays the sound and also display a message that would only show to your team. The thing is, I have to assign the same keys for all factions BUT different sounds for each faction. I probably know how to add the sounds and how to play them but how can I make it so that basically every faction has the same keys but different sounds and how to display a message similarly only to your team when the key is pressed?
 
Just use a try block thing.


Like:
Code:
(try_begin),
(eq, ":faction", "fac_kingdom_3"),
(play_sound, "snd_sound1"),
(else_try),
(eq, ":faction", "fac_kingdom_4"),
(play_sound, "snd_sound2"),
(else_try),
etc
(try_end),


@Lumos: I win this round!
 
Status
Not open for further replies.
Back
Top Bottom