I'm tinkering with a mod that I'm using the latest Diplomacy base for, which has a feature (if enabled) that randomises the gender of troops on the battlefield by assigning tf_male and tf_female to the troops.
I've added a new skin, tf_skeleton, using Barf's beautiful skeleton models. Works great, when I can see them. Unfortunately, the script (dplmc_random_mixed_gender) does this to them:
Which makes sense, the script is doing exactly what it's supposed to. Unfortunately, the flesh-skeletons are extremely upsetting to me.
Here's the script in question, and my failed attempts to fix the problem:
I'm convinced that I'm in the right area for putting a fix, but clearly I'm not doing it right. I also really want to avoid having to fold this into the is_between, since I don't know where this skeletons are going to end up in the troop list.
Can anybody give me some guidance on what to do?
I've added a new skin, tf_skeleton, using Barf's beautiful skeleton models. Works great, when I can see them. Unfortunately, the script (dplmc_random_mixed_gender) does this to them:
Which makes sense, the script is doing exactly what it's supposed to. Unfortunately, the flesh-skeletons are extremely upsetting to me.
Here's the script in question, and my failed attempts to fix the problem:
Code:
dplmc_random_mixed_gender = (ti_on_agent_spawn, 0, 0, [
(ge, "$g_disable_condescending_comments", 4),
],
[
(store_trigger_param_1, ":agent_no"),
(agent_is_human, ":agent_no"),
(agent_get_troop_id, ":troop_no", ":agent_no"),
(neg|troop_is_hero, ":troop_no"),
# (neg|troop_get_type, ":troop_no", tf_skeleton), ## Morgana - this breaks the whole code, apparently. - 24/05/23
(is_between, ":troop_no", soldiers_begin, "trp_follower_woman", "trp_caravan_master"), #skip refugee line, town walkers
#SB : check non-native troop genders
#get individual faction chances
(store_faction_of_troop, ":faction_no", ":troop_no"),
(try_begin), #TODO: this affects the next agent to spawn as well if custom ratio skewed too high
(agent_get_party_id, ":party_no", ":agent_no"),
(party_is_active, ":party_no"),
(store_faction_of_party, ":party_faction", ":party_no"),
# (eq, ":party_faction", "$players_kingdom"),
(call_script, "script_dplmc_get_troop_standing_in_faction", "trp_player", ":party_faction"),
(ge, reg0, DPLMC_FACTION_STANDING_LEADER),
(assign, ":faction_no", "fac_player_supporters_faction"),
(try_end),
(faction_get_slot, ":ratio", ":faction_no", slot_faction_gender_ratio),
(store_random_in_range, ":gender", -100, ":ratio"),
(try_begin),
# (troop_get_type, ":troop_no", tf_skeleton), ## This ALSO breaks it
# (troop_set_type, ":troop_no", tf_skeleton), ##
# (else_try), ##
(le, ":gender", 0),
(troop_set_type, ":troop_no", tf_male),
(else_try),
(troop_set_type, ":troop_no", tf_female),
(try_end),
])
I'm convinced that I'm in the right area for putting a fix, but clearly I'm not doing it right. I also really want to avoid having to fold this into the is_between, since I don't know where this skeletons are going to end up in the troop list.
Can anybody give me some guidance on what to do?