You are not logged in.
Feel free to ask any questions related to Sanny Builder or CLEO here. All posts must be written in English.
Thanks.
Offline
Is it possible to use $PLAYER_ACTOR as variable in CLEO? If I want for example, to check if other variable is equal to $PLAYER_ACTOR, i get an error: "One of the variables has unknown type, or operands are incompatible." I think this is because CLEO script and main.scm files are separate scripts and $PLAYER_ACTOR doesn't exist in that CLEO script but I still can use it in other ways.
Offline
See help:
a) declared a variable of a type using VAR..END, but in fact used this variable with another type;
b) both of the variables weren’t declared through the VAR..END;
For example:
{$CLEO} var $PLAYER_ACTOR: Integer $test: Integer = 0 end if not $PLAYER_ACTOR == $test then Player.Money($PLAYER_CHAR) += 99999 end 0A93: end_custom_thread
Last edited by Sanchez (29-08-2007 19:18)
Offline
And GTA SA crashes when I declare $PLAYER_ACTOR
Offline
You can't use new global variables except those declared in the CustomVariables.ini. That's because the compiler knows nothing about global variables storage in the main.scm (how much variables it uses, what are their names), and it compiles new global variable beginning with the first allowable name, which is $2. So, adding a new variable with custom name, you actually creates new variable $2 in you script. If you know, such variable is defined as $PLAYER_CHAR in the CustomVariables.ini file. Your new variable's value just rewrites the value of $PLAYER_CHAR, and it may cause a game to be crashed. Yet anothor global variable will be compiled as $3, which is $PLAYER_ACTOR, and will rewrite its value.
So, you can't add new variables. If you need to check $PLAYER_ACTOR (why, btw?), you're only allowed to compare it with a local variable. Either declare both of them as integer, as you adviced before, or use the proper opcode:
803C: NOT $PLAYER_ACTOR == 9@
Offline
How to make sanny builder know that CLEO mission is mission? I want to use variables from 34@ to 1024@. I know I can disable limit in options but then there may be unspotted bugs... Could you make directive like {$MISSION} or {$M} to increase limits to mission limits?
Offline
The CLEO-scripts could be used as missions. The compiling process is the same, but the output file must have the extension .cm (Custom Mission). To start this mission, use the opcode 0A94.
Offline
2Sanchez:
He asked for another thing. I think he knows how to make a CLEO mission.
2Devan_LT:
I could make it so, the compiler will not complain about locals limits, if there is a $CLEO directive with .cm parameter ({$CLEO .cm}). Because in anyway, when you make a CLEO mission, you use this, so I think an additional directive isn't needed. OK?
Offline
2Devan_LT:
I could make it so, the compiler will not complain about locals limits, if there is a $CLEO directive with .cm parameter ({$CLEO .cm}). Because in anyway, when you make a CLEO mission, you use this, so I think an additional directive isn't needed. OK?
Hmm. I didn't think about that Would be nice
Last edited by Devan_LT (14-10-2007 17:55)
Offline
Hi. Just wanted to ask something: Is there any possibility of passing Strings to DLL functions, in CLEO scripts?
Offline
Hi. Just wanted to ask something: Is there any possibility of passing Strings to DLL functions, in CLEO scripts?
You can pass a POINTER to that string. For example, if you have some string in variable 1@s:
1@s = 'MYSTR'
To pass a pointer, you need to calculate it by adding 0x3C and number of variable multiplied by 4 to the thread pointer:
0A9F: 0@ = current_thread_pointer 0@ += 0x3C 0@ += 4 // variable 1@s => 1 * 4
Now 0@ contains address of the string MYSTR in game memory. You can pass this address using call opcode:
0AA5: call $DLLPROC num_params 1 pop 1 0@
Offline
Ohhh, I have really good request about CLEO. Making strings that work just like GXT strings. For example, I write 'MYSTRING' = "Do you see this message?" and below 00BC: show_text_highpriority GXT 'MYSTRING' time 1000 flag 1. And the game would show: Do you see this message?
I know this is somehow possible to make without that, like in ShowTextBox.s but I'm not a programmer and that would be hard for me...
Maybe just to make it like this:
0AB5: set GXT string "Do you see this message?" for string 'MYSTRING'
Offline
I wrote the GxtHook plugin specially to make using the custom GXT entries as easy as it's even possible. Have you considered using it?
Offline
ohhhh. I'll try to find everywhere next time before I ask...
Offline
Never mind I fixed it!:D
Last edited by supralov3r (05-11-2007 02:03)
Offline
I need info with file reading. Does it always read file from start? I need to store coordinates to files and then read them. I want to make simple path system to make cars drive like Tenpenny in the last mission. First: I make the script which records the path I drive into the file. Then I make the script which makes car drive exactly as I drove. I want to put this information: X Y Z SPEED Z_ANGLE Y_ANGLE. And code would cycle every 30-40ms to make the car drive smoothly. I think syntax like in Pawn wouldn't be hard for me but not this... Could you explain me that?
Offline
2Devan_LT:
The easiest way to do that is using the RRR paths. It’s the way Rockstar used in their missions. They are well-documented, have all the features you need (smooth movement at any coord, under any angle). There’s a CLEO script allowing you to record a vehicle movement. Then you add a new RRR path to the carrec.img and assign any vehicle to it. More information about these paths and tools is here and here.
Here is the code example, how to assign a vehicle to a path.
Offline
2Devan_LT:
The easiest way to do that is using the RRR paths. It’s the way Rockstar used in their missions. They are well-documented, have all the features you need (smooth movement at any coord, under any angle). There’s a CLEO script allowing you to record a vehicle movement. Then you add a new RRR path to the carrec.img and assign any vehicle to it. More information about these paths and tools is here and here.
Here is the code example, how to assign a vehicle to a path.
thanks for the help!
edit: oh, finally I found out how to use file reading. I will use your help if I can't do this using my own code. Car drives a little bit laggy and there are little problems with rotation but that way makes sure there won't be any conflicts between this and some other mod that somebody can make
Last edited by Devan_LT (14-11-2007 20:35)
Offline
Does Sanny Builder 3.03 require SA now?? I have tried to set the game directory to my GTA 3 directory but it won't work... Would someone please be able to help me?
Offline
2tehfatguy:
Make sure you set a current edit mode to GTA3. See that menu shown, when you click in the bottom right corner of the program? Choose the GTA3, and set the game directory. Should work.
Offline
Is there an possibillity to create substrings?
Substring is a part of given string ('str' is a substring of 'string'), yes? If so, I dunno, is it really needed? There's one string operation I know that supported by opcodes is concatenation (098B, 098C). But R* never used it, and no one too. Same goes to all string functions. If you give me some examples where you need such advanced opcodes, I probably change my opinion
Oh, and btw you can use those functions that are already in the exe. For example, function at 00826330
Get the length of a string .text:00826330 ; size_t __cdecl strlen(const char *str)
Opcode
0AA7: call_function 0x00826330 num_params 1 pop 1 0@ 1@
where 0@ is a pointer to string (see post #11 in this topic), should store to 1@ the length of given string.
Offline
var $PLAYER_ACTOR: Integer $test: Integer = 0 end if not $PLAYER_ACTOR == $test then Player.Money($PLAYER_CHAR) += 99999 end
I don't get it. I mean, I get it... for that instance but can't see how it applies to what I'm trying to do. Err, I haven't had to do anything special to use common globals like $PLAYER_ACTOR - they're working just dandy without me converting anything to permit the use of them AFAIK. Please elaborate if what I'm doing will eventually cause a crash? :wow:
Separately, I need to make my CLEO script check a dma var (from scm) and tell me if it's doing X... I have had no success so far.
:MOVEIT_DOOR 03CA: object $9811 exists jf @MOVEIT_COND if or 0837: object $9811 animation == "CLO_Pose_In_O" 0837: object $9811 animation == "CLO_Pose_Out_O" jf @MOVEIT_COND ...blah blah blah
Can you or Seemann tell me if this is impossible to do in a CLEO script -OR- how to accomplish it correctly?
Many thanks in advance,
-Midnightz
Last edited by Midnightz (29-11-2007 10:07)
Offline
Err, I haven't had to do anything special to use common globals like $PLAYER_ACTOR - they're working just dandy without me converting anything to permit the use of them AFAIK. Please elaborate if what I'm doing will eventually cause a crash?
Yes, you don't need to do something special to use the globals.
Separately, I need to make my CLEO script check a dma var (from scm) and tell me if it's doing X... I have had no success so far.
Make sure the other part of the script is correct. I haven't see anything wrong in that one you posted.
Btw, if you're going to deal with something from the original scm, check if the script of given name is running, using
0AAA: 0@ = thread 'WARROBE' pointer if 0@ > 0 then .... // thread running, go on end
it's going to be an additional measure to prevent crashing for those who will use this CLEO script on modded scms (without external scripts).
Offline