Hello Everyone.
I've been looking around the internet and asking a lot of people regarding this, I hope small, feature. I've come along with a nice person that helped me start with this, but I do not quite understand what should I implement into that in order for it to work. Here is the code:
(agent_get_troop_id, ":troop", ":agent"),
# Store surgery skill level for selected troop
(store_skill_level, ":surgery_skill", skl_surgery, ":troop"),
(assign, ":base_survival_chance", 25),
# surgery skill *4
(val_mul, ":surgery_skill", 4),
(store_add, ":actual_survival_chance", ":base_survival_chance", ":skl_surgery"),
(store_random_in_range, ":random", 0, 100),
(le, ":random", ":actual_survival_chance"),
try_begin
(le, ":random", ":actual_survival_chance"),
eq, ":agent_team", 0, # Team number of your enemies
lt, ":random_num", ":survival_chance"
I know that I need to add the try begin etc, but I couldn't find in triggers/mission templates anything that would allow me to knock out the agent instead of killing him if the surgery number is higher than the random one. All I've been doing was reading through those .py walls of codes to find what I need but apparently, I failed. As far as I know, the surgery itself is hardcoded and cannot be changed, which is unlucky cause it would be (I guess) much easier to just insert the agents from team 1 to that code so it would work along with my allies. Thanks for any help in advance .
I've been looking around the internet and asking a lot of people regarding this, I hope small, feature. I've come along with a nice person that helped me start with this, but I do not quite understand what should I implement into that in order for it to work. Here is the code:
(agent_get_troop_id, ":troop", ":agent"),
# Store surgery skill level for selected troop
(store_skill_level, ":surgery_skill", skl_surgery, ":troop"),
(assign, ":base_survival_chance", 25),
# surgery skill *4
(val_mul, ":surgery_skill", 4),
(store_add, ":actual_survival_chance", ":base_survival_chance", ":skl_surgery"),
(store_random_in_range, ":random", 0, 100),
(le, ":random", ":actual_survival_chance"),
try_begin
(le, ":random", ":actual_survival_chance"),
eq, ":agent_team", 0, # Team number of your enemies
lt, ":random_num", ":survival_chance"
I know that I need to add the try begin etc, but I couldn't find in triggers/mission templates anything that would allow me to knock out the agent instead of killing him if the surgery number is higher than the random one. All I've been doing was reading through those .py walls of codes to find what I need but apparently, I failed. As far as I know, the surgery itself is hardcoded and cannot be changed, which is unlucky cause it would be (I guess) much easier to just insert the agents from team 1 to that code so it would work along with my allies. Thanks for any help in advance .