Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Just to update you, I have finally fixed the issue of low performance in forests. The solution was indeed to create AI meshes for each map. As of now, the forest battles run very smooth, even though they are max sized.

If you are interested, I have updated my battles pack, which can be downloaded on ModDb.

Thanks everyone for your advice.
 
Viking Conquest: how to change the number of troops trained by trainer in refuge + court? Currently set at "8 per" for both (so a total of 16 combined) would love to be able to increase this number to max (100 or something) as it already "stops" when you run out of money and/or troops

Thanks

edit: or a way to change the trigger timer to once every hour so that they pump out those 8 multiple times in a single day?

In case anyone else is wondering how to make your trainers train more units...

Open module_scripts.py file with notepad and find these lines near the bottom:

(try_begin),
      (store_attribute_level, ":int", "trp_player", ca_intelligence),
      (ge, ":int", 1:cool:,
      (val_add, ":num_troops_to_train", 1),
    (try_end),

replace it with

(try_begin),
      (store_attribute_level, ":int", "trp_player", ca_intelligence),
      (ge, ":int", X),
      (val_add, ":num_troops_to_train", Y),
    (try_end),

Where X is your characters intelligence (mine was clearly above 8 so I set X at that) and Y is your desired troops additional trained (you'll still have to obviously pay for them to be upgraded so you'll need the money) + 8, which is base... So if you want your trainers to train up to 100 set Y to equal 92. Run the run_app.bat file again and replace in your game folder. You'll have your normal tweaks + this additional one. You're welcome.
 
Hi,
Code:
(ti_on_agent_killed_or_wounded, 0, 0, [], [
#  (store_trigger_param, ":dead_agent", 1),
  (store_trigger_param, ":killer_agent", 2),

  (try_begin),
  (num_active_teams_le, 2),
  (agent_get_team, reg1, ":killer_agent_no"),
  (assign, "$g_gercek", reg1),
  (try_end),
  ]),

  (0, 4, ti_once, [(eq, "$g_all_gladiators_dead", 1)],
   [
    (try_begin),
    (eq, "$tercih", "$g_gercek"),
    (jump_to_menu, "mnu_gladiator_won_battle_true_tercih"),
    (finish_mission),
    (else_try),
    (jump_to_menu, "mnu_gladiator_lose_battle_false_tercih"),
    (finish_mission),
    (try_end),
    (try_end),
    ]),

I want to end mission end jump to menu when a gladitor team wins the round. Also I want to recieve winner team's no. How can I do that? Game doesnt jumps to menu when a team wins the round.
 
Hi, just wanted to ask a quick question: Is it possible to add new AI troop types to multiplayer using Morgh's Editor? Or must I use the MS to implement those?

Thanks in advance!
 
Ayorall said:
Is having 20 lords absolutely necessary? I'm making a 1-town-faction, having that many lords is overkill.
Jacobhinds said:
If you can understand initialise_aristocracy and make exceptions for the faction, you can assign familial relations manually via slots. Hard to explain because I'm in a Kenyan airport with about 30 seconds of internet left, but it's not that hard.

But yeah, banners are a crime against humanity.
can someone help me with this really my hair is turning white because of it (since i have some factions which have 3 lords + the king and others having more then 30 lords + the king and it is causing problems)

thanks for the help
 
kraggrim ?️ said:
Brytenwalda has factions of varying size, check their code (or the VC code)

Thank you never thought of this i'll check them right now! Arigato Gozaimasu!

Edit : i just finished checking half of it and damn doing it like that will burn my brain alive lol but at least it should be good and fix my problem as far as i saw i need to create new slots and edit some stuff  and maybe i can get it to work thanks again for the help ! (correct me if i forgot something !)
 
How can I fix?

  Script Error on OPCODE 1677: Invalid Map Icon ID: -166; Line Number 20
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.
 
Baxxardy said:
How can I fix?

  Script Error on OPCODE 1677: Invalid Map Icon ID: -166; Line Number 20
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.

1) learn how to read/interpret the error message

2) find the line on your code

so for (1):
a) At script create_kingdom_hero_party => script "create_kingdom_hero_party", file for scripts is module_scripts.py
b) Script Error on OPCODE 1677 => look for this number on header_operations.py to get the operation
c) Invalid Map Icon ID: -166 => bug here by using a invalid (negative) value for the operation parameter of a map icon
d) Line Number 20 => 21th line of code on that script (count from zero)

for (2) follow the result of (1), locate that code line, and study your code to determine why are you using the wrong value
 
1gByP5.jpg

What was causing this? I knew it but I forgot.  :facepalm:

Ordering? wrong bumpmap?
 
Hi,
Code:
[anyone, "mayor_production_ask_1", [], "Sure. What is it?", "mayor_production_ask_2", []],

  [anyone|plyr, "mayor_production_ask_2", [], "Velvet", "mayor_production_1_a", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Linen", "mayor_production_1_b", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Butter", "mayor_production_1_c", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Iron", "mayor_production_1_d", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Bronze", "mayor_production_1_e", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Wine", "mayor_production_1_f", []],

  [anyone, "mayor_production_1_a", [
                                    (store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 0),
                                    (str_store_string, s30, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 1),
                                    (str_store_string, s30, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 2),
                                    (str_store_string, s30, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":kadife", 3),
                                    (str_store_string, s30, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s30} amount of velvet.", "mayor_talk", []],
  
  [anyone, "mayor_production_1_b", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 0),
                                    (str_store_string, s29, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 1),
                                    (str_store_string, s29, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 2),
                                    (str_store_string, s29, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":keten", 3),
                                    (str_store_string, s29, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s29} amount of linen.", "mayor_talk", []],

  [anyone, "mayor_production_1_c", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 0),
                                    (str_store_string, s28, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 1),
                                    (str_store_string, s28, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 2),
                                    (str_store_string, s28, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":tereyagi", 3),
                                    (str_store_string, s28, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s28} amount of butter.", "mayor_talk", []],

  [anyone, "mayor_production_1_d", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 0),
                                    (str_store_string, s27, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 1),
                                    (str_store_string, s27, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 2),
                                    (str_store_string, s27, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":demir", 3),
                                    (str_store_string, s27, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s27} amount of iron.", "mayor_talk", []],

  [anyone, "mayor_production_1_e", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 0),
                                    (str_store_string, s26, "str_prod_low"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 1),
                                    (str_store_string, s26, "str_prod_normal"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 2),
                                    (str_store_string, s26, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":bronz", 3),
                                    (str_store_string, s26, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s26} amount of bronze.", "mayor_talk", []],

  [anyone, "mayor_production_1_f", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 0),
                                    (str_store_string, s25, "str_prod_low"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 1),
                                    (str_store_string, s25, "str_prod_normal"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 2),
                                    (str_store_string, s25, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":icki", 3),
                                    (str_store_string, s25, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s25} amount of wine.", "mayor_talk", []],
I want to mayor tells us encountered city's production amount. But error says "Invalid party id". Where is the problem?
 
kalarhan said:
Baxxardy said:
How can I fix?

  Script Error on OPCODE 1677: Invalid Map Icon ID: -166; Line Number 20
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.
At script create_kingdom_hero_party.

1) learn how to read/interpret the error message

2) find the line on your code

so for (1):
a) At script create_kingdom_hero_party => script "create_kingdom_hero_party", file for scripts is module_scripts.py
b) Script Error on OPCODE 1677 => look for this number on header_operations.py to get the operation
c) Invalid Map Icon ID: -166 => bug here by using a invalid (negative) value for the operation parameter of a map icon
d) Line Number 20 => 21th line of code on that script (count from zero)

for (2) follow the result of (1), locate that code line, and study your code to determine why are you using the wrong value

so friend is there any guide to adding new banners? not the replacing old ones, but adding new too
 
Kortlcha said:
Hi,
Code:
[anyone, "mayor_production_ask_1", [], "Sure. What is it?", "mayor_production_ask_2", []],

  [anyone|plyr, "mayor_production_ask_2", [], "Velvet", "mayor_production_1_a", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Linen", "mayor_production_1_b", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Butter", "mayor_production_1_c", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Iron", "mayor_production_1_d", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Bronze", "mayor_production_1_e", []],
  [anyone|plyr, "mayor_production_ask_2", [], "Wine", "mayor_production_1_f", []],

  [anyone, "mayor_production_1_a", [
                                    (store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 0),
                                    (str_store_string, s30, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 1),
                                    (str_store_string, s30, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 2),
                                    (str_store_string, s30, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":kadife", 3),
                                    (str_store_string, s30, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s30} amount of velvet.", "mayor_talk", []],
  
  [anyone, "mayor_production_1_b", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 0),
                                    (str_store_string, s29, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 1),
                                    (str_store_string, s29, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_keten_uretim, 2),
                                    (str_store_string, s29, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":keten", 3),
                                    (str_store_string, s29, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s29} amount of linen.", "mayor_talk", []],

  [anyone, "mayor_production_1_c", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 0),
                                    (str_store_string, s28, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 1),
                                    (str_store_string, s28, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_tereyagi_uretim, 2),
                                    (str_store_string, s28, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":tereyagi", 3),
                                    (str_store_string, s28, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s28} amount of butter.", "mayor_talk", []],

  [anyone, "mayor_production_1_d", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 0),
                                    (str_store_string, s27, "str_prod_low"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 1),
                                    (str_store_string, s27, "str_prod_normal"),
                                    (else_try),
                                    (party_get_slot, "$g_encountered_party", slot_town_demir_uretim, 2),
                                    (str_store_string, s27, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":demir", 3),
                                    (str_store_string, s27, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s27} amount of iron.", "mayor_talk", []],

  [anyone, "mayor_production_1_e", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 0),
                                    (str_store_string, s26, "str_prod_low"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 1),
                                    (str_store_string, s26, "str_prod_normal"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_bronz_uretim, 2),
                                    (str_store_string, s26, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":bronz", 3),
                                    (str_store_string, s26, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s26} amount of bronze.", "mayor_talk", []],

  [anyone, "mayor_production_1_f", [(store_encountered_party, "$g_encountered_party"),
                                    (try_begin),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 0),
                                    (str_store_string, s25, "str_prod_low"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 1),
                                    (str_store_string, s25, "str_prod_normal"),
                                    (else_try),
                                    (party_slot_eq, "$g_encountered_party", slot_town_icki_uretim, 2),
                                    (str_store_string, s25, "str_prod_good"),
                                    (else_try),
#                                    (eq, ":icki", 3),
                                    (str_store_string, s25, "str_prod_excellent"),
                                    (try_end),
                                    ], "We are producing {s25} amount of wine.", "mayor_talk", []],
I want to mayor tells us encountered city's production amount. But error says "Invalid party id". Where is the problem?

why are you overriding the global? And look at the operation
Code:
 (party_get_slot, "$g_encountered_party", slot_town_kadife_uretim, 0),

if you don't have it yet then download Lav's module system and check his header_operations.py
 
Anyone know what initiates the dialogue screen on the campaign map in game_menus? Mine seems to have disappeared and takes you straight to the simple encounter menu without the initial dialogue.  :facepalm:


To answer my own Q:  (call_script, "script_setup_party_meeting", "$g_encountered_party"),
 
Anyone know how to define this line for Bodysliding? i got everything else working its just nagging me about this one line that i cant wrap my head around

\module_game_menus.py", line 4303, in <module>
    (call_script, "script_copy_inventory", BODYSLIDING_STORAGE, "$bodysliding_last_troop"),
NameError: name 'BODYSLIDING_STORAGE' is not defined

i know this is the meaning: Missing a prefix such as trp_, itm_ or mnu_ OR missing a name OR misspelled a name.
just cant wrap my head around how to name that to fix it
 
Silberb said:
Anyone know how to define this line for Bodysliding? i got everything else working its just nagging me about this one line that i cant wrap my head around

\module_game_menus.py", line 4303, in <module>
    (call_script, "script_copy_inventory", BODYSLIDING_STORAGE, "$bodysliding_last_troop"),
NameError: name 'BODYSLIDING_STORAGE' is not defined

i know this is the meaning: Missing a prefix such as trp_, itm_ or mnu_ OR missing a name OR misspelled a name.
just cant wrap my head around how to name that to fix it

If it stores inventory then I'm guessing its in your troop file? So it should be "trp_bodysliding_storage",
 
HyperCharge said:
1gByP5.jpg

What was causing this? I knew it but I forgot.  :facepalm:

Ordering? wrong bumpmap?

If anyone gets this issue, I found the solution with a remind of a friend of mine. When you want to add a thing, you will want to put the material AND the texture to the brf. My fault in here was not adding the texture.
 
imado552 said:
kraggrim ?️ said:
Brytenwalda has factions of varying size, check their code (or the VC code)

Thank you never thought of this i'll check them right now! Arigato Gozaimasu!

Edit : i just finished checking half of it and damn doing it like that will burn my brain alive lol but at least it should be good and fix my problem as far as i saw i need to create new slots and edit some stuff  and maybe i can get it to work thanks again for the help ! (correct me if i forgot something !)
i did change the "initialize_aristocraty" to everything manual and i did the work
2017-07-29_212923.png
and everything works when i check the lords and their family relations they are correct but i still have the same problem vassals from other clans are leaders of other clans and the leaders of those clans are vassals help really i'm starting to grow white beard ^.^
but in game
2017-07-29_213342.png
help is really needed
 
The leader should be set in game_start:

# Factions:
      (faction_set_slot, "fac_kingdom_1",  slot_faction_culture, "fac_culture_1"),
      (faction_set_slot, "fac_kingdom_1",  slot_faction_leader, "trp_kingdom_1_lord"),
      (troop_set_slot, "trp_kingdom_1_lord", slot_troop_renown, 1200),


Are these kingdoms/troops set properly? I don't know if there's more to it than that.
 
Status
Not open for further replies.
Back
Top Bottom