Coding

 Reply to this postStart new topic

GTA SA CLEO SCM Hello world

fastman92
post Jan 20 2011, 10:23 AM
Post #1


Trained Member

Posts: 77
Joined: 25-October 10



CLEO


Every programming language has Hello world example. Now CLEO SCM has got one:

SANNY
{$CLEO}
0000: START

:DISPLAY
wait 1000
0AD1: show_formatted_text_highpriority "Hello world!" time 2000
jump @DISPLAY


{$CLEO} tells SB to create .cs file, not .scm.
:DISPLAY is label that we can jump afterwards to.
0AD1 is CLEO4 opcode to display text from variables. Easiest for example.
jump @DISPLAY - of course GTA parser must know what to do. Without this it would crash, because code is ended up.

This post has been edited by fastman92: Jan 20 2011, 03:43 PM
Go to the top of the page
 
+Quote Post
DK22
post Jan 29 2011, 08:38 PM
Post #2


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



Hey. I don't think that gta's "scripting" is a
QUOTE
programming language

btw, why did you make wait in 1000 and set the time flag to 2000?
QUOTE
jump @DISPLAY - of course GTA parser must know what to do. Without this it would crash, because code is ended up.

hm...
Go to the top of the page
 
+Quote Post
Deji
post Jan 29 2011, 11:19 PM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



Actually.. The SCM Parser doesn't crash because the file ended. The file is loaded into memory, so the parser doesn't know where the file ends. It just keeps reading data, including data which comes after the loaded script. This data could be information for the next CLEO Script or something else. Worth knowing as an idea to write SCM through memory.

I believe he made the time flag 2000 to compensate for any lag, which is not actually needed since both scripts and the text drawn runs by the same timer.


"Program" is usually used to refer to giving the computer instructions. Here, we are giving the game engine instructions, which then gives the computer instructions. Not a big difference really. The SCM is actually quite powerful (perhaps more so than some programming languages) since there is not too much that is done inbetween parsing the script and executing the instructions. Of course, if you were to use ASM in the script, you are definitely programming smile.gif


0ACC or 0ACD are more appropriate for text-only messages.


--------------------
Go to the top of the page
 
+Quote Post
fastman92
post Jan 30 2011, 11:18 AM
Post #4


Trained Member

Posts: 77
Joined: 25-October 10



0AD1 sets high priority text for some time given in miliseconds. I wrote time 2000. It is only simple hello world
Then i added wait 1000. There is no need to wait 0 in this simple code, text is set up for 2 seconds, wait is for 1 second.
No other operations are here.

I know that GTA .cs or .scm are only structure of instructions, labels. I also think Sanny SCM is programming language.
You have high level representation, labels, opcodes, if, while, for, costants and Sanny understands how to compile it. It is language.
Go to the top of the page
 
+Quote Post
DK22
post Jan 30 2011, 03:59 PM
Post #5


Member

Posts: 197
From: Liberty City, Shoreside
Joined: 15-July 10



QUOTE (Deji)
Of course, if you were to use ASM in the script, you are definitely programming

Ok, I agree smile.gif
Go to the top of the page
 
+Quote Post
Siggi
post Feb 2 2011, 10:20 PM
Post #6


User banned by request due to personal reasons. - SV

Posts: 24
From: 0xFFFFFFFF
Joined: 14-March 10



QUOTE
I also think Sanny SCM is programming language.
You have high level representation, labels, opcodes, if, while, for, costants and Sanny understands how to compile it. It is language.


Actually it doesn't depend on the structure the compiler interprets your code (whether low- or high-level) but on the construction itself.

SCM is a scrip language such as LUA and Tcl (although LUA now supports WINAPI libarys and structures it is still a script language).

Even SCM combined with ASM is still a scripting process...

sorry for smartassing


--------------------


User banned by request due to personal reasons. - SV
Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: