CLEO Help Math opcodes

CLEO related
Status
Not open for further replies.

moadif

Member
Joined
Apr 17, 2013
Messages
11
Reaction score
0
ey
sanny builder doesn't work for me for stuff like making a condition of float > float without the opcode or even changing/increasing the value of a variable
Basically what I'm trying to do is
I got two coordinates of two different players(already done) I get both of their Z put in two different variable, say we got 1@(my Z) and 2@ (other player's Z)
What I'm trying to do here is declare a new variable equals to my 1@(my Z) and increase it by let's say 5.0 for example then under (00D6: if) compare it with 2@(the other player's Z) checking if the new variable is > or < than 2@
Which opcodes should I be using/does anyone have a clear guide about those opcodes the opcodes list in sanny builder isn't clear at all doesn't show how they should be used
Thanks
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Code:
0087: 0@ = 1@ // (float)
That's the opcode which copies the float variable, then you can use opcodes like:
Code:
000B: 0@ += 5.0 // adding normal value to float variable
005B: 0@ += 31@  // adding float variable to float variable
0025:   0@ > 2@  // compare floats

It's kinda pain in the ass to use math calculations in Cleo. To find a proper opcode for your number/variable you should use "opcode search tool" in Sanny builder and:
1. Type mathematical sign first. For example if you want to add something type "+="
subtract "-="
multiply "*="
divide "/="
compare ">"

2. See the selected opcodes by automatic search and find the one which is right for your calculations. Pay attention to dots in order to distinguish opcodes suitable for float from opcodes suitable for integers

You can also use http://gtag.gtagaming.com/opcode-database/browse/Math/
 

moadif

Member
Joined
Apr 17, 2013
Messages
11
Reaction score
0
monday link said:
Code:
0087: 0@ = 1@ // (float)
That's the opcode which copies the float variable, then you can use opcodes like:
Code:
000B: 0@ += 5.0 // adding normal value to float variable
005B: 0@ += 31@  // adding float variable to float variable
0025:   0@ > 2@  // compare floats

It's kinda pain in the ass to use math calculations in Cleo. To find a proper opcode for your number/variable you should use "opcode search tool" in Sanny builder and:
1. Type mathematical sign first. For example if you want to add something type "+="
subtract "-="
multiply "*="
divide "/="
compare ">"

2. See the selected opcodes by automatic search and find the one which is right for your calculations. Pay attention to dots in order to distinguish opcodes suitable for float from opcodes suitable for integers

You can also use http://gtag.gtagaming.com/opcode-database/browse/Math/

Exactly what I was looking for, thanks!!!
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You can also define variables data types.

var
0@ : float
1@ : int
2@ : float
end

So you can use just use math operands without adding the opcode;
if 0@ == 2@
etc.
 
Status
Not open for further replies.
Top