Most people who having at least a little knowledge in computer programming, should know that the computer code is in the form of zeros and ones, which is called the binary numeral system. The smallest unit of information in computer bits. Bits can be either off, then its value is zero, or turned, then its value is equal to one.
The processor in the PC still use 32-bit architecture (Intel and AMD produce processors with 64-bit architecture, but at the moment operating system plainly does not support it).
Bits are numbered from 0 to 31 (right to left):
31 30 29 28 27 ... ... ... .. 5 4 3 2 1 0.
Anyway, lets get back to the real topic
You need to set the bit, then the game will know which bit *it* is, so when you use the opcode below, if it does not = 0 for example then, let the script move on to the next.
We could check if the bit is 0, if not then we could move on to the next bit, and so on, (if your using one than one that is).
A bit should always be cleared when not needed anymore, look at the script, it's very easy to understand you should get the idea:
The processor in the PC still use 32-bit architecture (Intel and AMD produce processors with 64-bit architecture, but at the moment operating system plainly does not support it).
Bits are numbered from 0 to 31 (right to left):
31 30 29 28 27 ... ... ... .. 5 4 3 2 1 0.
Anyway, lets get back to the real topic
- Code:
08BA: set 1@ bit 0
You need to set the bit, then the game will know which bit *it* is, so when you use the opcode below, if it does not = 0 for example then, let the script move on to the next.
- Code:
00d6: if
08B4: test 1@ bit 0
004d: jump_if_false @next
We could check if the bit is 0, if not then we could move on to the next bit, and so on, (if your using one than one that is).
- Code:
08C0: clear 1@ bit 0
A bit should always be cleared when not needed anymore, look at the script, it's very easy to understand you should get the idea:
- Code:
{$CLEO}
0000:
0006: 1@ = 0
:EAX_01
while true
wait 250
if
Player.Defined($PLAYER_CHAR)
then
break
end
end
if
00E1: player 0 pressed_key 10 // no key
then
08BA: set 1@ bit 0
jump @EAX_02
end
if
00E1: player 0 pressed_key 11 // yes key
then
08BA: set 1@ bit 1
jump @EAX_02
end
if
00E1: player 0 pressed_key 19 // look behind
08BA: set 1@ bit 2
end
:EAX_02
if
08B4: test 1@ bit 0
then
0AA5: call 0x43A0B6 num_params 1 pop 1 0x19B // Infernus
jump @EAX_03
end
if
08B4: test 1@ bit 1
then
0AA5: call 0x43A0B6 num_params 1 pop 1 0x21D // Bullet
jump @EAX_03
end
if
08B4: test 1@ bit 2
then
0AA5: call 0x43A0B6 num_params 1 pop 1 0x1C3 // Turismo
end
:EAX_03
08C0: clear 1@ bit 0
08C0: clear 1@ bit 1
08C0: clear 1@ bit 2
jump @EAX_01