Loader
logo

Post reply

Note: this post will not display until it has been approved by a moderator.
Attachments: (Clear attachments)
Restrictions: 4 per post (4 remaining), maximum total size 192 KB, maximum individual size 128 KB
Uncheck the attachments you no longer want attached
Click or drag files here to attach them.
Other options
Shortcuts: ALT+S post or ALT+P preview

Topic summary

Posted by tos1
 - March 05, 2024, 05:19:27 AM
Related topic (v8.* but inherited to v9.1):
<Negative values in the "Companion Overview" at towns> by me

I found out the cause and the solution! There is not enough level checking in a script. It checks only level 1 thru 30 (That was enough for Brytenwalda), and does not support AWoIaF's NPCs with higher levels.

My hand-disassembly of current code:

jq_xp_to_next_lvl, script.txt,
----
store_script_param ":L0" 1   # 23 2 1224979098644774912 1
try_begin   # 4 0
  lt ":L0" 600 # 2147483678 2 1224979098644774912 600
  assign ":L1" 600   # 2133 2 1224979098644774913 600
else_try   # 5 0
  lt ":L0" 1360 # 2147483678 2 1224979098644774912 1360
  assign ":L1" 1360   # 2133 2 1224979098644774913 1360
else_try   # 5 0
  lt ":L0" 2296 # 2147483678 2 1224979098644774912 2296
  assign ":L1" 2296   # 2133 2 1224979098644774913 2296
:
else_try   # 5 0
  lt ":L0" 412091 # 2147483678 2 1224979098644774912 412091
  assign ":L1" 412091   # 2133 2 1224979098644774913 412091

###### Add code for level 31 thru 50 here. (*1)

try_end   # 3 0
store_sub reg1 ":L1" ":L0"   # 2121 3 72057594037927937 1224979098644774913 1224979098644774912
str_store_string 1 "@{reg1}"   # 2320 2 1 1585267068834414851
----

*1  The conversion table (perhaps hard-coded) is here:
Modding Q&A [For Quick Questions and Answers], TaleWorlds forums

I checked NPC with max level in troops.txt, experimentally added else_try blocks for level 31 thru 50 to "jq_xp_to_next_lvl" in scripts.txt (and increased the number of operations), and got correct result.



In addition, the script is called from not only town's market-menu but also [Report]-[Companions Overview].

- How to reproduce it/when/why it happens:
Hire companions who have higher level than 30, Visit a town, select "Trade with locals", select "Companions overview", and see the column "to next lvl".

- Game version (and steam or downloaded):
AWoIaF v9.1, v8.2. Warband v1.174 downloaded