

kalarhan 说:see header_xxx.py for the engine options
header_triggers.py
插入代码块:ti_on_order_issued = -71.0 # An agent has issued a tactical order # trigger param 1 = order_code (see mordr_* constants in header_mission_templates.py) # trigger param 2 = agent_id
voice_commands = (
ti_on_order_issued, 0, 1, [],
[(get_player_agent_no, ":player"),
(store_trigger_param_1, ":order"),
(try_begin),
(eq, ":order", "mordr_charge"),
(agent_play_sound, ":player", "snd_order_charge"),
(try_end),
],
)
This code will compare 8 and 9, not the content of strings.MaHuD 说:Is it possible to do something like str_equals without using WSE?
Should the eq command work when comparing two strings?
插入代码块:(eq, s9, s8),
Bustah 说:However, it just doesn't. I know I'm missing something
(ti_on_order_issued, 0, 0,
[
(store_trigger_param, ":order_no", 1),
(assign, reg7, ":order_no"),
(eq, ":order_no", mordr_charge),
],
[
(try_for_agents, ":agent"),
(agent_get_troop_id, ":agent_troop", ":agent"),
(eq, ":agent_troop", "trp_todos_cuerno"), #hornman
(store_random_in_range, ":rand", 0, 2),
(eq, ":rand", 1),
(call_script, "script_agent_perform_horn", ":agent"),
(end_try),
]),
Thank you Leonion!Leonion 说:This code will compare 8 and 9, not the content of strings.MaHuD 说:Is it possible to do something like str_equals without using WSE?
Should the eq command work when comparing two strings?
插入代码块:(eq, s9, s8),
s8 and s9 (or - another example - pos8 and pos9) are just constants.
Only when you treat them as strings/positions using special operations, they work as ones.

kalarhan 说:See how you used quotes on your constant for charge.
#voice commands start
#voice_commands bustah adds audio to all in game orders
voice_commands = (
ti_on_order_issued, 0, 1, [(store_trigger_param_1, ":order"),
(this_or_next|eq, ":order", mordr_charge,
eq, ":order", mordr_follow)],
[
(store_trigger_param_1, ":order"),
(store_trigger_param_2, ":agent"),
(try_begin),
(eq, ":order", mordr_charge),
(assign, ":order", "snd_order_charge"),
(else_try),
(eq, ":order", mordr_follow),
(assign, ":order", "snd_order_follow"),
(try_end),
(call_script, "script_play_voice_command", ":agent", ":order"),
],
)
#voice commands end
#play voice command begin
#play_voice_command bustah script to play voice orders from mission template
("play_voice_command",
[
(store_script_param, ":player_agent", 1),
(store_script_param, ":command", 2),
(agent_play_sound, ":player_agent", ":command"),
]),
#play voice command end
you are missing the closing ")" there. Each operation is a Python tuple, so it must be inside a "( )"Bustah 说:voice_commands = (
ti_on_order_issued, 0, 1, [(store_trigger_param_1, "rder"),
(this_or_next|eq, "rder", mordr_charge,
eq, "rder", mordr_follow)],
Bustah 说:(this_or_next|eq, "rder", mordr_charge),
(eq, "rder", mordr_follow)],

kalarhan 说:you are missing the closing ")" there. Each operation is a Python tuple, so it must be inside a "( )"Bustah 说:voice_commands = (
ti_on_order_issued, 0, 1, [(store_trigger_param_1, "rder"),
(this_or_next|eq, "rder", mordr_charge,
eq, "rder", mordr_follow)],
Bustah 说:(this_or_next|eq, "rder", mordr_charge),
(eq, "rder", mordr_follow)],
check how to do proper indentation of your code, it will help make it more readable. VC modsys, as a example, has a more advanced version of process_line_correction.py, you could check that out (it will require some clean-up of your modsys to apply the automatic process, but it is worth it)
https://github.com/KalarhanWB/VC_Tweaks_Tool/blob/master/app/process_line_correction.py
https://github.com/KalarhanWB/VC_Tweaks_Tool/blob/master/app/line_correction.bat
a example of a file with proper indentation https://raw.githubusercontent.com/KalarhanWB/VC_Tweaks_Tool/master/app/module_mission_templates.py
You mean when an agent has 2 shields?fladin 说:Hello,
Is there an operator (or a script) to make agent re-putting his shield behind his back, executing the command "equip next shield" (mouse scroll down)?
agent_set_wielded_item = 1747 # (agent_set_wielded_item, <agent_id>, <item_id>),
# Forces the agent to wield the specified item. Agent must have that item in his equipment for this to work. Use item_id = -1 to unwield any currently wielded item.
agent_equip_item = 1779 # (agent_equip_item, <agent_id>, <item_id>, [weapon_slot_no]),
# Adds the specified item to agent and forces him to equip it. Optional weapon_slot_no parameter is only used with weapons and will put the newly added item to that slot (range 1..4). If it is omitted with a weapon item, then the agent must have an empty weapon slot for the operation to succeed.
You mean when an agent has 2 shields?
fladin 说:No, when an agent has 1shield and 1 spear (or any wielded weapon)...
That's a good idea, first I was thinking of a solution where I don't have to duplicate weapons (I'm too lazygive that agent a 2-handed version of that weapon (spear)
In Pre-Battle Orders and Deployment kit (PBOD) there's a command the player can use to make a battle-group equip or unequip their shields:fladin 说:You mean when an agent has 2 shields?
No, when an agent has 1shield and 1 spear (or any wielded weapon)...
for example, I would like him to put/return his shield on his back and use his spear as pike (like when the player uses mouse scroll down).
Currently I make him throw his shield, but I prefer that he keeps it (just in case?)
If I recall correctly, when you unequip your shield when wielding a spear it defaults to a two-handed stance and animations using the spear "as a pike" or he can make a "new" spear type with the proper attacks by creating the correct item capabilities (itc) set in header_items. Or am I misunderstanding the whole point?kalarhan 说:
Seek n Destroy 说:Or am I misunderstanding the whole point?

Bustah 说:However I can't seem to find where the game decides whether an agent dies or is wounded
ti_on_agent_killed_or_wounded = -26.0 # Agent has been defeated in battle (killed or wounded)
# trigger param 1 = defeated agent_id
# trigger param 2 = attacker agent_id
# trigger param 3 = wounded flag: 0 = agent is killed, 1 = agent is wounded
# If (set_trigger_result) with non-zero parameter is used in the code, it will override the agent's fate. Use value of 1 to force kill, and 2 to force wounded.