Troop wages

Users who are viewing this thread

amade

Grandmaster Knight
Hi all,

I need a bit of help from those who understand code since I couldn't find anything specific to this after a quick search. This is taken from the original module system:

Code:
("game_get_troop_wage",
    [
      (store_script_param_1, ":troop_id"),
      (store_script_param_2, ":unused"), #party id
      
      (assign,":wage", 0),
      (try_begin),
        (this_or_next|eq, ":troop_id", "trp_player"),
        (eq, ":troop_id", "trp_kidnapped_girl"),
      (else_try),
        (is_between, ":troop_id", pretenders_begin, pretenders_end),
      (else_try),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":wage", ":troop_level"),
        (val_add, ":wage", 3),
        (val_mul, ":wage", ":wage"),
        (val_div, ":wage", 25),
      (try_end),

I pretty much understand everything after that bit of code in module_scripts.py covers mounted troops, mercs and whatnot so I assume that this particular bit governs the regular troops... How do the numbers (val_add, ":wage", 3), and (val_div, ":wage", 25), equate with troop level?

Thanks in advance.
 
val_add, val_div and other val_* functions put result of operation in their first argument.
That is (val_add, ":wage", 3),  put into wage  value wage+3

The whole code
Code:
(assign, ":wage", ":troop_level"),    #wage<- troop_level
(val_add, ":wage", 3), #wage <- wage + 3= troop_level + 3 
(val_mul, ":wage", ":wage"),  #wage <-  wage * wage =  (troop_level + 3)  * (troop_level + 3)
(val_div, ":wage", 25), #wage <-  wage / 25 =  (troop_level + 3)  * (troop_level + 3) / 25
produces wage =  (troop_level + 3)  * (troop_level + 3) / 25


Have I answered the question?
 
Back
Top Bottom