No delay for weapons - is this scriptable?
No delay for weapons - is this scriptable?
Right after the 2-byte ammo value, there's the 1-byte delay in frames.
Removing the code setting this one up gives these results.
Can this be scripted I just played around with CheatEngine for that video (to demonstrate what it can do for a presentation).
<--dafuq
Removing the code setting this one up gives these results.
Can this be scripted I just played around with CheatEngine for that video (to demonstrate what it can do for a presentation).
<--dafuq
Re: No delay for weapons - is this scriptable?
Nice. I've always wanted to do that. It might require vike to change one of the commands to support peak and poke. Hopefully this motivates him to do it sooner.
I asked him to change CHECK_RESPECT_GREATER ( playername , gangname , requiredlevel ) to change/read bytes if the requiredlevel is 1337 or 31337.
I asked him to change CHECK_RESPECT_GREATER ( playername , gangname , requiredlevel ) to change/read bytes if the requiredlevel is 1337 or 31337.
Re: No delay for weapons - is this scriptable?
Cool thing! I have to get into scripting soon I think, doesn't look too hard, just too lazy to set up tools.
Btw, sometimes GTA2 crashes when shooting Rocket Launchers with 0 delay (appears to happen randomly, not according to the number of missiles flying or explosions seen), I changed the opcode to set a delay of 1 and it never crashed anymore.
Btw, sometimes GTA2 crashes when shooting Rocket Launchers with 0 delay (appears to happen randomly, not according to the number of missiles flying or explosions seen), I changed the opcode to set a delay of 1 and it never crashed anymore.
- Cuban-Pete
- Immortal
- Posts: 909
- Joined: 29 Jan 2010, 15:03
- GH nick: Cuban-Pete
Re: No delay for weapons - is this scriptable?
OVERLORD READY!
Nice hacking!
Nice hacking!
"Mmmm, your eyes are so beautiful."
Re: No delay for weapons - is this scriptable?
BTW, a value of 65535 (-1 or 0xFFFF) gives K.F. ammo, can't that be set in scripts? I always saw ammos being "freezed" to 99(0)
Re: No delay for weapons - is this scriptable?
If you give KF ammo the proper way then you can't switch weapon. I still haven't checked if this can be done just with script and the current exe.
Re: No delay for weapons - is this scriptable?
Oh lol thats funny, it works flawlessy when just manipulating the ammo value with CheatEngine, you can switch between every weapon with K.F. ammo.
Re: No delay for weapons - is this scriptable?
I'm surprised more people haven't commented on this. It's one of my all time favourite GTA2 videos.
Re: No delay for weapons - is this scriptable?
Oh well, I don't think it's too special. It was fun combining this with indestructible cars, you could throw as many rocket launchers or whatever on them and they didn't explode
Re: No delay for weapons - is this scriptable?
Will that change the scripts behaviour which use that function already?Sektor wrote:I asked him to change CHECK_RESPECT_GREATER ( playername , gangname , requiredlevel ) to change/read bytes if the requiredlevel is 1337 or 31337.
Its ok, i dont comment much on these anyways... here i am, as requested. though.Sektor wrote:I'm surprised more people haven't commented on this. It's one of my all time favourite GTA2 videos.
My GTA2 related projects:
-
- Immortal
- Posts: 889
- Joined: 16 May 2009, 06:14
- GH nick: BenMillard
- Location: London, UK
- Contact:
Re: No delay for weapons - is this scriptable?
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)
Re: No delay for weapons - is this scriptable?
Nothing uses that command but it won't matter if they do since it will act like normal if the respect value is 100 or under. Anything over 100 is not sensible, so Vike can add his own code there.T.M. wrote:Will that change the scripts behaviour which use that function already?
Re: No delay for weapons - is this scriptable?
Oh, but the function is still working in GTA2?Sektor wrote:Nothing uses that command but it won't matter if they do since it will act like normal if the respect value is 100 or under. Anything over 100 is not sensible, so Vike can add his own code there.T.M. wrote:Will that change the scripts behaviour which use that function already?
Why not use CHECK_RESPECT_EQUAL() instead? Somewhat more intuitive to me, than using "greater".
My GTA2 related projects:
- Vike the Hube
- Hitman
- Posts: 145
- Joined: 28 Feb 2010, 22:34
- GH nick: vike
Re: No delay for weapons - is this scriptable?
PacMani what exact address did you use for this?
Re: No delay for weapons - is this scriptable?
The delay is the unsigned byte after the ammo which is a short int in every weapon info structure. There's no fixed address for that or some kind of pointer I can give you right now (I always searched for ammo and added the byte after it).
E.g.
... 04 01 31 00 00 00 ...
Here I got 26 rocket launchers (0x0104 = 260 / 10) and a delay of 49 frames (0x31) until I can shoot it again. The delay may also be a short int but I never had a delay bigger than 255 frames, but stuff afterwards was also always 0x00.
E.g. like here, the weapon info structures are outlined in red, the ammo in green and the delay in blue.
The weapon info array is filled up in the order you got the weapons, e.g. if you got the rocket launcher first, he will be the first one in the array, and if you got a pistol afterwards, it will be the second entry in the array. The byte in the third row in each weapon info structure right after the yellow line also seems to be an order index or something (always counting up, 0x85E4, 0x85F4, 0x8604, 0x8614), don't ask me!^^ There's also a 0x00 and 0x01 flag for weapons which is set for weapons which are fired by tapping Ctrl and not holding it (like the Tank Rocket Launchers), freezing it to 0 or removing the code setting it has no effect though.
E.g.
... 04 01 31 00 00 00 ...
Here I got 26 rocket launchers (0x0104 = 260 / 10) and a delay of 49 frames (0x31) until I can shoot it again. The delay may also be a short int but I never had a delay bigger than 255 frames, but stuff afterwards was also always 0x00.
E.g. like here, the weapon info structures are outlined in red, the ammo in green and the delay in blue.
The weapon info array is filled up in the order you got the weapons, e.g. if you got the rocket launcher first, he will be the first one in the array, and if you got a pistol afterwards, it will be the second entry in the array. The byte in the third row in each weapon info structure right after the yellow line also seems to be an order index or something (always counting up, 0x85E4, 0x85F4, 0x8604, 0x8614), don't ask me!^^ There's also a 0x00 and 0x01 flag for weapons which is set for weapons which are fired by tapping Ctrl and not holding it (like the Tank Rocket Launchers), freezing it to 0 or removing the code setting it has no effect though.
Re: No delay for weapons - is this scriptable?
p + 368 seems to contain the address of the player's 1st weapon ammo but I need a PEEK command to copy that address into a counter or some way to read a value rather than a pointer.
I think the code to remove the delay for the 1st weapon would look something like this once Vike adds PEEK and POKE.
COUNTER ammopointer
COUNTER ammoaddress
COUNTER reload
SET ammopointer = (p + 368)
CHECK_RESPECT_EQUAL (ammopointer, ammoaddress, 1337) // peek (for this example 4 bytes would need to be read into a counter, perhaps 104 for 4 bytes would make more sense than 1337).
SET reload = (ammoaddress + 2)
CHECK_RESPECT_EQUAL (reload, 0, 31337) // poke
I think the code to remove the delay for the 1st weapon would look something like this once Vike adds PEEK and POKE.
COUNTER ammopointer
COUNTER ammoaddress
COUNTER reload
SET ammopointer = (p + 368)
CHECK_RESPECT_EQUAL (ammopointer, ammoaddress, 1337) // peek (for this example 4 bytes would need to be read into a counter, perhaps 104 for 4 bytes would make more sense than 1337).
SET reload = (ammoaddress + 2)
CHECK_RESPECT_EQUAL (reload, 0, 31337) // poke
Re: No delay for weapons - is this scriptable?
Wow, you guys could really need a "preprocessor" e.g. translator program for converting new "high level GTA code" to those low level workaround commands
Re: No delay for weapons - is this scriptable?
You read my thoughts.PacMani wrote:Wow, you guys could really need a "preprocessor" e.g. translator program for converting new "high level GTA code" to those low level workaround commands
I think that could be done by the custom compiler (which is work in progress, ETA 2019), which would have special functions with intuitive naming, which would generate that code.
Basically it could just display specific patterns of code as those function names, but in reality, the .mis code would still look hacky (if you dont use the custom compiler/scriptpad).
Some of the hacks could never be compressed as simple function names, for example if you use it in a loop.
I think you guys should start listing these hacks in some list of new functions, where anyone could just take them in their scripts. For each function, you would write own function name, in the style of old function names.
For the new custom compiler, Sektor's function definition could look something like this:
[mis]
// function name and parameters:
REMOVE_DELAY_FOR_CURRENT_WEAPON [
PLAYER_PED player1 // one parameter for each line for clarity.
]
// function body:
COUNTER p1ammopointer
COUNTER p1ammoaddress
COUNTER p1reload
SET p1ammopointer = (player1 + 368)
CHECK_RESPECT_EQUAL (p1ammopointer, p1ammoaddress, 1337) // peek
SET p1reload = (p1ammoaddress + 2)
CHECK_RESPECT_EQUAL (p1reload, 0, 31337) // poke
// if the function returns something, we would just type in the end:
// RETURN something
[/mis]
Usage:
Code: Select all
REMOVE_DELAY_FOR_CURRENT_WEAPON (P1)
My GTA2 related projects:
- Cuban-Pete
- Immortal
- Posts: 909
- Joined: 29 Jan 2010, 15:03
- GH nick: Cuban-Pete
Re: No delay for weapons - is this scriptable?
Just wanted to drop by and say that this CheatEngine program is rather nice. Thanks for sharing.
"Mmmm, your eyes are so beautiful."
Re: No delay for weapons - is this scriptable?
oh no problem, its making me happy since a decade almost;D