I then want to get that value and push it onto the text stack (for debug initially, then later will be for player info)
Here's something that doesn't actually crash the game or make renum sulk, but stubbornly displays 0 in the industry window.
Code: Select all
// assume action 0 is all tickety-boo and works
// action 2s
-1 * 0 02 0A B0 //store a production for each cargo (65,535)
89 // using type 89 because register IDs are better specified as double words
1A 20 \dxFFFFFFFF // create a value (constant 1A anded (20) with following bytes)
10 1A 00 \dx01 // store in persistent storage
01
A0 00 00 00 00 00 00 00 00 00
A0 00
-1 * 0 02 0A CC //store something to register, return text ID
89 //
7C 01 20 \dxFFFFFFFF // get a value from persistent storage
0E 1A 00 \dx100 // store in register
\b1 //range (stay out of the nvar=0 bear pit by checking one range, but returning same for both)
STR_INFO_DEBUG 80 00 00 00 00 00 00 00 00
STR_INFO_DEBUG 80 //default
// assume action 3 and varaction 2 for handling industry text cb is good and fine and works
------
// text code
-1 * 0 04 0A LANG_ID2 01 STR_INFO_DEBUG D0 "\94DEBUG \0DCargo 1 prod ratio: \7C \0D" 00
(2) failing to read the register correctly / getting 0 as the default value of the register
(3) doing something stupid with bits that makes my result 0.
What larks Any clues?