View Full Version: Help with hex edior and writing cheats VCS

CheatSync.net Forums > Cheat Device Development > Help with hex edior and writing cheats VCS


Title: Help with hex edior and writing cheats VCS


cgimusic - August 31, 2008 08:29 PM (GMT)
I have written cheats in LCS before and it has been fairly easy but now I want to try writing cheats for VCS. How do you write the equivalent of going to 0x08E812F0 in the Hex Editor and changing everything on that line to zero?

Edit: What I am trying to do is spawn a car. I am using the code:
CODE
car = 0x08E812F0;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);


but I can only use it once then I have to go in to hex editor and set everything on the 0x08E812F0 line to zero before I can use it again.

emcp - August 31, 2008 08:51 PM (GMT)
QUOTE (cgimusic @ Aug 31 2008, 08:29 PM)
I have written cheats in LCS before and it has been fairly easy but now I want to try writing cheats for VCS. How do you write the equivalent of going to 0x08E812F0 in the Hex Editor and changing everything on that line to zero?

Edit: What I am trying to do is spawn a car. I am using the code:
CODE
car = 0x08E812F0;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);


but I can only use it once then I have to go in to hex editor and set everything on the 0x08E812F0 line to zero before I can use it again.

its already been done, search it

also ive never heard of resetting to zero
i think you may need different address for each spawn, check out the

http://www.cheatsync.net/tools/vcscarspawn/index.php


it should show plus the original try just keep copying the second one after the first

cgimusic - August 31, 2008 09:18 PM (GMT)
QUOTE (emcp @ Aug 31 2008, 08:51 PM)
QUOTE (cgimusic @ Aug 31 2008, 08:29 PM)
I have written cheats in LCS before and it has been fairly easy but now I want to try writing cheats for VCS. How do you write the equivalent of going to 0x08E812F0 in the Hex Editor and changing everything on that line to zero?

Edit: What I am trying to do is spawn a car. I am using the code:
CODE
car = 0x08E812F0;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);


but I can only use it once then I have to go in to hex editor and set everything on the 0x08E812F0 line to zero before I can use it again.

its already been done, search it

also ive never heard of resetting to zero
i think you may need different address for each spawn, check out the

http://www.cheatsync.net/tools/vcscarspawn/index.php


it should show plus the original try just keep copying the second one after the first

The problem with that is that I want to be able to run the cheat once then again to get a second car. The variables don't stay outside of cheats. Is their a way of saving the last variable used to memory then pulling it out of memory the next time the cheat is run. In pseudo code it would be something like this:

SomeMemory set to SomeMemory + 1
car = 0x08E812F0 + SomeMemory * 0x30

cgimusic - August 31, 2008 09:45 PM (GMT)
Ok. After a bit of thinking I put this code together:

CODE
setint(0x08BA9460, getint(0x08BA9460) + 1);
car = 0x08E812F0 + getint(0x08BA9460) * 0x30;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);
off();


I have two questions:
1. When I first run the code I have to move away and then come back to the spawn spot before the car spawns. Is there a way of preventing this?
2. The address that stores the number of time the cheat has run (0x08BA9460) was just one I chose because it was always on zero. Could this mess up the game in other places? Is there any address that is not used by the game that I could store this in?

EDIT:
Also how do you spawn an object next to the player (e.g. In front of them) regardless of where they are?

emcp - August 31, 2008 09:55 PM (GMT)
QUOTE (cgimusic @ Aug 31 2008, 09:45 PM)
Ok. After a bit of thinking I put this code together:

CODE
setint(0x08BA9460, getint(0x08BA9460) + 1);
car = 0x08E812F0 + getint(0x08BA9460) * 0x30;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);
off();


I have two questions:
1. When I first run the code I have to move away and then come back to the spawn spot before the car spawns. Is there a way of preventing this?
2. The address that stores the number of time the cheat has run (0x08BA9460) was just one I chose because it was always on zero. Could this mess up the game in other places? Is there any address that is not used by the game that I could store this in?

EDIT:
Also how do you spawn an object next to the player (e.g. In front of them) regardless of where they are?

place search for it
its is here

for the having to go away part
you have to force the game into loading it, the usual way is to teleport somewhere then teleport back (include it in your script)
there may be better ways, but i forget

cgimusic - August 31, 2008 10:33 PM (GMT)
QUOTE (emcp @ Aug 31 2008, 09:55 PM)
QUOTE (cgimusic @ Aug 31 2008, 09:45 PM)
Ok. After a bit of thinking I put this code together:

CODE
setint(0x08BA9460, getint(0x08BA9460) + 1);
car = 0x08E812F0 + getint(0x08BA9460) * 0x30;
setint(car, 254);
setfloat(car + 4, -49.09, -635.39, 9.77, 0);
off();


I have two questions:
1. When I first run the code I have to move away and then come back to the spawn spot before the car spawns. Is there a way of preventing this?
2. The address that stores the number of time the cheat has run (0x08BA9460) was just one I chose because it was always on zero. Could this mess up the game in other places? Is there any address that is not used by the game that I could store this in?

EDIT:
Also how do you spawn an object next to the player (e.g. In front of them) regardless of where they are?

place search for it
its is here

for the having to go away part
you have to force the game into loading it, the usual way is to teleport somewhere then teleport back (include it in your script)
there may be better ways, but i forget

Thanks. I haven't yet found a way to get the players location and rotation. This would solve my first and third problems. I just think I will keep the address described in the second problem the same unless it messes it up.

Waterbottle - September 1, 2008 02:26 PM (GMT)
CODE
static var;
var++;

var starts at 0 and will increment by one for every frame.

CODE
x = getfloat( pplayer+0x30 );
y = getfloat( pplayer+0x34 );
z = getfloat( pplayer+0x38 );

Would get the player's position.

Rotation is harder. If you just want to give an object the same rotation as the player then you could do something like.

CODE
memcpy( objectAddress, pplayer, 0x40 );

cgimusic - September 1, 2008 09:59 PM (GMT)
Thanks. I'll give it a go.

cgimusic - September 1, 2008 10:40 PM (GMT)
It should work in theory but I now have the problem that when I teleport away the teleport back command does not register. Is there a delay command? Sorry for being such a pain.

Waterbottle - September 2, 2008 07:04 PM (GMT)
There isn't really a delay function, but you could simulate something.

CODE
static counter;
if( counter == 0 )
{
   // Enter code to be executed when the cheat is started here
}
counter++;
if( counter > numberOfFramesToWait )
{
   // code to execute after delay here
}




Hosted for free by InvisionFree