Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
twinsens said:
I'm trying to setup the party reinforcements and am having some issues with lords recruiting units not in the kingdom_1_reinforcements_a,b or c.

For instance I've set swadian recruits to be upgradable to something else (my intention was for the player to use these upgrade paths not he A.I) but the AI is recruiting them even though the troop isn't listed in any of the reinforcements.

just using Morgh's, no MS. This is one of my final problems before going alpha but I'm totally stumped as to why they are appearing. I'm guessing there is a flag in Morgh maybe that I don't understand.

cheers for any help.
Armies in lord parties and centers upgrade their troops every once in a while (and maybe when recruited as well.) Search scripts for "party_upgrade_with_xp" and you should find it.

EDIT: Oh, morgh's. In that case, you will likely have to rethink the troop upgrades entirely. Modding without the module system is like trying to canoe upstream without a paddle. Not to say that it's impossible...
 
Maglubiyet said:
I'm trying to make it impossible to save (or quick-save) in a scene that uses a custom unique mission template. How would one do this?

you can disable the shortcuts for menu and quicksave using mission triggers, similar how you can control the inventory and finishing of a mission.



twinsens said:
I'm trying to setup the party reinforcements and am having some issues with lords recruiting units not in the kingdom_1_reinforcements_a,b or c.

you also need to update the slots related to what troops are used for the faction tiers

Code:
	  # Cultures:
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_culture_1",  slot_faction_tier_5_troop, "trp_swadian_knight"),

so look for that - translated to numbers - on your scripts.txt and do the changes
 
Helo all! Does anyone know, who made the script for AI artillery, which is used in l'Aigle mod? I recall that Docm30 bought that script from someone. Should I ask Docm30 for this script, or should I ask the author of the script directly? I wonder how much will it cost to buy this script.
 
Ivkolya said:
Helo all! Does anyone know, who made the script for AI artillery, which is used in l'Aigle mod? I recall that Docm30 bought that script from someone. Should I ask Docm30 for this script, or should I ask the author of the script directly? I wonder how much will it cost to buy this script.

You don’t need to buy it. It’s code from Twighlight of the Sun King which Dr Tomas made open source.
https://forums.taleworlds.com/index.php/topic,342969.0.html

I used it in my own mod. If I remember correctly, search all files for instances of cannon should flag most of the code and help you identify Dr Tomas’s code markers.
 
Totenkopf900 said:
How do I make a troop have a random name, does the troop need to be a hero for this to work?I want to add a common troop to the looters party and make it have a random name so it looks like it is a leader.

a hero-type troop is suppose to be unique (altho there is no engine rule enforcing it). So if by accident you have a clone in the world and one of them takes damage, both will lose HP (think a buggy party that has a player troop inside under AI control, as the player troop ID is zero (trp_player = 0)).

non hero-type troops are all the same. The HP is given to the stack, no the individual units. You cant control the individual name, as there are no individual troops. Change the name of one and it would change the name in all parties in the world. Same applies to gear and stats.

what you can do is give a generic name like [Captain] and have the menus/dialogs use a random name (fake name). You can create multiple hero-type units to lead those parties (just like lords). And so on.



KratosMKII said:
Is it possible to edit the maximum amount of a particular equipment that can stay on the ground during a battle? Quivers disappear almost immediately during sieges.
you can control some basic things like how much time they stay in. For fine control you need a trigger to implement your logic and use a fade out command (operation).
 
hello everyone, can someone tell me why I'm having this problem? despite getting everything right?
guIFsFb.png
And is there any solution to it?
 
NPC99 said:
You don’t need to buy it. It’s code from Twighlight of the Sun King which Dr Tomas made open source.
https://forums.taleworlds.com/index.php/topic,342969.0.html

I used it in my own mod. If I remember correctly, search all files for instances of cannon should flag most of the code and help you identify Dr Tomas’s code markers.

Wow, thank you again, NPC99, I really hope I can make this code work with my mod! :smile:
 
imado552 said:
hello everyone, can someone tell me why I'm having this problem? despite getting everything right?
guIFsFb.png
And is there any solution to it?

I look like your skin texture is missing, check if skin texture is in textures.brf and not just in textures folder. Is it happening with all skins or just this one?
 
Ivkolya said:
imado552 said:
hello everyone, can someone tell me why I'm having this problem? despite getting everything right?
guIFsFb.png
And is there any solution to it?

I look like your skin texture is missing, check if skin texture is in textures.brf and not just in textures folder. Is it happening with all skins or just this one?
I have them in the texture_brf and it happens with only a few faces. That's what's confusing me, why only those few from the rest? especially when they are the same!
 
Hello! I added extra menu options to town's menu, so I got a problem with passages at scenes: I did not change any scenes, but beсause menu options order was changed, passages began to work not correctly. For example: passage to the prison became passage to the arena. Can this be fixed quickly? Maybe, write modsys script? Just I do not want slowly manually modify all scenes (.sco).
 
Code:
reassign_archers_to_division = [     
(ti_on_item_unwielded, 0, 0, [], #Out of Ammo Trigger
   [
    (store_trigger_param_2, ":weapon"),
    (ge, ":weapon", 0),
    (item_get_type, ":type", ":weapon"),
    (this_or_next|eq, ":type", itp_type_bow),
    (eq, ":type", itp_type_crossbow),
   
    (store_trigger_param_1, ":agent"),
    (agent_is_active, ":agent"),
    (agent_is_alive, ":agent"),
    (agent_is_non_player, ":agent"),
   
    (agent_get_ammo, ":ammo", ":agent", 0),
    (le, ":ammo", 0),   
    (agent_get_horse, ":horse", ":agent"),
    (eq, ":horse", -1),
   
    (assign, ":continue", 1),
    (try_begin),
        (this_or_next|party_slot_eq, "$g_encountered_party", slot_party_type, spt_town), #Sieges
        (party_slot_eq, "$g_encountered_party", slot_party_type, spt_castle),   
        (agent_get_team, ":team", ":agent"),   
        (this_or_next|eq, ":team", "$defender_team"),
        (eq, ":team", "$defender_team_2"),
        (assign, ":continue", 0), #To not reassign units that will get their ammo refilled.
    (try_end),
    (eq, ":continue", 1),   
 
    (agent_set_division, ":agent", 4),
    (agent_set_slot, ":agent", slot_agent_new_division, 4),
 
   ]),
   
(ti_on_agent_spawn, 0, 0, [], 
    [
    (store_trigger_param_1, ":agent"),
    (agent_set_slot, ":agent", slot_agent_new_division, -1),
    ]),

(1, 0, 0, [],
   [
    (try_for_agents, ":agent"),
        (agent_is_active, ":agent"),
        (agent_slot_ge, ":agent", slot_agent_new_division, 0),
        (agent_is_alive, ":agent"),
        (agent_get_division, ":division", ":agent"),
        (neg|agent_slot_eq, ":agent", slot_agent_new_division, ":division"),
        (agent_get_slot, ":new_div", ":agent", slot_agent_new_division),
        (agent_set_division, ":agent", ":new_div"),
    (try_end),   
   ]),

]
Why doesn't this work? I keep getting a "cannot convert to float" error.

Constant:
Code:
slot_agent_new_division = 46
 
kalarhan said:
KratosMKII said:
Why doesn't this work? I keep getting a "cannot convert to float" error.

post the actual error message (you can get it from rgl_log.txt by enabling edit mode)
The error appears during compilation.

Wtf? When i add reassign_horseless_cavalry_to_division to the trigger below in mission_templates, the error doesn't appear anymore:

charge_trigger = [
  (0, 0, ti_once, [
  (eq, 0, 1), ##AI should take over
  (eq, "$enable_deahtcam", 1),#tom
  (main_hero_fallen), 
  ], [
        (assign, "$fclock", 1),
        (call_script, "script_player_order_formations", mordr_charge),

    (get_player_agent_no, ":player"),
    (agent_get_team, ":team_no", ":player"),
    (team_give_order, ":team_no", grc_everyone, mordr_charge),
  ]),
 
  reassign_horseless_cavalry_to_division,  ########## NEW v2.1
]

and instead i get this error:

*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... FAILED.
MODULE `mission_templates` ERROR:
failed to parse element #6
  failed to parse element #25
    cannot convert value [-25.0, 0, 0, [], [(2071, ':agent'), (505, ':agent', 46
, -1)]] to float


COMPILATION FAILED.

Press any key to continue . . .

which is related to this:
reassign_horseless_cavalry_to_division = [   
(ti_on_agent_spawn, 0, 0, [],
[
(store_trigger_param_1, ":agent"),
(agent_set_slot, ":agent", slot_agent_new_division, -1),
]), #De-Horse trigger 0


(ti_on_agent_spawn, 0, 0, [], #De-Horse Trigger 1
  [
    (store_trigger_param_1, ":horse"),
   
    (try_begin),
        (neg|agent_is_human, ":horse"),   
        (agent_get_rider, ":rider", ":horse"),
        (ge, ":rider", 0), #I don't know if any of these checks are necessary
        (agent_is_active, ":rider"),
        (agent_is_alive, ":rider"),
        (agent_is_non_player, ":rider"),
    (else_try),
        (assign, ":rider", -1),
    (try_end),
   
    (agent_set_slot, ":horse", slot_agent_horse_rider, ":rider"),
  ]),

(ti_on_agent_killed_or_wounded, 0, 0, [], #De-Horse Trigger 2
  [
    (store_trigger_param_1, ":dead_horse"),
    (neg|agent_is_human, ":dead_horse"),
   
    (agent_get_slot, ":rider", ":dead_horse", slot_agent_horse_rider),
    (ge, ":rider", 0),
    (agent_is_active, ":rider"),
    (agent_is_alive, ":rider"),
    (agent_is_non_player, ":rider"),
    (store_random_in_range, ":chance_of_death", 0, 100),
    (try_begin),
      (le, ":chance_of_death", 20),
      (agent_deliver_damage_to_agent, ":dead_horse", ":rider", 500),
    (else_try),
      (agent_set_division, ":rider", grc_infantry),
      (agent_set_slot, ":rider", slot_agent_new_division, grc_infantry),
    (try_end),
  ]),

(1, 0, 0, [],
  [
    (try_for_agents, ":agent"),
        (agent_is_active, ":agent"),
        (agent_slot_ge, ":agent", slot_agent_new_division, 0),
        (agent_is_alive, ":agent"),
        (agent_get_division, ":division", ":agent"),
        (neg|agent_slot_eq, ":agent", slot_agent_new_division, ":division"),
        (agent_get_slot, ":new_div", ":agent", slot_agent_new_division),
        (agent_set_division, ":agent", ":new_div"),
    (try_end), 
  ]),

]

When i remove the reassign_horseless_cavalry_to_division  from the charge_trigger i get the first error again:
*** Warband Refined & Enhanced Compiler Kit (W.R.E.C.K.) version 1.0.0 ***
Please report errors, problems and suggestions at http://lav.lomskih.net/wreck/

Loading module... DONE.
Loading plugins... DONE.
Checking module syntax... FAILED.
MODULE `mission_templates` ERROR:
failed to parse element #6
  failed to parse element #29
    cannot convert value [-58.0, 0, 0, [], [(2072, ':weapon'), (30, ':weapon', 0
), (1570, ':type', ':weapon'), (1073741855, ':type', :cool:, (31, ':type', 9), (2071
, ':agent'), (1712, ':agent'), (1702, ':agent'), (1707, ':agent'), (1727, ':ammo
', ':agent', 0), (2147483680L, ':ammo', 0), (1714, ':horse', ':agent'), (31, ':h
orse', -1), (2133, ':continue', 1), 4, (1073742365, '$g_encountered_party', 0, 3
), (541, '$g_encountered_party', 0, 2), (1770, ':team', ':agent'), (1073741855,
':team', '$defender_team'), (31, ':team', '$defender_team_2'), (2133, ':continue
', 0), 3, (31, ':continue', 1), (1783, ':agent', 4), (505, ':agent', 46, 4)]] to
float


COMPILATION FAILED.

Press any key to continue . . .
 
Make sure you have (or don't have) commas on the preceding definitions (longshot.) Also make sure you are adding those to the correct place in the mission template, collections of triggers can't be called within the execution block like normal trigger definitions, you have to append them:

Code:
[
execute block
] + extra_triggers

I'm not really sure since I'm not used to WRECK, but it seems like it is trying to interpret the whole line as a single float value..?
 
Status
Not open for further replies.
Back
Top Bottom