How to create a skill.

Users who are viewing this thread

Hello, I have been looking for a tutorial that explains it but I wasn't able to find it.

So, I have troubles with the creation of a new skill, like entertaiment in Brytenwalda. Which files must I modify and how must I do it?

Thank you very much for your help, sirs. :grin:
 
I think there is a OSP entertainment skill. Since I am not at home and on iphone I cant send you a link. And on your question how to create a skill it depends what kind of skill do you want.
 
You can use the reserved skill slots in module_skills.py for to create the new skill you want, then you do your stuff about it depends on what you want with checks here and there. Say, you want it to have an effect in battle...you get into mission_templates;

Code:
skill_test = (
  0, 0, 15, [(key_clicked, key_n),],
  [
  (get_player_agent_no, ":agent"),
  (store_skill_level, ":skl_level", "skl_rage", "trp_player"),
     (try_begin),
      (gt, ":skl_level", 0),
       (store_random_in_range, ":random_buff", 5, 10),
       (agent_set_damage_modifier, ":agent", ":random_buff"),
      (display_message, "@You are outraged.."),
    (else_try),
     (display_message, "@You haven't unlocked this skill yet."),
   (try_end),
    ])

An easy script for SP to have a damage buff on you. Or, if you want it to have an effect on your party, you go to module_triggers.py;

Code:
  # Refresh Merchants
  (0.0, 0, 24.0, [],
  [    (party_get_skill_level, ":skl_level", "p_main_party", "skl_trainer"),
    (try_begin), 
     (ge, ":skl_level", 0),
     
      (party_add_xp, "p_main_party", 1000),
    (try_end),

   
  ]),
 
Thanks for the answers, but I was trying to create an hability that reduces the money you lost when you have lots of towns and castles. Where do you think that should I go to create it?

Thanks. :smile:
 
That is modelled by tax inefficiency in module_presentations.
Code:
      (try_begin),
        (gt, ":num_owned_center_values_for_tax_efficiency", ":num_centers_needed_for_efficiency_loss"),
        (gt, ":all_centers_accumulated_total", 0),
        (store_sub, ":ratio_lost", ":num_owned_center_values_for_tax_efficiency", ":num_centers_needed_for_efficiency_loss"),
        (val_mul, ":ratio_lost", ":tax_efficiency_loss_ratio_per_center"),
        (val_min, ":ratio_lost", 65),
                
        #(store_mul, ":tax_lost", ":all_centers_accumulated_total", ":ratio_lost"),
        (store_mul, ":tax_lost", ":all_centers_accumulated_taxes_and_rents", ":ratio_lost"),
        (val_div, ":tax_lost", 100),
        (val_sub, ":net_change", ":tax_lost"),
        (create_text_overlay, reg1, "str_loss_due_to_tax_inefficiency", 0),
        (position_set_x, pos1, 25),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg1, pos1),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 900),
        (overlay_set_size, reg1, pos1),
        (store_mul, reg0, ":tax_lost", -1),
        (create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
        (position_set_x, pos1, 900),
        (position_set_y, pos1, 900),
        (overlay_set_size, reg1, pos1),
        (overlay_set_color, reg1, 0xFF0000),
        (position_set_x, pos1, 500),
        (position_set_y, pos1, ":cur_y"),
        (overlay_set_position, reg1, pos1),
        (val_sub, ":cur_y", 27),
      (try_end),
The easiest way to do this would be to have new a skill modify the condition ":num_centers_needed_for_efficiency_loss", which is assigned somewhere at the top. What I have done is take the skill of your minister into account instead of the player (since you're not technically running around collecting the taxes yourself).
Code:
      (game_get_reduce_campaign_ai, ":reduce_campaign_ai"),      
      (try_begin),
        (eq, ":reduce_campaign_ai", 0), #hard
        (assign, ":num_centers_needed_for_efficiency_loss", 2),
        (assign, ":tax_efficiency_loss_ratio_per_center", 5),
      (else_try),  
        (eq, ":reduce_campaign_ai", 1), #medium
        (assign, ":num_centers_needed_for_efficiency_loss", 4),
        (assign, ":tax_efficiency_loss_ratio_per_center", 4),
      (else_try),  
        (eq, ":reduce_campaign_ai", 2), #easy
        (assign, ":num_centers_needed_for_efficiency_loss", 6),
        (assign, ":tax_efficiency_loss_ratio_per_center", 3),
      (try_end),
Do a (store_skill_level), somewhere with your new skill, and add it directly to ":num_centers_needed_for_efficiency_loss" so that each skill point increases the amount of holdings before you have before the penalty takes place by 1. Alternatively, to reduce the actual ratio of losses modify the top block instead.
 
Back
Top Bottom