Changing quantity on a table with the Lua script.
Posted: Sat Jun 08, 2019 3:39 pm
Hello, everyone, I am currently trying to change the quantity of the constants used in the script for basic and special resources on this table for Galactic Civilizations 3. I have never heard of Lua scripting until I wanted to change the quantity and began to google around. Not very productive on my end. I have been looking at the Lua script, and I have no idea what is written and how to change them.
// Constants used in the script (that can be changed)
define(ctCE67,(float)6.7)
define(ctMCRE,#67000000) // Minimum Credits
define(ctMMSS,#20000) // Minimum Settlers/Soldiers
define(ctMBRS,#10000) // Minimum Basic Resources
define(ctMSRS,#5000) // Minimum Special Resources
When I first looked at this, I thought that just changing the numbers in the parenthesis would do the trick, but that didn't work. I then looked for MBRS because it was for the resources I wanted, but then saw this:
_MonHP00:
cmp dword ptr [iEnableMBR],0
je _MonHP05 // Jump if feature is disabled
mov ecx,ctMBRS
cmp [rdx+000236e0],ecx
jns _MonHP01
mov [rdx+000236e0],ecx
_MonHP01:
cmp [rdx+000236e4],ecx
jns _MonHP02
mov [rdx+000236e4],ecx
_MonHP02:
cmp [rdx+000236e8],ecx
jns _MonHP03
mov [rdx+000236e8],ecx
_MonHP03:
cmp [rdx+000236ec],ecx
jns _MonHP04
mov [rdx+000236ec],ecx
_MonHP04:
cmp [rdx+000236f0],ecx
jns _MonHP05
mov [rdx+000236f0],ecx
_MonHP05:
cmp dword ptr [iEnableMSR],0 // new (s3.0)
je _MonHP0X // Jump if feature is disabled
xor rcx,rcx
_MonHP06:
cmp dword ptr [rdx+rcx*4+000238c4],ctMSRS
jns _MonHP07
mov dword ptr [rdx+rcx*4+000238c4],ctMSRS
Yeah, I got no idea how this works, lol. With the limited knowledge, I found, I can only assume that those in the brackets are the destinations of the code and not actually how to change them? I have not downloaded Lua, because I really don't know how to use it, and I thought it would just be best to ask for help. I would like to ask for help in changing the quantity of the basic resources from 10 to 100 and the special resources from 5 to 50. Any help would be appreciated.
// Constants used in the script (that can be changed)
define(ctCE67,(float)6.7)
define(ctMCRE,#67000000) // Minimum Credits
define(ctMMSS,#20000) // Minimum Settlers/Soldiers
define(ctMBRS,#10000) // Minimum Basic Resources
define(ctMSRS,#5000) // Minimum Special Resources
When I first looked at this, I thought that just changing the numbers in the parenthesis would do the trick, but that didn't work. I then looked for MBRS because it was for the resources I wanted, but then saw this:
_MonHP00:
cmp dword ptr [iEnableMBR],0
je _MonHP05 // Jump if feature is disabled
mov ecx,ctMBRS
cmp [rdx+000236e0],ecx
jns _MonHP01
mov [rdx+000236e0],ecx
_MonHP01:
cmp [rdx+000236e4],ecx
jns _MonHP02
mov [rdx+000236e4],ecx
_MonHP02:
cmp [rdx+000236e8],ecx
jns _MonHP03
mov [rdx+000236e8],ecx
_MonHP03:
cmp [rdx+000236ec],ecx
jns _MonHP04
mov [rdx+000236ec],ecx
_MonHP04:
cmp [rdx+000236f0],ecx
jns _MonHP05
mov [rdx+000236f0],ecx
_MonHP05:
cmp dword ptr [iEnableMSR],0 // new (s3.0)
je _MonHP0X // Jump if feature is disabled
xor rcx,rcx
_MonHP06:
cmp dword ptr [rdx+rcx*4+000238c4],ctMSRS
jns _MonHP07
mov dword ptr [rdx+rcx*4+000238c4],ctMSRS
Yeah, I got no idea how this works, lol. With the limited knowledge, I found, I can only assume that those in the brackets are the destinations of the code and not actually how to change them? I have not downloaded Lua, because I really don't know how to use it, and I thought it would just be best to ask for help. I would like to ask for help in changing the quantity of the basic resources from 10 to 100 and the special resources from 5 to 50. Any help would be appreciated.