Mar 4 2013, 07:00 PM Post #1 | |
The New Guy! Posts: 9 Joined: 20-December 12 | Hi everyone! I write this post to show you a quite useful "trick" with "if" opcodes which don't have a negative form in GTAG opcodes.txt, like this one: 04AD: actor $PLAYER_ACTOR in_water You can use it in any check with no problems, but... sometimes it's more useful to have it in the negative form, so you have less labels, isn't it? For doing that, you only have to change the first 0 of the opcode to a 8, like in the example below: 84AD: actor $PLAYER_ACTOR in_water When you try to compile it, it'll turn to: 84AD: not actor $PLAYER_ACTOR in_water And it'll have the negative, inversed function. I don't really know why does it happen, but it's useful and some people perhaps don't know this This post has been edited by AlexTMjugador: Mar 4 2013, 07:02 PM |
Mar 4 2013, 07:13 PM Post #2 | |
Trained Member Posts: 77 Joined: 25-October 10 | It's known for ages. Command ID (whole 16 bits) is made up from two components: command ID (lowest 15 bits) notFlag - negation flag (highest bit) 04AD has highest bit off, while 84AD has highest bit on, that's the only difference. This post has been edited by fastman92: Mar 4 2013, 07:13 PM |
Mar 4 2013, 07:17 PM Post #3 | |
The New Guy! Posts: 9 Joined: 20-December 12 | It's known for ages. Command ID (whole 16 bits) is made up from two components: command ID (lowest 15 bits) notFlag - negation flag (highest bit) 04AD has highest bit off, while 84AD has highest bit on, that's the only difference. Thanks, but my intention was to help newbies who don't know that And can you make, by the way, semi-negative opcodes (although the won't probably work)? LOL This post has been edited by AlexTMjugador: Mar 4 2013, 07:18 PM |
Mar 4 2013, 07:27 PM Post #4 | |
Coding like a Rockstar! Posts: 1,468 From: ??? Joined: 28-May 09 | If you could divide 1 by any whole number and not get 1 or 0 in decimal, then yes, you could have a semi-negative opcode. But I challenge you to find a way to do that As for the OpcodeDB thing, it is intentional to leave out the negated opcode forms for a few reasons. They dont really need to show up anywhere and they just create a longer chain of opcodes to magic key through. And as of SCR, using keywords should be the norm, which can be negated easier by preceeding the command name with "NOT". I'd highly recommend using SCR (SCM v2) for future projects in Sanny Builder, by the way. -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
Mar 4 2013, 07:37 PM Post #5 | |
The New Guy! Posts: 9 Joined: 20-December 12 | If you could divide 1 by any whole number and not get 1 or 0 in decimal, then yes, you could have a semi-negative opcode. But I challenge you to find a way to do that As for the OpcodeDB thing, it is intentional to leave out the negated opcode forms for a few reasons. They dont really need to show up anywhere and they just create a longer chain of opcodes to magic key through. And as of SCR, using keywords should be the norm, which can be negated easier by preceeding the command name with "NOT". I'd highly recommend using SCR (SCM v2) for future projects in Sanny Builder, by the way. Ok, you can't do that with real numbers And about the SCR, I use Sanny Builder 3, the most beginner one, and only certain opcodes can be negated, like: not Actor.DrivingVehicleType() EDIT: http://gtagmodding.com/opcode-database/generator EDIT 2: Whoa! SCR is wonderful! It doesn't require intensive opcode search This post has been edited by AlexTMjugador: Mar 4 2013, 07:43 PM |
Jan 19 2014, 05:43 PM Post #6 | |
The New Guy! Posts: 5 Joined: 17-January 14 | Useful for newbies like me. -------------------- Removed |