You are viewing our Forum Archives. To view or take place in current topics click here.
How to make a simple script in SCOCL [TUT]
Posted:

How to make a simple script in SCOCL [TUT]Posted:

XBLToothPik
  • Rated Awesome
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95

How to make a basic C/SCO Script in SCOCL
Video Tut:


Sorry about no mic, mic is busted





Things you will need
[ Register or Signin to view external links. ] (or another good C++ source editor)
[ Register or Signin to view external links. ]
[ Register or Signin to view external links. ]


Once you have all of that, place the IV.SCOCL file onto your desktop, and extract the contents of ScoCompiler.Zip to the root of your C:\ drive. Should be like this

[ Register or Signin to view external links. ]

Now open the IV.Scocl folder, go to projects -> stripped then open the main.vcc file to start the code editor, looks like this

[ Register or Signin to view external links. ]

The code editor will start up, it will look like this (Microsoft Visual C++)

[ Register or Signin to view external links. ]

On the right of the program, double click main.c

[ Register or Signin to view external links. ]

The main code will now show up for editing, looks like this

[ Register or Signin to view external links. ]


You can go ahead and erase these parts of the code, they aren't needed.

[ Register or Signin to view external links. ]
and
[ Register or Signin to view external links. ]




Now you are ready to make your script, but first, you need to know the functions that you can use, to find these out, in the code editor do the following

Double click the External Dependencies file to expand it
[ Register or Signin to view external links. ]
Once it has been expanded, double click the natives.h file to view all of the functions, once opened you should see all the functions appear in the code area, you can check them out, there are some pretty interesting functions in there. Once done scanning through them go back to the main.c tab.
[img][/img]

Creating a key press event
This is pretty straight forward, this will detect if the player presses a key and do something if they did.

Above the void main(void) part of the code put this exactly how it is: (Copy n Paste)

void Key(void){

}
The code you put in will be executed between the [b]{[/b] and [b]}[/b] symbols, any code outside of those will not be executed.


Now that that's done, open the next spoiler below..

Now in between those brackets, put the following code:

if (IS_GAME_KEYBOARD_KEY_JUST_PRESSED(29)){

   }
}

This function in GTA will check if a key on the keyboard was pressed and if it was, execute the code in the brackets, as you can see the (29) will refer to a key on the keyboard, you can use this site [ Register or Signin to view external links. ] to change the keys.

Making that key press actually do something

Now that you have the key press function in, you want it to do something, this example will make text appear on the user's screen as entered, in between the bracket's put this code:

PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", "I'm on your screen!", 1500, 1)

What does all that mean?
Well, it's pretty simple, the PRINT_STRING_WITH_LITERAL_STRING_NOW[b] part is a function that will print a string onto the user's screen obviously.
The [b]"STRING"
part just tells the game what kind of information to put out, obviously we're going with "STRING since we're going to be displayed a string of text.
The 1500 part just tells the game how long to display the text on the screen, 1500 = 1.5 seconds, 3000 = 3 seconds ..ect...
The 1 at the very end means whether or not to actually display onto the screen, we're leaving it at 1 for obvious reasons...


Compiling the script

Your script is finished, great, now you need to get it into SCO format for GTA, to do this simple follow this picture tutorial
Go up to the top left corner of the code editor, click File -> Save main.c as... and save it to this location: C:\ScoCompiler\ScoCompiler\Sources
[ Register or Signin to view external links. ]

Now that you have your script saved..Time to compile..

It's pretty easy to compile..Just follow this tut
Open & edit the Files.txt file like so:
[ Register or Signin to view external links. ]
Change the very last part to the name of your script..ect...myscript.c
[ Register or Signin to view external links. ]
Save and exit that file..
Run the Compile.bat to begin compiling..
If during compiling all went well, should look like this
[ Register or Signin to view external links. ]
If there was an error, it will tell you what it was and what line of your coding it was on

Now open the Output folder, and you will have your script .SCO File!



That is all for right now, I will make a tut on how to make more things in SCOCL, but at the time of the making of this tut it is 4:57 on a schoolnight so yea.


Last edited by XBLToothPik ; edited 5 times in total

The following 3 users thanked XBLToothPik for this useful post:

UptownDavontae (04-04-2012), Litecoin (04-04-2012), the_hillbilly (04-02-2012)
#2. Posted:
Principle
  • Ladder Climber
Status: Offline
Joined: Aug 25, 201113Year Member
Posts: 397
Reputation Power: 18
Status: Offline
Joined: Aug 25, 201113Year Member
Posts: 397
Reputation Power: 18
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
#3. Posted:
XBLToothPik
  • V5 Launch
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95
No one else wants to comment on whether it was good or not? Figured I would get feedback on this tutorial :/
#4. Posted:
IKnowHowToSpel
  • Junior Member
Status: Offline
Joined: Jan 14, 201212Year Member
Posts: 77
Reputation Power: 3
Status: Offline
Joined: Jan 14, 201212Year Member
Posts: 77
Reputation Power: 3
This needs to be a stiky GREAT WORK!!!
#5. Posted:
snipen108
  • Challenger
Status: Offline
Joined: Oct 10, 201014Year Member
Posts: 175
Reputation Power: 6
Status: Offline
Joined: Oct 10, 201014Year Member
Posts: 175
Reputation Power: 6
I think if you made a video on youtube you would get more reviews, other than that its a good tutorial

Good luck and keep bumping the thread it deserves to be at the top everyday
#6. Posted:
-5037-
  • Challenger
Status: Offline
Joined: Mar 09, 201212Year Member
Posts: 173
Reputation Power: 9
Status: Offline
Joined: Mar 09, 201212Year Member
Posts: 173
Reputation Power: 9
How can I combine different scrips together?
#7. Posted:
TTG-Ben
  • Ladder Climber
Status: Offline
Joined: Nov 28, 201013Year Member
Posts: 308
Reputation Power: 12
Status: Offline
Joined: Nov 28, 201013Year Member
Posts: 308
Reputation Power: 12
Get tutorial dude Keep it up!
#8. Posted:
Z61
  • TTG Fanatic
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
Great tutorial, I read it originally on your site .
#9. Posted:
Mofos
  • TTG Senior
Status: Offline
Joined: Jan 12, 201212Year Member
Posts: 1,500
Reputation Power: 75
Status: Offline
Joined: Jan 12, 201212Year Member
Posts: 1,500
Reputation Power: 75
Nice tutorial dude, i also suggest making a video version.
#10. Posted:
XBLToothPik
  • TTG Addict
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95
Status: Offline
Joined: Oct 31, 201014Year Member
Posts: 2,084
Reputation Power: 95
snipen108 wrote I think if you made a video on youtube you would get more reviews, other than that its a good tutorial

Good luck and keep bumping the thread it deserves to be at the top everyday


I plan on making a video tutorial for it as soon as I get back to my mom's hosue (where my computer and stuff is), I will make it then and edit it in this post.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.