CLEO Help If 1@ is a float/int/string then

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Hi, is there any opcode to check the type of the value?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I'd like to check 3 things. Check if 1@ is a float. Check if 1@ is an integer. Check if 1@ is a string.
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Oh, didn't notice the "why". I'd like to check it to avoid crash/losing time just because I use inappropriate opcode in order to write the value in INI file.


E.g.
I'd like to write in INI file the value of my actor's active interior by using the opcode below.
Code:
077E: get_active_interior_to 1@

I don't know what type of value stands for the active interior so I dopn't know which one of the following opcodes I should use in order to save the data in INI file.
Code:
0AF1: write_int 16 to_ini_file "cleo\config.ini" section "SectionName" key "intKey"
0AF3: write_float 0.0 to_ini_file "cleo\config.ini" section "SectionName" key "floatKey"
0AF5: write_string "new string value" to_ini_file "cleo\config.ini" section "SectionName" key "stringKey"
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I beg your pardon. I don't know if you noticed but this section of the forum is called "Help". That's the place where people ask questions when they don't know something. That's also the place where people with more knowledge and some good will give advice to less experienced users. That's the purpose of the "Help" section. I'm just saying because it seems like you're unaware of it and unaware of the fact that it's not the best place to manifest your emotional issues.

I'm new in here, but so far most of people I've met on ugbase.eu were quite polite. Is this kind of attitude accepted in here?
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
monday link said:
I beg your pardon. I don't know if you noticed but this section of the forum is called "Help". That's the place where people ask questions when they don't know something. That's also the place where people with more knowledge and some good will give advice to less experienced users. That's the purpose of the "Help" section. I'm just saying because it seems like you're unaware of it and unaware of the fact that it's not the best place to manifest your emotional issues.

I'm new in here, but so far most of people I've met on ugbase.eu were quite polite. Is this kind of attitude accepted in here?
Code:
0AF1: write_int 16 to_ini_file "cleo\config.ini" section "SectionName" key "intKey"
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Anyway, I was so suprised by the uncivilised approach of your answer that I didn't focus on the substantive meaning of it.

FIRST OF ALL YOU CAN'T GET "CRASHED" OVER READING A VALUE WITH THE "WRONG" DATA TYPE, IT'S EITHER GONNA GIVE YOU GIBERRISH UNREADABLE INFORMATION. OR CORRECT, AND READABLE FUCKING INFORMATION
I'm not sure but if my memory is not misleading me then when i placed some time ago "%d" or "%f" by mistake for a string value in 0AD0: then the game crashed.

NOW WHAT DO U THINK "ACTIVE INTERIOR" WOULD BE? TEXT? FUCK OFF...
If you look at the "Contents/Help -> SCM Documentation -> GTA SA -> GTA SA interior" section of Sanny builder then you'll notice that there is a number and a specific name for each of the interiors. It's natural that someone like me who has no big expierience in this area won't know what's the type of data which stands for actor's active interior.

AND BESIDES, THERE ARE ONLY 3 OPCODES WHY DON'T YOU FUCKING TRY THEM ALL UNTIL YOU FIND THE CORRECT ONE
Some people prefer making mistakes and learning from them. Other people prefer taking advice from people who have more knowledge.

ATLEAST U WOULDN'T BE STUPID TO NOT DO THAT, AND COME HERE, WASTE LIKE 2 MILLION BYTES WORTH OF DATA STORAGE OF THIS WEBSITE, ON SOME STUPID ASS QUESTIONS LIKE THIS
That's a brave statement xd Maybe I am stupid but at least I know that using FULL CAPS makes you look more like a frustrated 15 years old kid hiding behind a keyboard rather than a man with his stable views and opinions.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
You can't, data is stored to variables by your code, you should know before what kind of data type you store to each variable. You can use a simple debug like this
Code:
0AF8: "%d %s %f" -1 1@ 1@ 1@
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
First this is not a waste of space, it is  pretty useful for other guys who have the same question


For the topic:
You should know what are these var.
I haven't seen or searched opcodes for checking it

But for string i remember there is something to check if it is the right word , may help you

@v = "  "

Why u would check it, u know the variables type already
If not then attach the code so we can tell u the code type
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
Opcode.eXe link said:
3@ = 10
3@ = 5.0
3@ = "HUE"

3@
+= 1
IF
3@ == 11
THEN
3@ is a int

3@
+= 1.3777
IF
3@ == 11.3777
THEN
3@ is a float

if nothing then its a string xD

Nicely done.
But still not really that useful  :me_gusta:
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
monday link said:
Anyway, I was so suprised by the uncivilised approach of your answer that I didn't focus on the substantive meaning of it.
I'm not sure but if my memory is not misleading me then when i placed some time ago "%d" or "%f" by mistake for a string value in 0AD0: then the game crashed.
If you look at the "Contents/Help -> SCM Documentation -> GTA SA -> GTA SA interior" section of Sanny builder then you'll notice that there is a number and a specific name for each of the interiors. It's natural that someone like me who has no big expierience in this area won't know what's the type of data which stands for actor's active interior.
Some people prefer making mistakes and learning from them. Other people prefer taking advice from people who have more knowledge.

That's a brave statement xd Maybe I am stupid but at least I know that using FULL CAPS makes you look more like a frustrated 15 years old kid hiding behind a keyboard rather than a man with his stable views and opinions.
OMG you're more stupid than i thought, alright man take it easy, go make your cleos...
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Thank you all for the answers:)




[member=5679]T3K[/member]
Keyboard-warriors-Keyboard.jpg
 
Status
Not open for further replies.
Top