SP Tutorial Module System Editing Prisoner Price

Users who are viewing this thread

There have been a few people (especially in the with Fire and Sword section) who have asked how to adjust prisoner prices. So I decided to write this quick and easy tutorial just so it is out there.

Warband:

Module System:

1. Open "module_scripts.py"

2. Find (Ctrl + F) "game_get_prisoner_price"

You should find a block of code that looks like this:

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
           
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_add, ":ransom_amount", 10),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 6),
      (else_try), 
        (assign, ":ransom_amount", 50),
      (try_end),
     
      (assign, reg0, ":ransom_amount"),
     
      (set_trigger_result, reg0),
  ]),

3.  Look for (val_add, ":ransom_amount", 10), and (val_div, ":ransom_amount", 6),

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
           
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_add, ":ransom_amount", 10),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 6),
      (else_try), 
        (assign, ":ransom_amount", 50),
      (try_end),
     
      (assign, reg0, ":ransom_amount"),
     
      (set_trigger_result, reg0),
  ]),

4. The (val_add, ":ransom_amount", 10), is the amount for each tier. For example, a looter will be worth less then a Knight. Every +1 increases it by 5 denars.
The (val_div, ":ransom_amount", 6), is the divided amount. So increasing it will decrease the overall price. Change the numbers to what you want the cost to be.

5. So if you wanted to increase the amount of money you receive for selling prisoners,  you would increase the (val_add, ":ransom_amount", 10), to let's say
(val_add, ":ransom_amount", 12), then you would decrease the (val_div, ":ransom_amount", 6), to let's say (val_div, ":ransom_amount", 5),. It would look like this:

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
           
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_add, ":ransom_amount", 12),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 5),
      (else_try), 
        (assign, ":ransom_amount", 50),
      (try_end),
     
      (assign, reg0, ":ransom_amount"),
     
      (set_trigger_result, reg0),
  ]),

Text Files:

1. Open up the "Native" folder and then open "scripts.txt"

2. Find (Ctrl + F) "game_get_prisoner_price"

You should see this:

game_get_prisoner_price -1
13 21 1 1224979098644774912 4 0 33 3 144115188075855987 360287970189639846 360287970189639856 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2105 2 1224979098644774914 10 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 6 5 0 2133 2 1224979098644774914 50 3 0 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936

3. In that line of text look for a 10 and a 6.

game_get_prisoner_price -1
13 21 1 1224979098644774912 4 0 33 3 144115188075855987 360287970189639846 360287970189639856 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2105 2 1224979098644774914 10 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 6 5 0 2133 2 1224979098644774914 50 3 0 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936

4. The 10 is the amount for each tier. For example, a looter will be worth less then a Knight. Every +1 increases it by 5 denars. The 6 is the divided amount. So increasing it will decreases the overall price.

5. So if you wanted to increase the amount of money you receive for selling prisoners,  you would increase the 10 to let's say 12 then you would decrease the 6 to let's say 5. It would look like this:

game_get_prisoner_price -1
13 21 1 1224979098644774912 4 0 33 3 144115188075855987 360287970189639846 360287970189639856 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2105 2 1224979098644774914 12 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 5 5 0 2133 2 1224979098644774914 50 3 0 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936

With Fire and Sword:

Module System:

1. Open "module_scripts.py"

2. Find (Ctrl + F) "game_get_prisoner_price"

You should find a block of code that looks like this:

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
      (assign, reg0, 50),
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 5),
(val_add, ":ransom_amount", ":troop_level"),
      (try_end),
  #(val_min, ":ransom_amount", 12),
  #(val_max, ":ransom_amount", 200),
  (val_clamp, ":ransom_amount", 12, 200),
      (assign, reg0, ":ransom_amount"),
      (set_trigger_result, reg0),
  ]),

3. Look for (val_div, ":ransom_amount", 5), and (val_clamp, ":ransom_amount", 12, 200),

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
      (assign, reg0, 50),
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 5),
(val_add, ":ransom_amount", ":troop_level"),
      (try_end),
  #(val_min, ":ransom_amount", 12),
  #(val_max, ":ransom_amount", 200),
  (val_clamp, ":ransom_amount", 12, 200),
      (assign, reg0, ":ransom_amount"),
      (set_trigger_result, reg0),
  ]),

4. The (val_div, ":ransom_amount", 5), is the divided amount. So increasing it will decreases the overall price. The (val_clamp, ":ransom_amount", 12, 200), is the minimum
(on the left) and maximum amount (on the right). Change the numbers to what you want the cost to be.

5. So if you wanted to increase the cost you would decrease (val_div, ":ransom_amount", 5), to let's say 4. Then change the maximum amount to 600.
(val_clamp, ":ransom_amount", 12, 600),

  # script_game_get_prisoner_price
  # This script is called from the game engine for calculating prisoner price
  # Input:
  # param1: troop_id,
  # Output: reg0 
 
  ("game_get_prisoner_price",
    [
      (store_script_param_1, ":troop_id"),
      (assign, reg0, 50),
      (try_begin),
        (is_between, "$g_talk_troop", ransom_brokers_begin, ransom_brokers_end),
        (store_character_level, ":troop_level", ":troop_id"),
        (assign, ":ransom_amount", ":troop_level"),
        (val_mul, ":ransom_amount", ":ransom_amount"),
        (val_div, ":ransom_amount", 4),
(val_add, ":ransom_amount", ":troop_level"),
      (try_end),
  #(val_min, ":ransom_amount", 12),
  #(val_max, ":ransom_amount", 200),
  (val_clamp, ":ransom_amount", 12, 600),
      (assign, reg0, ":ransom_amount"),
      (set_trigger_result, reg0),
  ]),

Text Files:

1. Open up the "Ogniem i Mieczem" folder and then open "scripts.txt"

2. Find (Ctrl + F) "game_get_prisoner_price"

You should see this:

game_get_prisoner_price -1
13 21 1 1224979098644774912 2133 2 72057594037927936 50 4 0 33 3 144115188075855902 360287970189639941 360287970189639951 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 3 2105 2 1224979098644774914 1224979098644774913 5 0 2112 3 1224979098644774914 12 200 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936

3. In that line of text look for a 5 and a 12 200

game_get_prisoner_price -1
13 21 1 1224979098644774912 2133 2 72057594037927936 50 4 0 33 3 144115188075855902 360287970189639941 360287970189639951 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 3 2105 2 1224979098644774914 1224979098644774913 5 0 2112 3 1224979098644774914 12 200 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936

4. The 5 is the price modifier. Increasing it decreases the price, decreasing it increases the price. The 12 is the minimum price. 200 is the maximum.

5. So if you wanted to increase the amount of money you receive for selling prisoners, you would decrease the 5 to let's say 3. And increasing the maximum price to 600.

game_get_prisoner_price -1
13 21 1 1224979098644774912 2133 2 72057594037927936 50 4 0 33 3 144115188075855902 360287970189639941 360287970189639951 2171 2 1224979098644774913 1224979098644774912 2133 2 1224979098644774914 1224979098644774913 2107 2 1224979098644774914 1224979098644774914 2108 2 1224979098644774914 3 2105 2 1224979098644774914 1224979098644774913 3 0 2112 3 1224979098644774914 12 600 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936
 
Back
Top Bottom