Posted: Sat Apr 16, 2022 6:08 am Post subject: X and Y turncap values
Hi there,
I am extremely new to CE and am trying to make a simple cheat that will increase turncap values on a melee game.
I managed to achieve this via very simple code, but only partially as when I enable the script, it increases my X turncap but completely disables all movement on the Y axis.
In the xmm0 register (pic below) I can see the values for the X and Y turncaps of the current weapon - how do I access and change both?
movsd moves a double, not a float.
Are you sure that injection point is ok? IIRC there's a performance hit when reinterpreting the data in a vector register (i.e. doubles as floats). A good compiler would generate that code if it were overwriting the floats in the register- not if it were going to reinterpret the double as two floats later on.
Anyway:
Code:
...
alloc(newmem,2048)
label(turncaps)
label(x_turncap)
label(y_turncap)
registersymbol(x_turncap) // in case you want to dynamically change the value
registersymbol(y_turncap) // in case you want to dynamically change the value
movsd moves a double, not a float.
Are you sure that injection point is ok? IIRC there's a performance hit when reinterpreting the data in a vector register (i.e. doubles as floats). A good compiler would generate that code if it were overwriting the floats in the register- not if it were going to reinterpret the double as two floats later on.
Anyway:
...
[/code]
Thanks so much! This worked perfectly, and thanks for letting me know how it works. I'm using this injection point as I can't really find another with my knowledge, but I haven't experienced any performance hits - this runs very smoothly for me.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum