1) I have a multilevel pointer which gives the value for money with a multiplier applied to the value shown in the game. However, I don't want to open my calculator every time to apply the multiplier to the amount I want... Is it possible to change the value to the amount I want with a script that applies the multiplier automatically?
2) Also, this money pointer is at all times 8 bytes away from another useful address pointing toward an honor value. How would I go about writing a script to calculate the honor address based off the money pointer?
Modifying values of pointers
Re: Modifying values of pointers
1.) You can add a custom type and set the pointer value type to that.
Here is a script for an integer (4 byte) divided by 100, you'll need to add this to the table Lua script:
2.) Just add to the final offset. Copy & paste the pointer, then add to the final offset (the one at the top in the CE address/pointer window).
Here is a script for an integer (4 byte) divided by 100, you'll need to add this to the table Lua script:
Code: Select all
local TypeName = 'Int / 100'
local ByteCount = 4
local IsFloat = false
local function bytesToValue( ... )
local bytes = { ... }
return (byteTableToDword({ bytes[1], bytes[2], bytes[3], bytes[4] }) / 100)
end
local function valueToBytes(value)
local bytes = dwordToByteTable(value * 100)
return bytes[1], bytes[2], bytes[3], bytes[4]
end
registerCustomTypeLua(TypeName, ByteCount, bytesToValue, valueToBytes, IsFloat)
2.) Just add to the final offset. Copy & paste the pointer, then add to the final offset (the one at the top in the CE address/pointer window).
Re: Modifying values of pointers
Yeah, sure he'll know wtf you mean with Lua code
Re: Modifying values of pointers
Thanks, ShyTwig16! Everything is working
Who is online
Users browsing this forum: No registered users