JuJu70 said:{reg3} is the amount you get from plundering. It's calculated by the script
we know that, we just need the modules. Coming with 1.04, right?
JuJu70 said:{reg3} is the amount you get from plundering. It's calculated by the script
Doubt itkalarhan said:JuJu70 said:{reg3} is the amount you get from plundering. It's calculated by the script
we know that, we just need the modules. Coming with 1.04, right?
JuJu70 said:Doubt itkalarhan said:JuJu70 said:{reg3} is the amount you get from plundering. It's calculated by the script
we know that, we just need the modules. Coming with 1.04, right?
If you're using notepad++ or whatever it should be line 63.12.000000 44 31 2 144115188075855908 0 2156 2 72057594037927961 648518346341351424 2133 2 1224979098644774912 72057594037927961 2108 2 1224979098644774912 3 4 0 31 2
CrvenBear said:-Renown deterioration over time (frequency of deterioration and percent of renown that goes away)
kraggrim said:CrvenBear said:-Renown deterioration over time (frequency of deterioration and percent of renown that goes away)
I don't know what this is. Does renown deteriorate by itself? I've never noticed this.
The 168.00 in the beginning is the timer for the drain frequency. The higher the number, the more time it takes for the renown drain tick to occur.168.000000 4 520 3 1224979098644774912 360287970189639680 7 2123 3 1224979098644774913 1224979098644774912 200
CrvenBear said:It should be, yeah.
Also add this to the main post, here's the tweak for modifying renown drain, all credits to TheMageLord:
.....
# Reduce renown slightly by 0.5% every week
(7 * 24,
[
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(store_div, ":renown_decrease", ":player_renown", 200),
(val_sub, ":player_renown", ":renown_decrease"),
(troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
]),
168 4 520 3 ":player_renown" "trp_player" 7 2123 3 ":renown_decrease" ":player_renown" 200 2106 2 ":player_renown" ":renown_decrease" 500 3 "trp_player" 7 ":player_renown"
168.000000 4 520 3 1224979098644774912 360287970189639680 7 2123 3 1224979098644774913 1224979098644774912 200 2106 2 1224979098644774912 1224979098644774913 500 3 360287970189639680 7 1224979098644774912
168.000000 4 520 3 1224979098644774912 360287970189639680 7 2123 3 1224979098644774913 1224979098644774912 200 2106 2 1224979098644774912 1224979098644774913 500 3 360287970189639680 7 1224979098644774912
# Reduce renown slightly by 0.5% every week
(7 * 24,
[
(troop_get_slot, ":player_renown", "trp_player", slot_troop_renown),
(store_div, ":renown_decrease", ":player_renown", 200),
(val_sub, ":player_renown", ":renown_decrease"),
(troop_set_slot, "trp_player", slot_troop_renown, ":player_renown"),
]),
CrvenBear said:-Effect of Leadership skill on troop wages (every level of Leadership decreases wages by 5%, how would I change that?)
(store_skill_level, ":leadership_level", "skl_leadership", "trp_player"),
(store_mul, ":leadership_bonus", 5, ":leadership_level"),
(store_sub, ":leadership_factor", 100, ":leadership_bonus"),
(val_mul, ":wage", ":leadership_factor"), #wage = wage * (100 - 5*leadership)/100
(val_div, ":wage", 100),
game_get_troop_wage -1
54 21 1 1224979098644774912 22 1 1224979098644774913 2133 2 1224979098644774914 0 2170 3 1224979098644774915 1369094286720630785 360287970189639680 4 0 1073741855 2 1224979098644774912 360287970189639680 31 2 1224979098644774912 360287970189639867 5 0 33 3 1224979098644774912 360287970189640144 360287970189640150 5 0 2171 2 1224979098644774916 1224979098644774912 2133 2 1224979098644774914 1224979098644774916 4 0 2147483680 2 1224979098644774916 23 2105 2 1224979098644774914 1 2106 2 1224979098644774914 1224979098644774915 5 0 31 2 1224979098644774916 26 2105 2 1224979098644774914 10 2106 2 1224979098644774914 1224979098644774915 5 0 2105 2 1224979098644774914 21 2106 2 1224979098644774914 1224979098644774915 3 0 2111 2 1224979098644774914 1 3 0 4 0 2147483681 3 1224979098644774912 360287970189639975 360287970189639991 152 1 1224979098644774912 2107 2 1224979098644774914 5 2108 2 1224979098644774914 4 3 0 4 0 33 3 1224979098644774912 360287970189639710 360287970189639719 2107 2 1224979098644774914 5 2108 2 1224979098644774914 4 3 0 4 0 33 3 1224979098644774912 360287970189639975 360287970189639991 2107 2 1224979098644774914 4 3 0 4 0 33 3 1224979098644774912 360287970189639828 360287970189639840 2107 2 1224979098644774914 5 2108 2 1224979098644774914 4 3 0 4 0 2147483679 2 1224979098644774912 360287970189639680 2147483679 2 1224979098644774912 360287970189639867 2147483681 3 1224979098644774912 360287970189640144 360287970189640150 2111 2 1224979098644774914 1 3 0 2133 2 72057594037927936 1224979098644774914 2075 1 72057594037927936
("game_get_troop_wage",
[
(store_script_param_1, ":troop_id"),
(store_script_param_2, ":unused"),
(assign,":wage", 0),
(store_skill_level, ":leadership_level", "skl_leadership", ":trp_player"),
(try_begin),
(this_or_next|eq ,":troop_id", "trp_player"),
(eq, ":troop_id", "trp_kidnapped_girl"),
(else_try_begin),
(is_between, ":troop_id", pretender_begin, pretender_end),
(else_try),
(store_character_level, ":troop_level", ":troop_id"),
(assign, ":wage", ":troop_level"),
(try_begin),
(le ,":troop_level", 23),
(val_add, ":wage", 1),
(val_sub, ":wage", ":leadership_level"),
(else_try),
(eq, ":troop_level", 26),
(val_add, ":wage", 10),
(val_sub, ":wage", ":leadership_level"),
(else_try),
(val_add, ":wage", 21),
(val_sub, ":wage", ":leadership_level"),
(try_end),
(val_max, ":wage", 1),
(try_end),
(try_begin),
(2147483681, ":troop_id", 360287970189639975, 360287970189639991),
(troop_is_mounted,":troop_id"),
(val_mul, ":wage", 5),
(val_div, ":wage, 4),
(try_end),
(try_begin),
(is_between,":troop_id",360287970189639710,360287970189639710),
(val_mul, ":wage", 5),
(val_div, ":wage, 4),
(try_end),
(try_begin),
(is_between,":troop_id",360287970189639975, 360287970189639991),
(val_mul, ":wage", 4),
(try_end),
(try_begin),
(is_between,":troop_id",360287970189639828, 360287970189639840),
(val_mul, ":wage", 5),
(val_div, ":wage, 4),
(try_end),
(try_begin),
(2147483679, ":troop_id", "trp_player"),
(2147483679, ":troop_id", "trp_kidnapped_girl"),
(2147483681, ":troop_id", pretender_begin, pretender_end),
(val_max, ":wage", 1),
(try_end),
(assign, 72057594037927936,":wage"), #regX like reg0
(set_trigger_result, 72057594037927936),
]),
(val_add, ":leadership_level", 5),
54 21 1 1224979098644774912 22 1 1224979098644774913 2133 2 1224979098644774914 0 2170 3 1224979098644774915 1369094286720630785 360287970189639680 4 0
55 21 1 1224979098644774912 22 1 1224979098644774913 2133 2 1224979098644774914 0 2170 3 1224979098644774915 1369094286720630785 360287970189639680 2105 2 1224979098644774915 5 4 0
61 21 1 1224979098644774912 22 1 1224979098644774913 2133 2 1224979098644774914 0 2170 3 1224979098644774915 1369094286720630785 360287970189639680 4 0
62 21 1 1224979098644774912 22 1 1224979098644774913 2133 2 1224979098644774914 0 2170 3 1224979098644774915 1369094286720630785 360287970189639680 2105 2 1224979098644774915 5 4 0
Transforming that snippet to compiled code:
2170 2 ":leadership_level" "skl_leadership" 3 "trp_player"
2122 2 ":leadership_bonus" 5 3 ":leadership_level"
2121 2 ":leadership_factor" 100 2 ":leadership_bonus"
2107 2 ":wage" 2 ":leadership_factor"
2108 2 ":wage" 100
kraggrim said:Thanks kalarhan, very good work.
Is there a guide or something for interpreting this kind of stuff, or did you just extrapolate?
assign = 2133 # (assign, <destination>, <value>),
# Directly assigns a value to a variable or register.
val_add = 2105 # (val_add, <destination>, <value>),
# Assigns <destination> := <destination> + <value>
val_sub = 2106 # (val_sub, <destination>, <value>),
# Assigns <destination> := <destination> - <value>
val_mul = 2107 # (val_mul, <destination>, <value>),
# Assigns <destination> := <destination> * <value>
val_div = 2108 # (val_div, <destination>, <value>),
# Assigns <destination> := <destination> / <value>
call_script = 1 # (call_script, <script_id>, [<script_param>...]),
# Calls specified script with or without parameters.
try_begin = 4 # (try_begin),
# Opens a conditional block.
else_try = 5 # (else_try),
# If conditional operations in the conditional block fail, this block of code will be executed.
try_end = 3 # (try_end),
# Concludes a conditional block or a cycle.
tag_register = 1
tag_variable = 2
tag_string = 3
tag_item = 4
tag_troop = 5
tag_faction = 6
tag_quest = 7
tag_party_tpl = 8
tag_party = 9
....
360287970189639683 2041 1 360287970189639683 5 0 2136 3 1224979098644774917 100 500
(2136 3 12249790986447[0-9]{5} )(100)( )(12249790986447[0-9]{5})
XXX to YYY is the value for looting\1XXX\3YYY
gdwitt said:I know how to compile the moduleysystem then compare its output with current game code.
I just wish I had a better understanding of the logic of the system and what stands for what in the compiled number lists.
kalarhan said:kraggrim said:Thanks kalarhan, very good work.
Is there a guide or something for interpreting this kind of stuff, or did you just extrapolate?
Hum that comes from modding. All you need to do is read the process_XXXX.py files to learn how they *compile* the source, then you open native modules for the codes and you work from there. The wage script took me 10minutes.
header_operations.py has the engine codes. Examples:
Code:assign = 2133 # (assign, <destination>, <value>), # Directly assigns a value to a variable or register. val_add = 2105 # (val_add, <destination>, <value>), # Assigns <destination> := <destination> + <value> val_sub = 2106 # (val_sub, <destination>, <value>), # Assigns <destination> := <destination> - <value> val_mul = 2107 # (val_mul, <destination>, <value>), # Assigns <destination> := <destination> * <value> val_div = 2108 # (val_div, <destination>, <value>), # Assigns <destination> := <destination> / <value> call_script = 1 # (call_script, <script_id>, [<script_param>...]), # Calls specified script with or without parameters. try_begin = 4 # (try_begin), # Opens a conditional block. else_try = 5 # (else_try), # If conditional operations in the conditional block fail, this block of code will be executed. try_end = 3 # (try_end), # Concludes a conditional block or a cycle.
So if you see a 2133 you can see its a (assign, <destination>, <value>), which will require a variable and a value (number, variable, etc).
From module_constants.py you have the slots codes (savegame file). Its easy to find any special code from VC by checking with MnBSaveGameEditor.
From header_common.py you have some masks and very important: tags
Code:tag_register = 1 tag_variable = 2 tag_string = 3 tag_item = 4 tag_troop = 5 tag_faction = 6 tag_quest = 7 tag_party_tpl = 8 tag_party = 9 ....
with that you can see that a 2170 2 123456 would mean: operation 2170 + variable 123456.
Scripts that exist on native are easier to figure out as you can compare the variables to figure out names quickly. But in general its easy to get the general code idea in a few minutes just by looking at it once you memorize the codes (modders tend to do that after a few months lol).
On a hypothetical world you could use a script to do that for you
Cheers
kraggrim said:Added "Change the village recruit type of to be based on the faction owning the village"
100 and 500 is the range for the loot. Change to something else like 1000 and 5000 and you will get 10x the cash loot.