PYTHON SCRIPT/SCHEME EXCHANGE

Users who are viewing this thread

Oh crap. Thats what I need to fix. I've never done any coding for mission templates, so I pretty much just pasted in that trigger.

  :smile:
 
I interpreted that as "put that in module_mission_templates.py.

:lol:


Edit: What line does that template start on?

Edit2: I got it to compile without errors! Yay! Time to test!
 
Mirathei said:
(0, 0, 0, [(key_pressed,whatever_key),],[(call_script,"script_whichever_formation_script"),]),

Does that make any sense?

I got a question about this.  Does this mean the trigger runs less than every second or only when the key is pressed?
 
Jallon said:
Well, the code for mission templates is very short. Maybe it needs more stuff. After looking throught mission templates, it doesn't seem to look how it should. It doesn't have an Id, or anything.

Here is the code..

Code:
(0, 0, 0, [(key_clicked,key_f),],[(call_script,"script_formation"),]),

Thats actually the revised code. And the formation only occurs when you hit the key f. (or whatever key you set it to.) Your men then make the formation, and stand still. They will not follow you. If you move, you have to press f again to get them to make the formation again.

In answer to your question, only when the key is pressed.



And mirathei, I dont know if the formation didn't work just because I didn't have enough men, but I only had one line of men. I think its because I only had 10 troops, so it only had enough men to make one row.

A quick question, If I change the code to 4 men per row and column, and I have many troops, how will the formation work? Will there be many different squares, or will it be one big square with all of the small squares mashed together?
 
Combat Abilities
When in battle you can periodically (every two-three minutes) activate combat abilities. They are

Rage (15 strength required, press J key)
+5 power strike, power draw, power throw, ironflesh.
+20 strength, +5 agility.

this costs 15 experience per level, and lasts for [twice strength level] seconds.
after that time the skills/stats return to normal.

Combat Focus (15 intelligence required, press H key)
+[ten times intelligence level] proficiency to all weapons.
+5 agility.

this costs 10 experience per level, and lasts for [twice intelligence level] seconds.
after that time the skills/stats return to normal.

Sprint (15 agility required, press K key)
+5 athletics.
+15 agility.

this costs 7 experience per level, and lasts for [agility level] seconds.
after that time the skills/stats return to normal.

The duration of combat abilities can be extended by 10 seconds by carrying an Endurance Charm.

Add to combat missions in mission_templates (random battle, siege, village raid)
Code:
##### rage NEW4

     (1, 0, ti_once, [], [

                (assign, reg19, 1),

         ]),

     (0, 0, 150, [(key_clicked, key_j), (store_attribute_level,reg4,"trp_player",0),(ge,reg4,15),(eq,reg19,1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You rage in battle!"),                 
                 (reset_mission_timer_b),

                 (assign, reg19, 2),
                 (store_attribute_level,reg2,"trp_player",0),
                 (val_mul,reg2,2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,reg2,10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                 (store_skill_level,reg20,"skl_ironflesh","trp_player"),
                 (store_skill_level,reg21,"skl_power_strike","trp_player"),
                 (store_skill_level,reg22,"skl_power_draw","trp_player"),
                 (store_skill_level,reg23,"skl_power_throw","trp_player"),                 
                 
                 (troop_raise_skill,"trp_player","skl_power_strike",5),
                 (troop_raise_skill,"trp_player","skl_power_draw",5),
                 (troop_raise_skill,"trp_player","skl_ironflesh",5),
                 (troop_raise_skill,"trp_player","skl_power_throw",5),

                 (store_skill_level,reg24,"skl_ironflesh","trp_player"),
                 (store_skill_level,reg25,"skl_power_strike","trp_player"),
                 (store_skill_level,reg26,"skl_power_draw","trp_player"),
                 (store_skill_level,reg27,"skl_power_throw","trp_player"),                 
         
                 (troop_raise_attribute,"trp_player",0,20),
                 (troop_raise_attribute,"trp_player",1,5),

            
         ]),

     (1, 0, 0, [(store_mission_timer_b,reg10),(gt,reg10,reg2),(eq,reg19,2)], [

                 (val_sub,reg20,reg24),
                 (val_sub,reg21,reg25),
                 (val_sub,reg22,reg26),
                 (val_sub,reg23,reg27),             

                 (troop_raise_skill,"trp_player","skl_ironflesh",reg20),
                 (troop_raise_skill,"trp_player","skl_power_strike",reg21),
                 (troop_raise_skill,"trp_player","skl_power_draw",reg22),
                 (troop_raise_skill,"trp_player","skl_power_throw",reg23),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, reg19, 1),

         ]),


     (1, 0, 0, [(main_hero_fallen),(eq,reg19,2)], [

                 (val_sub,reg20,reg24),
                 (val_sub,reg21,reg25),
                 (val_sub,reg22,reg26),
                 (val_sub,reg23,reg27),             

                 (troop_raise_skill,"trp_player","skl_ironflesh",reg20),
                 (troop_raise_skill,"trp_player","skl_power_strike",reg21),
                 (troop_raise_skill,"trp_player","skl_power_draw",reg22),
                 (troop_raise_skill,"trp_player","skl_power_throw",reg23),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, reg19, 1),

         ]),      

     (ti_tab_pressed, 0, 0, [(eq,reg19,2)], [

                 (val_sub,reg20,reg24),
                 (val_sub,reg21,reg25),
                 (val_sub,reg22,reg26),
                 (val_sub,reg23,reg27),             

                 (troop_raise_skill,"trp_player","skl_ironflesh",reg20),
                 (troop_raise_skill,"trp_player","skl_power_strike",reg21),
                 (troop_raise_skill,"trp_player","skl_power_draw",reg22),
                 (troop_raise_skill,"trp_player","skl_power_throw",reg23),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, reg19, 1),

         ]),      



######### rage end      
      
##### sprint NEW5

     (0, 0, 100, [(key_clicked, key_k),(store_attribute_level,reg4,"trp_player",1),(ge,reg4,15),(eq,reg19,1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You push yourself to the limit!"),                 
                 (reset_mission_timer_b),

                 (assign, reg19, 3),
                 (store_attribute_level,reg2,"trp_player",1),
#                 (val_mul,reg2,2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,reg2,10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                 (store_skill_level,reg20,"skl_athletics","trp_player"),

                 (troop_raise_skill,"trp_player","skl_athletics",5),         
                 (troop_raise_attribute,"trp_player",1,15),

                 (store_skill_level,reg24,"skl_athletics","trp_player"),                 



            
         ]),

     (1, 0, 0, [(store_mission_timer_b,reg10),(gt,reg10,reg2),(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath.. (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, reg19, 1),

         ]),

     (1, 0, 0, [(main_hero_fallen),(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath... (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       


                 (assign, reg19, 1),
         ]),      

     (ti_tab_pressed, 0, 0, [(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath... (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       


                 (assign, reg19, 1),
         ]),      


######### sprint end

##### focus NEW4

     (0, 0, 150, [(key_clicked, key_h),(store_attribute_level,reg4,"trp_player",2),(ge,reg4,15),(eq,reg19,1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You focus on your weapon completely!"),                 
                 (reset_mission_timer_b),

                 (assign, reg19, 4),
                 (store_attribute_level,reg2,"trp_player",2),
                 (store_attribute_level,reg20,"trp_player",2),

                 (val_mul,reg20,10),                 
                 (val_mul,reg2,2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,reg2,10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                (troop_raise_proficiency_linear,"trp_player",0,reg20),
                (troop_raise_proficiency_linear,"trp_player",1,reg20),
                (troop_raise_proficiency_linear,"trp_player",2,reg20),
                (troop_raise_proficiency_linear,"trp_player",3,reg20),
                (troop_raise_proficiency_linear,"trp_player",4,reg20),
                (troop_raise_proficiency_linear,"trp_player",5,reg20),                          

                 (troop_raise_attribute,"trp_player",1,5),

            
         ]),

     (1, 0, 0, [(store_mission_timer_b,reg10),(gt,reg10,reg2),(eq,reg19,4)], [

                 (val_mul,reg20,-1),

                (troop_raise_proficiency_linear,"trp_player",0,reg20),
                (troop_raise_proficiency_linear,"trp_player",1,reg20),
                (troop_raise_proficiency_linear,"trp_player",2,reg20),
                (troop_raise_proficiency_linear,"trp_player",3,reg20),
                (troop_raise_proficiency_linear,"trp_player",4,reg20),
                (troop_raise_proficiency_linear,"trp_player",5,reg20),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, reg19, 1),

         ]),

      (1, 0, 0, [(main_hero_fallen),(eq,reg19,4)], [

  (val_mul,reg20,-1),

                (troop_raise_proficiency_linear,"trp_player",0,reg20),
                (troop_raise_proficiency_linear,"trp_player",1,reg20),
                (troop_raise_proficiency_linear,"trp_player",2,reg20),
                (troop_raise_proficiency_linear,"trp_player",3,reg20),
                (troop_raise_proficiency_linear,"trp_player",4,reg20),
                (troop_raise_proficiency_linear,"trp_player",5,reg20),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, reg19, 1),
         ]),      

     (ti_tab_pressed, 0, 0, [(eq,reg19,4)], [

                 (val_mul,reg20,-1),

                (troop_raise_proficiency_linear,"trp_player",0,reg20),
                (troop_raise_proficiency_linear,"trp_player",1,reg20),
                (troop_raise_proficiency_linear,"trp_player",2,reg20),
                (troop_raise_proficiency_linear,"trp_player",3,reg20),
                (troop_raise_proficiency_linear,"trp_player",4,reg20),
                (troop_raise_proficiency_linear,"trp_player",5,reg20),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, reg19, 1),


         ]),      

######### focus end     


Add to scripts
Code:
  ("rage_exp_penalty",
    [(store_character_level,":level","trp_player"),
     (val_mul,":level",-15),
     (add_xp_to_troop,":level","trp_player"),
     ]),

    ("sprint_exp_penalty",
    [(store_character_level,":level","trp_player"),
     (val_mul,":level",-7),
     (add_xp_to_troop,":level","trp_player"),
     ]),

    ("focus_exp_penalty",
    [(store_character_level,":level","trp_player"),
     (val_mul,":level",-10),
     (add_xp_to_troop,":level","trp_player"),
     ]),
 
this might be a very silly question, but...

There is the itcf_shoot_mask function.   So far as I can tell, it is identical to the -shoot_crossbow function.   Is it?

If I alter the animations in module_animations, do I need to do anything with the functions in header_operations, or will the alterations take place automatically?

(I want to create a ranged weapon which, when fired, will cause NO movement.)
 
Chel said:
Combat Abilities
When in battle you can periodically (every two-three minutes) activate combat abilities. They are
....

I have this in modplosion!!;

Code:
	  (0.1,0,ti_once,[
(get_player_agent_no, ":player_agent"),
(store_agent_hit_points, ":player_hp", ":player_agent"),
(lt, ":player_hp", 30), (eq, "$perk_warrior2", 1),
],[
(store_random_in_range, ":rand", 0, 5),(get_player_agent_no, ":player_agent"),(store_agent_hit_points, ":player_hp", ":player_agent"),
(try_begin),
(ge, ":rand", 3),
(lt, ":player_hp", 20),
(agent_set_hit_points, ":player_agent", 100),
(else_try),
(agent_set_hit_points, ":player_agent", 50),
(try_end)]),
 
There was a small bug in the Sprint ability code here:
http://forums.taleworlds.com/index.php/topic,8652.msg785734.html#msg785734
(fixed now)

the correct code is (post into combat missions in 'module_mission_templates'):
Code:
     (0, 0, 100, [(key_clicked, key_k),(store_attribute_level,reg4,"trp_player",1),(ge,reg4,15),(eq,reg19,1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You push yourself to the limit!"),                 
                 (reset_mission_timer_b),

                 (assign, reg19, 3),
                 (store_attribute_level,reg2,"trp_player",1),
#                 (val_mul,reg2,2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,reg2,10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                 (store_skill_level,reg20,"skl_athletics","trp_player"),

                 (troop_raise_skill,"trp_player","skl_athletics",5),         
                 (troop_raise_attribute,"trp_player",1,15),

                 (store_skill_level,reg24,"skl_athletics","trp_player"),                 



            
         ]),

     (1, 0, 0, [(store_mission_timer_b,reg10),(gt,reg10,reg2),(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath.. (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, reg19, 1),

         ]),

     (1, 0, 0, [(main_hero_fallen),(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath... (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       


                 (assign, reg19, 1),
         ]),      

     (ti_tab_pressed, 0, 0, [(eq,reg19,3)], [

                 (val_sub,reg20,reg24),

                 (troop_raise_skill,"trp_player","skl_athletics",reg20),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath... (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       


                 (assign, reg19, 1),
         ]),     
 
I have something similar to that in my mod, but yours is better and less complicated.  Now if only my computer didnt have a windows/system32/config/system file corruption I could make mine better....
 
Chel: Are the registries global? I always thought they weren't. You should rather use variables instead anyway. If there is any script that uses them (reg19 for example) as well, you probably get a lot of problems. Very nice script otherwise.
 
Highlander said:
Chel: Are the registries global? I always thought they weren't. You should rather use variables instead anyway. If there is any script that uses them (reg19 for example) as well, you probably get a lot of problems. Very nice script otherwise.

I think something like that was causing problems in my death/wound sceme. I guess reg are global then?
Variables would be 'var1', 'var2', right? And they would hold their value between triggers? Thanks Highlander.

EDIT: or wait, are variables these  -- "$name"? Would I have to define them in module_variables before using?
I tried ":name", but they don't seem to hold across triggers.

EDIT2: I think "$name" are global variables.
Here's the abilities code with them replacing the reg ones:
Code:
##### rage NEW7

     (1, 0, ti_once, [], [

                (assign, "$ability", 1),

         ]),

     (0, 0, 150, [(key_clicked, key_j), (store_attribute_level,"$attribute","trp_player",0),(ge,"$attribute",15),(eq,"$ability",1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You rage in battle!"),                 
                 (reset_mission_timer_b),

                 (assign, "$ability", 2),
                 (store_attribute_level,"$attribue2","trp_player",0),
                 (val_mul,"$attribue2",2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,"$attribue2",10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                 (store_skill_level,"$iron","skl_ironflesh","trp_player"),
                 (store_skill_level,"$strike","skl_power_strike","trp_player"),
                 (store_skill_level,"$draw","skl_power_draw","trp_player"),
                 (store_skill_level,"$throw","skl_power_throw","trp_player"),                 
                 
                 (troop_raise_skill,"trp_player","skl_power_strike",5),
                 (troop_raise_skill,"trp_player","skl_power_draw",5),
                 (troop_raise_skill,"trp_player","skl_ironflesh",5),
                 (troop_raise_skill,"trp_player","skl_power_throw",5),

                 (store_skill_level,"$ironnew","skl_ironflesh","trp_player"),
                 (store_skill_level,"$strikenew","skl_power_strike","trp_player"),
                 (store_skill_level,"$drawnew","skl_power_draw","trp_player"),
                 (store_skill_level,"$thrownew","skl_power_throw","trp_player"),                 
         
                 (troop_raise_attribute,"trp_player",0,20),
                 (troop_raise_attribute,"trp_player",1,5),

            
         ]),

     (1, 0, 0, [(store_mission_timer_b,"$timer"),(gt,"$timer","$attribue2"),(eq,"$ability",2)], [

                 (val_sub,"$iron","$ironnew"),
                 (val_sub,"$strike","$strikenew"),
                 (val_sub,"$draw","$drawnew"),
                 (val_sub,"$throw","$thrownew"),             

                 (troop_raise_skill,"trp_player","skl_ironflesh","$iron"),
                 (troop_raise_skill,"trp_player","skl_power_strike","$strike"),
                 (troop_raise_skill,"trp_player","skl_power_draw","$draw"),
                 (troop_raise_skill,"trp_player","skl_power_throw","$throw"),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, "$ability", 1),

         ]),


     (1, 0, 0, [(main_hero_fallen),(eq,"$ability",2)], [

                 (val_sub,"$iron","$ironnew"),
                 (val_sub,"$strike","$strikenew"),
                 (val_sub,"$draw","$drawnew"),
                 (val_sub,"$throw","$thrownew"),             

                 (troop_raise_skill,"trp_player","skl_ironflesh","$iron"),
                 (troop_raise_skill,"trp_player","skl_power_strike","$strike"),
                 (troop_raise_skill,"trp_player","skl_power_draw","$draw"),
                 (troop_raise_skill,"trp_player","skl_power_throw","$throw"),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, "$ability", 1),

         ]),      

     (ti_tab_pressed, 0, 0, [(eq,"$ability",2)], [

                 (val_sub,"$iron","$ironnew"),
                 (val_sub,"$strike","$strikenew"),
                 (val_sub,"$draw","$drawnew"),
                 (val_sub,"$throw","$thrownew"),             

                 (troop_raise_skill,"trp_player","skl_ironflesh","$iron"),
                 (troop_raise_skill,"trp_player","skl_power_strike","$strike"),
                 (troop_raise_skill,"trp_player","skl_power_draw","$draw"),
                 (troop_raise_skill,"trp_player","skl_power_throw","$throw"),

                 (troop_raise_attribute,"trp_player",0,-20),
                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your rage dies down... (you lose some experience)"),
                 (call_script, "script_rage_exp_penalty"),       

                 (assign, "$ability", 1),

         ]),      



######### rage end      
      
##### sprint NEW7

     (0, 0, 100, [(key_clicked, key_k),(store_attribute_level,"$attribute","trp_player",1),(ge,"$attribute",15),(eq,"$ability",1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You push yourself to the limit!"),                 
                 (reset_mission_timer_b),

                 (assign, "$ability", 3),
                 (store_attribute_level,"$attribue2","trp_player",1),
#                 (val_mul,"$attribue2",2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,"$attribue2",10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                 (store_skill_level,"$athletics","skl_athletics","trp_player"),

                 (troop_raise_skill,"trp_player","skl_athletics",5),         
                 (troop_raise_attribute,"trp_player",1,15),

                 (store_skill_level,"$athleticsnew","skl_athletics","trp_player"),                 



            
         ]),

     (1, 0, 0, [(store_mission_timer_b,"$timer"),(gt,"$timer","$attribue2"),(eq,"$ability",3)], [

                 (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath.. (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),

         ]),

     (1, 0, 0, [(main_hero_fallen),(eq,"$ability",3)], [

                 (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath.. (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),
         ]),      

     (ti_tab_pressed, 0, 0, [(eq,"$ability",3)], [

                   (val_sub,"$athletics","$athleticsnew"),

                 (troop_raise_skill,"trp_player","skl_athletics","$athletics"),

                 (troop_raise_attribute,"trp_player",1,-15),                    

                 (display_message,"@You are out of breath.. (you lose some experience)"),
                 (call_script, "script_sprint_exp_penalty"),       

                 (assign, "$ability", 1),
         ]),      


######### sprint end

##### focus NEW7

     (0, 0, 150, [(key_clicked, key_h),(store_attribute_level,"$attribute","trp_player",2),(ge,"$attribute",15),(eq,"$ability",1),(neg|main_hero_fallen)], [
                 (play_sound,"snd_player_heartbeat"),
                 (display_message,"@You focus on your weapon completely!"),                 
                 (reset_mission_timer_b),

                 (assign, "$ability", 4),
                 (store_attribute_level,"$attribue2","trp_player",2),
                 (store_attribute_level,"$bonus","trp_player",2),

                 (val_mul,"$bonus",10),                 
                 (val_mul,"$attribue2",2),
                (try_begin),
                     (player_has_item,"itm_charm_b"),
                     (val_add,"$attribue2",10),
                     (display_message,"@Your endurance charm gets warm "),             
                (else_try),
                (try_end),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),                          

                 (troop_raise_attribute,"trp_player",1,5),

            
         ]),

     (1, 0, 0, [(store_mission_timer_b,"$timer"),(gt,"$timer","$attribue2"),(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),

         ]),

      (1, 0, 0, [(main_hero_fallen),(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),
         ]),      

     (ti_tab_pressed, 0, 0, [(eq,"$ability",4)], [

                 (val_mul,"$bonus",-1),

                (troop_raise_proficiency_linear,"trp_player",0,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",1,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",2,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",3,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",4,"$bonus"),
                (troop_raise_proficiency_linear,"trp_player",5,"$bonus"),           

                 (troop_raise_attribute,"trp_player",1,-5),                    

                 (display_message,"@Your lose your focus... (you lose some experience)"),
                 (call_script, "script_focus_exp_penalty"),       

                 (assign, "$ability", 1),


         ]),      

######### focus end     


And here is the death/wound/recovery scheme (and the highscore display) I've made:



Rules
Wounding/Death Scheme
Upon getting knocked out in battle one of four things will happen

Complete recovery (45% chance, [56 to 100])
Wound (-1 strength, 15% chance, [41 to 55])
Serious Wound (-1 strength, -1 agility, 15% chance, [26 to 40])
Death (25% chance, [1 to 25])

The result is modified by your skill levels in Ironflesh, First Aid, Wound Treatment, Surgery. Every point in those skills moves you up 1% on the scale of outcomes.
Charisma scores, represting luck, do the same. Every point in Charisma above 10 moves you up 1%. If you Charisma is below 10, you are considered to be unlucky and will move down on the scale by 1% for every point lacking to reach 10.

Furthermore, if you carry a life charm, you will move +7% on the scale. If you carry a Death Ward, you will move +25% on the scale, meaning you will not die for sure. However a Death Ward disappears once used.

Separate from this, there is a 2% chance of being instantly killed by the knockout blow. This cannot be removed by skills, but can be reduced to 1% by carrying a life charm.

Should you fall in battle, you will still be able to wander Calradia as a 'spirit' of a fallen warrior. This means you lose all gold and items, and get
-120,000 exp
-25 agility
+25 strength
It is going to be very hard to level up further, but you could continue as a 'walking dead', perhaps looking for revenge.

Important -- to remove the possiblity of death (always moving up at least 25 on the scale of outcomes, more with skill bonuses) overwrite the files from 'No-death Files' folder over the files in the main mod folder.

Code (add to combat missions in module_mission_templates, and change the native's trigger for (main_hero_fallen) to go off 12 seconds after you fall instead of 4, to give time for the scheme to go through):
Code:
############## death NEW7
## instant kill
      
      (0, 2, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@You have received a serious blow. The pain is unbearable."),
              (play_sound,"snd_player_breath"),  
            ]),

      (0, 4, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@Breathe in..."),
            ]),
      (0, 6, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@Breathe out..."),
            ]),      

      (0, 9, ti_once, [(main_hero_fallen)],
          [

            (store_random_in_range,"$kill",1,101),
            (store_random_in_range,"$instantkill",1,101),
            
#                          (display_message,"@ knockout {kill} "),
#                          (display_message,"@ instant kill {instantkill} "),         

             (try_begin),
             (player_has_item,"itm_charm_a"),
             (val_add,"$instantkill",1),
             (val_add,"$kill",7),
             (display_message,"@Your life charm glows softly "),
#                          (display_message,"@ knockout {kill} "),
#                          (display_message,"@ instant kill {instantkill} "),
           (else_try),
           (try_end),

           (try_begin),
             (player_has_item,"itm_charm_c"),
             (val_add,"$instantkill",30),
             (val_add,"$kill",25),            
              (display_message,"@Your death ward starts to smoke and disappears"),
#                          (display_message,"@ knockout {kill} "),
#                          (display_message,"@ instant kill {instantkill} "),            
            (troop_remove_item,"trp_player","itm_charm_c"),
           (else_try),
           (try_end),

           (try_begin),
             (lt,"$instantkill",3),

           (display_message,"@You are killed by the blow instantly."),
            
           (store_attribute_level,reg11,"trp_player",0),
           (store_attribute_level,reg12,"trp_player",1),
           (store_attribute_level,reg13,"trp_player",2),
           (store_attribute_level,reg14,"trp_player",3),
           (store_character_level,reg15,"trp_player"),
           (store_troop_gold,reg16,"trp_player"),
           (get_player_agent_kill_count,reg17,0),
           (store_current_day,reg18),

           
           (troop_clear_inventory,"trp_player"),
              (str_store_troop_name,s5,"trp_player"),
              (add_xp_to_troop,-100000,"trp_player"),
              (troop_raise_attribute,"trp_player",1,-25),
              (troop_raise_attribute,"trp_player",0,25),
             (troop_add_item,"trp_player","itm_ghost_helm_a"),
             (troop_remove_gold,"trp_player",reg16),
             (dialog_box,"str_s5_score_killed"),
             (val_add,reg5,80),
           (else_try),
           (try_end),


            (store_skill_level,":ironflesh","skl_ironflesh","trp_player"),
            (store_skill_level,":aid","skl_first_aid","trp_player"),
            (store_skill_level,":wound","skl_wound_treatment","trp_player"),
            (store_skill_level,":surg","skl_surgery","trp_player"),
            (store_attribute_level,":charisma","trp_player",3),            
             (val_sub,":charisma",10),
#            (val_sub,":charisma",10),
            (val_add,"$kill",":ironflesh"),
#              (display_message,"@ apply ironflesh  - {kill} "),            
            (val_add,"$kill",":aid"),
#              (display_message,"@ apply first aid - {kill} "),            
            (val_add,"$kill",":wound"),
#              (display_message,"@ apply wound treatment - {kill} "),            
            (val_add,"$kill",":surg"),            
#              (display_message,"@ apply surgery {kill} "),
            (val_add,"$kill",":charisma"),            
#              (display_message,"@ effects of luck {kill} "),

             (display_message,"@You make an effort to take another breath... "),

           (try_begin),
             (gt,"$kill",55),
#             (display_message,"@ You make an effort to take another breath... "),
#             (display_message,"@ You will recover from this blow completely."),           
             (dialog_box,"str_s5_exp"),
           (else_try),
             (gt,"$kill",40),
#             (display_message,"@ You make an effort to take another breath..."),           
#             (display_message,"@ You will recover from this blow, but will carry a battle scar."),
             (troop_raise_attribute,"trp_player",0,-1),     
             (dialog_box,"str_s5_exp_wound"),  
           (else_try),
             (gt,"$kill",25),
#             (display_message,"@ You make an effort to take another breath..."),           
#             (display_message,"@ You will recover, but will carry a serious wound."),
             (troop_raise_attribute,"trp_player",0,-1),
             (troop_raise_attribute,"trp_player",1,-1),      
             (dialog_box,"str_s5_exp_wound2"),              
           (else_try),
#             (display_message,"@ You make an effort to take another breath..."),           
#             (display_message,"@ You died."),

           (store_attribute_level,reg11,"trp_player",0),
           (store_attribute_level,reg12,"trp_player",1),
           (store_attribute_level,reg13,"trp_player",2),
           (store_attribute_level,reg14,"trp_player",3),
           (store_character_level,reg15,"trp_player"),
           (store_troop_gold,reg16,"trp_player"),
           (get_player_agent_kill_count,reg17,0),
           (store_current_day,reg18),

           
           (troop_clear_inventory,"trp_player"),
              (str_store_troop_name,s5,"trp_player"),
              (add_xp_to_troop,-120000,"trp_player"),
              (troop_raise_attribute,"trp_player",1,-25),
              (troop_raise_attribute,"trp_player",0,25),
             (troop_add_item,"trp_player","itm_ghost_helm_a"),
             (troop_remove_gold,"trp_player",reg16),
             (dialog_box,"str_s5_score"),
           (try_end),

            
            ]),


################ death end
 
I run with error when I try to compile Chel's abilities code:

Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Exporting faction data...
Exporting item data...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting scripts...
Exporting mission_template data...
Error: Unable to find object:snd_player_heartbeat
ERROR: Illegal Identifier:snd_player_heartbeat
Error: Unable to find object:itm_charm_b
ERROR: Illegal Identifier:itm_charm_b
Error: Unable to find object:snd_player_heartbeat
ERROR: Illegal Identifier:snd_player_heartbeat
Error: Unable to find object:itm_charm_b
ERROR: Illegal Identifier:itm_charm_b
Error: Unable to find object:snd_player_heartbeat
ERROR: Illegal Identifier:snd_player_heartbeat
Error: Unable to find object:itm_charm_b
ERROR: Illegal Identifier:itm_charm_b
Exporting game menus data...
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...

______________________________

Script processing has ended.
Press any key to exit. . .


As I see I must have a "special objects" for script working :smile:. What I did wrong?
 
Add that endurance charm object (to items file) if you like (just 'goods' with different mesh), make it expencive or some way to get them, it increases your ability duration by 10 seconds if you carry it with you.
OR
comment out the lines about them from the code and not use them.

Also you get error about 'heartbeat' sound, I added that when ability is activated. You can either keep it -- need to add another sound to module_sounds, you can take the sound from my mod, or find another fun sound to use (maybe yelling? )
or comment out the line about playing the sound.
 
I'm trying to get a script for area damage together.  If anyone has time to look at this, I'd appreciate feedback.

#First step - identify that a troop has been hit by projectile:
(try_for_agents,reg(1))
(agent_is_wounded,reg(1))

#assign position '1' to that wounded agent
(agent_get_position,1,reg(1))
  (try_end)

#Now find all other agents inside a 500cm sphere centred on the hit agent
(try_for_agents,reg(3))
(agent_is_alive,reg(3)),
(agent_get_position,2,reg(3))
(get_distance_between_positions,reg(4),1,2),
  (try_end)
  (le,reg(4),500),

#Now inflict 30 HP damage to all agents inisde this 500cm
  (store_agent_hit_points,<reg(5)>,reg(3),[1]),
  (val_sub,reg(5),30),
(agent_set_hit_points,reg(3),<reg(5)>,[1]),

## that's it.
main problem:
this applies to ANY wounded troop - not only that one hit by the projectile
 
I have a lot of scripts like that in MBX, just look for them...
You should use variables and pos registers instead of registers...
 
Death/Wound/Recovery upon knockout scheme:

Upon getting knocked out in battle one of four things will happen

Complete recovery (50% chance, [51 to 100])
Light Wound (15% chance, [36 to 50])
Severe Wound (15% chance, [21 to 35])
Death (20% chance, [1 to 20])

The result is modified by your skill levels in Ironflesh. Every point in that skill moves you up 1% on the scale of outcomes.
Charisma scores, represting luck, do the same. Every point in Charisma above 10 moves you up 1%. If your Charisma is below 10, you are considered to be unlucky and will move down on the scale by 1% for every point lacking to reach 10.

Furthermore, if you carry a life charm, you will move +7% on the scale. If you carry a Death Ward, you will move +25% on the scale, meaning you will not die for sure. However a Death Ward disappears once used.

So, for example, with 7 ironflesh, a life charm in the inventory, and 17 charisma you have will not die from a knockout blow. Almost:

Separate from this, there is a 2% chance of being instantly killed by the knockout blow. This cannot be removed by skills, but can be reduced to 1% by carrying a life charm.

Light wounds:
You suffer a deep cut on your arm. (-1 strength)
You suffer a nasty cut on your torso. (-1 strength, -1 agility)
You suffer a blow to the head. (-1 intelligence)
You suffer a severe blow to your leg. (-1 agility)

Severe wounds:
You suffer a broken arm. (-3 strength, -1 power strike, -1 power draw)
You suffer a broken rib. (-2 strength, -2 agility, -1 ironflesh)
You suffer a heavy blow to the head. (-2 intelligence, -1 leadership, -1 tactics)
You suffer a broken leg. (-3 agility, -1 athletics, -1 riding)

Wounds take one month to heal, one day sooner for each healing skill level, so that with 10 wound treatment, first aid and surgery they will heal in one day.

Suffering the same wound before the first one has healed will make effects of the first one permanent. For example, if you get broken arm, and one week later, before it heals, broken arm again -- when they heal you will recover the penalties of only one, the others will stay permanent.

Should you perish in battle, your level, attributes, kills and other information is displayed, you will lose 1000 exp, all your gold, all your inventory, gain +10 strength and a spirit mask helmet. You will still be able to wander Calradia as a 'spirit' of a fallen warrior but your spirit will grow weaker, losing 1 strength and agility day by day.


Source code:

Post into every combat mission (battle, village raid, castle siege) in mission_templates:
and change "(1, 12, ti_once, [(main_hero_fallen)]," to at least 10-12 seconds for those missions.
Code:
############## death NEW10
      
      (0, 2, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@You have received a serious blow. The pain is unbearable."),
              (play_sound,"snd_player_breath"),  
            ]),

      (0, 4, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@Breathe in..."),
            ]),
      (0, 6, ti_once, [(main_hero_fallen)],
          [
              (display_message,"@Breathe out..."),
            ]),      

      (0, 8, ti_once, [(main_hero_fallen)],
          [
            (display_message,"@ You make an effort to take another breath... "),

            (store_random_in_range,reg25,1,101),  ## chance
            (store_random_in_range,reg26,1,101),  ## wound type

            

             (try_begin),
             (player_has_item,"itm_charm_a"),
             (val_add,reg25,1),

             (display_message,"@Your life charm glows softly "),
           (else_try),
           (try_end),

           (try_begin),
             (player_has_item,"itm_charm_c"),
             (val_add,reg25,30),
            
              (display_message,"@Your death ward starts to smoke and disappears"),
            (troop_remove_item,"trp_player","itm_charm_c"),
           (try_end),

           (try_begin),
             (lt,reg25,3),  ## instant kill 2% chance
             (val_add,reg25,-100),
           (try_end),


           (try_begin),
             (player_has_item,"itm_charm_a"),
             (val_add,reg25,6),
           (try_end),
            


            (store_skill_level,"$ironflesh","skl_ironflesh","trp_player"),
            (store_skill_level,"$aid","skl_first_aid","trp_player"),
            (store_skill_level,"$wound","skl_wound_treatment","trp_player"),
            (store_skill_level,"$surg","skl_surgery","trp_player"),
            (store_attribute_level,"$charis","trp_player",3),            

##   bonuses to outcome of knockout
            (val_sub,"$charis",10),
            (val_add,reg25,"$ironflesh"),
            (val_add,reg25,"$charis"),            



### decide outcome
           (try_begin),
             (gt,reg25,50),  # complete recovery, scratches bruises, no wounds
             (display_message,"@ You will recover from this blow completely."),           
           (else_try),
             (gt,reg25,35), # 35-50 light wound
##################### wound type
##
         (try_begin),
             (gt,reg26,75),

            (display_message,"@ You suffer a deep cut on your arm. (-1 strength)"),           
            (assign, "$wound1", 1),

            (assign, "$healtime1", 31),
            (val_sub,"$healtime1","$aid"),
            (val_sub,"$healtime1","$wound"),
            (val_sub,"$healtime1","$surg"),
            (store_current_day,"$currentday1"),
            (store_add,"$healday1","$currentday1","$healtime1"),

            (troop_raise_attribute,"trp_player",0,-1),

            
         (else_try),
             (gt,reg26,50), #
            (display_message,"@ You suffer a nasty cut on your torso. (-1 strength, -1 agility)"),           
            (assign, "$wound2", 1),

            (assign, "$healtime2", 31),
            (val_sub,"$healtime2","$aid"),
            (val_sub,"$healtime2","$wound"),
            (val_sub,"$healtime2","$surg"),
            (store_current_day,"$currentday2"),
            (store_add,"$healday2","$currentday2","$healtime2"),

            (troop_raise_attribute,"trp_player",1,-1),
            (troop_raise_attribute,"trp_player",0,-1),

         (else_try),
             (gt,reg26,25), ## 

            (display_message,"@ You suffer a blow to the head. (-1 intelligence)"),           
            (assign, "$wound3", 1),

            (assign, "$healtime3", 31),
            (val_sub,"$healtime3","$aid"),
            (val_sub,"$healtime3","$wound"),
            (val_sub,"$healtime3","$surg"),
            (store_current_day,"$currentday3"),
            (store_add,"$healday3","$currentday3","$healtime3"),

            (troop_raise_attribute,"trp_player",2,-1),
            
        (else_try),  ## 

            (display_message,"@ You suffer a severe blow to your leg. (-1 agility)"),           
            (assign, "$wound4", 1),

            (assign, "$healtime4", 31),
            (val_sub,"$healtime4","$aid"),
            (val_sub,"$healtime4","$wound"),
            (val_sub,"$healtime4","$surg"),
            (store_current_day,"$currentday4"),
            (store_add,"$healday4","$currentday4","$healtime4"),

            (troop_raise_attribute,"trp_player",1,-1),            

        (try_end),
##            
#######################

           (else_try),
             (gt,reg25,20), ## 21-35 serious wound

         (try_begin),
             (gt,reg26,75),

            (display_message,"@ You suffer a broken arm. (-3 strength, -1 power strike, -1 power draw)"),           
            (assign, "$wound5", 1),

            (assign, "$healtime5", 31),
            (val_sub,"$healtime5","$aid"),
            (val_sub,"$healtime5","$wound"),
            (val_sub,"$healtime5","$surg"),
            (store_current_day,"$currentday5"),
            (store_add,"$healday5","$currentday5","$healtime5"),

            (troop_raise_attribute,"trp_player",0,-3),
            (troop_raise_skill, "trp_player","skl_power_strike",-1),
            (troop_raise_skill, "trp_player","skl_power_draw",-1),            

            
         (else_try),
             (gt,reg26,50), #
            (display_message,"@ You suffer a broken rib. (-2 strength, -2 agility, -1 ironflesh)"),           
            (assign, "$wound6", 1),

            (assign, "$healtime6", 31),
            (val_sub,"$healtime6","$aid"),
            (val_sub,"$healtime6","$wound"),
            (val_sub,"$healtime6","$surg"),
            (store_current_day,"$currentday6"),
            (store_add,"$healday6","$currentday6","$healtime6"),

            (troop_raise_attribute,"trp_player",1,-2),
            (troop_raise_attribute,"trp_player",0,-2),
            (troop_raise_skill, "trp_player","skl_ironflesh",-1),            

         (else_try),
             (gt,reg26,25), ## 

            (display_message,"@ You suffer a heavy blow to the head. (-2 intelligence, -1 leadership, -1 tactics)"),           
            (assign, "$wound7", 1),

            (assign, "$healtime7", 31),
            (val_sub,"$healtime7","$aid"),
            (val_sub,"$healtime7","$wound"),
            (val_sub,"$healtime7","$surg"),
            (store_current_day,"$currentday7"),
            (store_add,"$healday7","$currentday7","$healtime7"),

            (troop_raise_attribute,"trp_player",2,-2),
            (troop_raise_skill, "trp_player","skl_leadership",-1),
            (troop_raise_skill, "trp_player","skl_tactics",-1),            
            
            
        (else_try),  ## 

            (display_message,"@ You suffer a broken leg. (-3 agility, -1 athletics, -1 riding)"),           
            (assign, "$wound8", 1),

            (assign, "$healtime8", 31),
            (val_sub,"$healtime8","$aid"),
            (val_sub,"$healtime8","$wound"),
            (val_sub,"$healtime8","$surg"),
            (store_current_day,"$currentday8"),
            (store_add,"$healday8","$currentday8","$healtime8"),

            (troop_raise_attribute,"trp_player",1,-3),
            (troop_raise_skill, "trp_player","skl_riding",-1),
            (troop_raise_skill, "trp_player","skl_athletics",-1),            

        (try_end),

           (else_try),  ## 0-20 death
           (store_attribute_level,reg11,"trp_player",0),
           (store_attribute_level,reg12,"trp_player",1),
           (store_attribute_level,reg13,"trp_player",2),
           (store_attribute_level,reg14,"trp_player",3),
           (store_character_level,reg15,"trp_player"),
           (store_troop_gold,reg16,"trp_player"),
           (get_player_agent_kill_count,reg17,0),
           (store_current_day,reg18),

           
           (troop_clear_inventory,"trp_player"),
              (str_store_troop_name,s5,"trp_player"),
              (add_xp_to_troop,-1000,"trp_player"),
              (assign, "$playerdead", 1),
             (troop_add_item,"trp_player","itm_ghost_helm_a"),
             (troop_remove_gold,"trp_player",reg16),
            (troop_raise_attribute,"trp_player",0,10),            
             (dialog_box,"str_s5_score"),
           (try_end),

            
            ]),


################ death end

Post into game_menus for start of game (gender selection in this case):
Code:
  (
    "start_game_1",0,
    "Welcome, adventurer, to Mount&Blade. Before you start the game, you must create a character. To begin, select your character's gender.",
    "none",
    [],
    [
      ("start_male",[],"Male",
       [
           (troop_set_type,"trp_player",0),
           (assign,"$character_gender",0),
           (assign, "$wound1", 0),
           (assign, "$wound2", 0),
           (assign, "$wound3", 0),
           (assign, "$wound4", 0),
           (assign, "$wound5", 0),
           (assign, "$wound6", 0),
           (assign, "$wound7", 0),
           (assign, "$wound8", 0),


           (assign, "$healday1", 0),
           (assign, "$healday2", 0),
           (assign, "$healday3", 0),
           (assign, "$healday4", 0),
           (assign, "$healday5", 0),
           (assign, "$healday6", 0),
           (assign, "$healday7", 0),
           (assign, "$healday8", 0),

           (assign, "$playerdead", 0),
           (jump_to_menu,"mnu_start_game_2")



        ]
       ),
      ("start_female",[],"Female",
       [
           (troop_set_type,"trp_player",1),
           (assign,"$character_gender",1),
           (assign, "$wound1", 0),
           (assign, "$wound2", 0),
           (assign, "$wound3", 0),
           (assign, "$wound4", 0),
           (assign, "$wound5", 0),
           (assign, "$wound6", 0),
           (assign, "$wound7", 0),
           (assign, "$wound8", 0),


           (assign, "$healday1", 0),
           (assign, "$healday2", 0),
           (assign, "$healday3", 0),
           (assign, "$healday4", 0),
           (assign, "$healday5", 0),
           (assign, "$healday6", 0),
           (assign, "$healday7", 0),
           (assign, "$healday8", 0),
           
           (assign, "$playerdead", 0),
           (jump_to_menu,"mnu_start_game_2")


           
        ]
       ),

Post into triggers
Code:
#### wounds death
    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday1"),(eq,"$wound1",1)], [
                                  (display_message,"@ Your cut arm finally heals."),
            (troop_raise_attribute,"trp_player",0,1),
                                  (assign, "$wound1", 0),
                     ]),                                  


    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday2"),(eq,"$wound2",1)], [
                                  (display_message,"@ The cut on your torso finally heals."),
            (troop_raise_attribute,"trp_player",1,1),
            (troop_raise_attribute,"trp_player",0,1),
                                  (assign, "$wound2", 0),
                     ]),

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday3"),(eq,"$wound3",1)], [
                                  (display_message,"@ Your thoughts clear."),
            (troop_raise_attribute,"trp_player",2,1),
                                  (assign, "$wound3", 0),
                     ]),  

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday4"),(eq,"$wound4",1)], [
                                  (display_message,"@ Your leg finally heals."),
            (troop_raise_attribute,"trp_player",1,1),  
                                  (assign, "$wound4", 0),
                     ]),  

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday5"),(eq,"$wound5",1)], [
                                  (display_message,"@ Your broken arm finally heals."),
            (troop_raise_attribute,"trp_player",0,3),
            (troop_raise_skill, "trp_player","skl_power_strike",1),
             (troop_raise_skill, "trp_player","skl_power_draw",1),   
                                  (assign, "$wound5", 0),
                     ]),  

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday6"),(eq,"$wound6",1)], [
                                  (display_message,"@ Your broken rib finally heals."),
            (troop_raise_attribute,"trp_player",1,2),
            (troop_raise_attribute,"trp_player",0,2),
            (troop_raise_skill, "trp_player","skl_ironflesh",1),
                                  (assign, "$wound6", 0),
                     ]),  

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday7"),(eq,"$wound7",1)], [
                                  (display_message,"@ Your headache is finally gone."),
            (troop_raise_attribute,"trp_player",2,2),
            (troop_raise_skill, "trp_player","skl_leadership",1),
            (troop_raise_skill, "trp_player","skl_tactics",1), 
                                  (assign, "$wound7", 0),
                     ]),

    (0.0, 0, 24.0, [(store_current_day,"$currentday"),(eq,"$currentday","$healday8"),(eq,"$wound8",1)], [
                                  (display_message,"@ Your broken leg finally heals."),
            (troop_raise_attribute,"trp_player",1, 3),
            (troop_raise_skill, "trp_player","skl_riding",1),
            (troop_raise_skill, "trp_player","skl_athletics",1),  
                                  (assign, "$wound8", 0),
                     ]),    



      (0.0, 0, 24.0, [(eq,"$playerdead",1)], [
                                  (display_message,"@ Your spirit grows weaker."),
            (troop_raise_attribute,"trp_player",1,-1),
            (troop_raise_attribute,"trp_player",0,-1),
                                 
                     ]), 

Post into strings
Code:
    ("s5_score", "{s5} has perished in battle at level {reg15}, having defeated {reg17} enemies in {reg18} days. {s5} had {reg16} Gold, {reg11} Strength, {reg12} Agility, {reg13} Intelligence, {reg14} Charisma. Some say those fallen in battle still wander Calradia for some time."),  
    ("s5_score_killed", "{s5} has been killed in battle at level {reg15}, having defeated {reg17} enemies in {reg18} days. {s5} had {reg16} Gold, {reg11} Strength, {reg12} Agility, {reg13} Intelligence, {reg14} Charisma. Some say those fallen in battle still wander Calradia for some time."), 

Post into sounds (and get breath sound, or comment out that part of the code in mission templates):
Code:
  ("player_breath",sf_priority_1|sf_vol_5, ["breath.wav"]),

Post into items (or not use charms and comment out that part of the code in mission templates):
Code:
 ["charm_a","Life Charm", [("candle_a.24",0)], itp_type_goods|itp_merchandise, 0, 2000,weight(2)|abundance(2),imodbits_none],
 ["charm_c","Death Ward", [("skeleton_head.24",0)], itp_type_goods|itp_merchandise, 0, 2000,weight(4)|abundance(2),imodbits_none],
 ["ghost_helm_a", "Spirit Mask", [("reinf_helmet",0)],  itp_type_head_armor|itp_covers_head,0, 3760 , weight(50)|abundance(10)|head_armor(79)|body_armor(0)|leg_armor(0)|difficulty(25) ,imodbits_plate ],
 
is it possible to detect a collision between a mesh generated by particle_systems, and an agent?
is it possible to assign a collision mesh / body to a particle system?
 
Back
Top Bottom