Quantcast

Jump to content

» «
Photo

III Coding Directory

22 replies to this topic
BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#1

Posted 02 July 2011 - 03:24 PM Edited by BnB, 29 August 2012 - 10:54 AM.

user posted image


user posted image
Welcome to the III Coding Section Directory the most comprehensive directory of this section.

The point of this Directory is to sum up the most important bits of tutorials, documentation and other useful and helpful topics not only from this section but from every section related to SCM Coding. Also I wanted this to be a Guide to make learning SCM coding a bit easier by gathering up also these pieces of information.

First of all you should know that the GTA Forums Rules apply in this section too, so if you haven't read them yet you should read and follow them for your own sake. You can find them here. Into this section you should discuss about SCM Coding also you may request help about learning scripting or about fixing your code, making your script mod. You can even request script mods in the Mod Request Topic, but it is not sure that your request will be fulfilled you had better learn coding and try make it yourself and remember that you can always ask for help. Please don't post Mod releases here post them in the Mod Showroom.

Before posting make sure you are using proper grammar also you should use BB codes and use Code tags when you are posting a piece of code. Also look here for any further details. Your topics should always have proper titles which make clear to which game you refer to.

The III Coding forum led-bys (in alphabetical order): Adler, Andrew, Dutchy3010, PatrickW, spaceeinstein, Suction Testicle Man
Don't hesitate to send them a Personal Message regarding the III Coding section of the forum. You can ask for topic locks when you think your topic must be locked. Also you can request topic moves ,when you think that the topic is in the wrong section, and even Topic Title changes. But remember led-bys are humans not slaves.

user posted imageuser posted image
  • Sanny Builder by Seemann
      Sanny Builder has a very fast Compiler and Decompiler also it provides syntax highlighting and includes descriptions and solutions for all errors. Furthermore it is widely used and it supports CLEO and CLEO opcodes.
  • CLEO by Seemann & Alien
      CLEO is a tool that extends the coding possibilities in all III Era Games by adding a lot of new and useful opcodes and allowing to run the scripts without modifying the main.scm file.
In order to edit or create a script mod you need a compiler and a decompiler. There are two main compilers for this script language. The first one is Sanny Builder which is the most popular and has a lot of useful extras. The other one is Mission Builder which isn’t widely used anymore and it is abandoned. Between these two the syntax and the denotation of the data types are different, however, the result will be the same. Also, there are two other compiler GTAMA and Point, however, they are outdated and abandoned. Moreover the creators of MB, GTAMA and point have retired.

A compiler is a program that converts your source code into machine code, so the game can read it. And a decompiler is a program that performs the reverse operation.

Below there is a table that shows the syntax of each SCM editing tool.

Tools
Code Format
•GTAMA/VCDisAsm:
CODE
is_car_in_cube $car, $lowerx, $lowery, $lowerz, $upperx, $uppery, $upperz, 0


•Mission Builder:
CODE
00B1: is_car $car in_cube $lowerx $lowery $lowerz $upperx $uppery $upperz 0


•Sanny Builder:
CODE
00B1:   car $car sphere 0 in_cube_cornerA $lowerx $lowery $lowerz cornerB $upperx $uppery $upperz


•Point:
CODE
IsCarInCube ( $car, f$lowerx, $lowery, $lowerz, $upperx, $uppery, $upperz, 0 )




Which IDE/Compiler you should use


There are are a lot IDEs you can use, but most of them are outdated. However, there is one that stands out it's called Sanny Builder, which is developed by Seemann. Also, it's widely used and it has many useful features. You can find a download link below. Moreover, I have made a list with the reasons why it is the best IDE.

• It is fast
• It is widely used
• It supports CLEO library the most popular SCM extension
• It has 12 language translations (English, French, German, Spanish, Polish, Dutch, Italian, Portuguese, Russian, Finnish, Hungarian, Ukrainian)
• It is very well documented it includes two SCM tutorials, useful information and detailed help including description and solutions for all run-time error messages
• It has useful tools such as Coords Manager, Opcode search , MB > SB syntax converter and many others
• Supports all III era games (Can decompile from GTA III, GTA VC, GTA SA, GTA LCS, GTA VCS and Can compile in GTA III, GTA VC, GTA SA)
• Handles the IF statements better
• It uses color code highlighter
• Supports high-level statements (loops, conditions)
• It has a coding method with classes
• Direct hex input
• It has a wide variety of options for everything

What is SCM


SCM is a script language used in all III Era GTAs, it was named SCM by the GTA Modding community. Specifically it is used mainly in the main.scm file, where every single mission is coded. It is a script language because main.scm is not an executable file. Although most of the game features are hardcoded, still much things could be done via scripting especially with the help of CLEO library.

This is how an original mission script looked like (taken from vice city debug.sc file):
CODE

IF IS_BUTTON_PRESSED PAD2 RIGHTSHOULDER1
AND flag_create_car = 1
AND button_press_flag = 0
     IF IS_CAR_DEAD magic_car
         DELETE_CAR magic_car
     ELSE
          IF NOT IS_PLAYER_IN_CAR player magic_car
                 DELETE_CAR magic_car
      ELSE
                 MARK_CAR_AS_NO_LONGER_NEEDED magic_car
          ENDIF
     ENDIF
     flag_create_car = 0
     initial_car_selected = 0
     button_press_flag = 1
ENDIF


If you open the a scm file using a hex editor you are going to see a bunch of bytes, like the example below. A scm file is a binary file with certain structure.
CODE
00 00 50 00 01 F3 FF FF FF 01 00 04 00 9F 0A 03
00 00 0A 00 03 00 00 04 10 8D 0A 03 00 00 04 04
04 00 03 00 00 0E 00 03 00 00 01 CF FF FF FF 51
00


To edit an scm file you must decompile it. The decompiler will transform the bytes you see above into the scm code you see below. When the decompile has finished a text file containing the source code will be created.

If you decompile the code you see above using Sanny Builder you ll probably get this:

CODE
// This file was decompiled using SASCM.INI published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$E}

//-------------MAIN---------------
0000: NOP
gosub @Noname_D
wait 0

:Noname_D
0A9F: 0@ = current_thread_pointer
0@ += 16
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0@ -= -49
return


This is a part of a scm code. You can edit it using Sanny Builder or any other IDE, but Sanny Builder is highly recommended.

______________________________________________________________________________________


Here is a list that contains many tutorials and other useful topics and things to help you learn SCM Coding easier. Before you start you should know that you won't learn coding and you'll able to make your own mods in only 24 hours, but it takes time and you must have will to learn scripting. Learning SCM does not requires any knowledge of any other programming language probably because it's relatively easy and different from other languages, but having a knowledge of computer architecture would be useful especially for CLEO coding.

Tutorials
Tutorials NameAuthorProgramGameLink
CLEO Script TutorialZAZSanny BuilderSan AndreasHere
Set your own keys for script modsZAZSanny BuilderSan AndreasHere
Mission Coding for DummiesDutchy3010Sanny BuilderSan AndreasHere
Mission Coding for Pro'sDutchy3010 and PatrickWSanny BuilderSan AndreasHere
SCM/CLEO Video TutorialsDutchy3010Sanny BuilderSan AndreasHere
YeTi's SA Coding Tutorial Part OneYeTiMission BuilderSan AndreasHere
YeTi's SA Coding Tutorial Part TwoYeTiMission BuilderSan AndreasHere
Coding bible part Itomworld10Sanny BuilderSan AndreasHere
Coding bible part IItomworld10Sanny BuilderSan AndreasHere
Editing main.scm codeSan andreas masterMission BuilderSan AndreasHere
Getting extra space in main.scmRapierSanny BuilderSan AndreasHere
Stripped main.scmRapierSanny BuilderSan AndreasHere
Making your own very special savegamegtasearcherSanny BuilderSan AndreasHere
Scripting Tutorialsl3mmySanny BuilderSan AndreasHere
N00bs guide to using animsjames227ukSanny BuilderSan AndreasHere
How To Create A MissionspaceeinsteinSanny BuilderSan Andreas, Vice City, GTA IIIHere
Create A Thread in main.scmMultiple AuthorsSanny BuilderSan Andreas, Vice City, GTA IIIHere
III Era SCM SyntaxWesser-San Andreas, Vice City, GTA IIIHere
Display a float in textspaceeinsteinSanny BuilderSan Andreas, Vice City, GTA IIIHere
Math OperationsspaceeinsteinSanny BuilderSan Andreas, Vice City, GTA IIIHere
Mission PacksSeemann and Deezire-San AndreasHere
Spawn a PedspaceeinsteinSanny BuilderSan Andreas, Vice City, GTA IIIHere
Move an objectAschrattSanny BuilderSan Andreas, Vice City, GTA IIIHere
SA Memory handlingSeemannSanny BuilderSan AndreasHere
[CLEO]Some TutorialsDejiSanny BuilderSan AndreasHere
Decision MakersDejiSanny BuilderSan AndreasHere
YeTi's VC Coding Tutorial Part OneYeTiMission BuilderVice CityHere
YeTi's VC Coding Tutorial Part TwoYeTiMission BuilderVice CityHere
littleguna's Coding Tutorialtimmy2004Mission BuilderVice CityHere
How To make Marker to execute your missionkiavash2kMission BuilderVice CityHere
Y_Less's Coding TutorialY_LessMission BuilderVice CityHere
Tutorial for spookie's SCM hook (C++)XcRAny C++ CompilerVice CityHere
Text_Draw ExplanationgrovespazMission BuilderSan Andreas, Vice City, GTA IIIHere
Custom Ingame menuPatrickWMission BuilderSan AndreasHere
Tools
Tools NameAuthorGameLink
Sanny BuilderSeemannSan Andreas, Vice City, GTA III, GTA LCS, GTA VCSHere
Mission BuilderBurton WaterduckSan Andreas, Vice City, GTA IIIHere
PointjoncSan AndreasHere
VCDisAsmCyQVice CityHere
GTAMADan StrandbergGTA 3Here
CLEOSeemann and AlienSan Andreas, Vice City, GTA IIIHere
SCM Hook for San Andreasop9080San AndreasHere
SCM Hook for Vice CitySpookyVice CityHere
SA ScrDebugDejiSan AndreasHere
Useful Topics
Topic's NameGameLink
Request Mod ThreadAll III Era GTAsHere
GTA:SA OpcodesSan AndreasHere
Opcodes for Bartons Editor (GTA3 + VC)Vice City, GTA IIIHere
Documenting GTA-SA memory adressesSan AndreasHere
Documenting GTA3/VC memory adressesVice City, GTA IIIHere
SCM Coding FAQSan Andreas, Vice City, GTA IIIHere
Sanny Builder VS Mission BuilderN/AHere
Mission Coding DirectorySan Andreas, Vice City, GTA IIIHere
Tutorial Links and Mission Coding InformationSan Andreas, Vice City, GTA IIIHere
The Modders LoungeN/AHere

Other
NameGameLink
GTAG Opcode DatabaseAllHere
Deji's Opcode DatabaseAllHere
GTAModding.comAllHere
Please contribute to GTAModding.com


This topic isn't finished yet, I am going to edit the Useful Topic section soon. Post your suggestions below and let me know if I have left out something.
  • AndyGanteks likes this

fireguy109
  • fireguy109

    It's a long way to the top

  • The Connection
  • Joined: 30 Aug 2010
  • United-States

#2

Posted 02 July 2011 - 03:46 PM Edited by fireguy109, 02 July 2011 - 03:50 PM.

Good job mate. icon14.gif There's a good chance this will be pinned.

There is a little typo in the Documenting GTA-SA memory adresses entry- it should be San Andreas not San AndreasI. Fixed.

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#3

Posted 02 July 2011 - 03:52 PM

QUOTE (fireguy109 @ Saturday, Jul 2 2011, 17:46)
Good job mate. icon14.gif There's a good chance this will be pinned.

There is a little typo in the Documenting GTA-SA memory adresses entry- it should be San Andreas not San AndreasI.

Oops! My bad!

Thanks, I made this because the other was a bit outdated. Also I included tutorials form GTAModding.

AndyGanteks
  • AndyGanteks

  • The Yardies
  • Joined: 03 Jun 2005
  • Jamaica
  • Contribution Award [Sports]
    Most Skilled Player 2013
    Best Event 2013 "GTAF Gang League 2013"
    Most Valuable Player 2012
    Best Contributor [Multiplayer] 2012
    Most Valuable Player 2011
    Winner of World Cup 2010 Prediction League
    Best Event 2010 "GTAF Gang League 2010"
    Most Valuable Player 2010
    Best Team Player 2010

#4

Posted 02 July 2011 - 04:03 PM

Good job BnB, should get pinned like the guy above said!

Mista.
  • Mista.

    m'I stA

  • Members
  • Joined: 15 Jun 2009

#5

Posted 02 July 2011 - 04:06 PM

Good job mate, u did it well smile.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#6

Posted 02 July 2011 - 04:29 PM

Nice work, this should be pėnned.

Th3MaN1
  • Th3MaN1

    Gangsta

  • Members
  • Joined: 24 Apr 2011
  • Romania

#7

Posted 02 July 2011 - 04:42 PM

Yep,should be pinned.Good work!

The Yokel
  • The Yokel

    True Gentleman

  • The Yardies
  • Joined: 30 Mar 2007
  • Jamaica

#8

Posted 02 July 2011 - 05:07 PM

'Tis good.

Adler
  • Adler

    Hello, Smith. ( ´-`)ノ

  • Leone Family Mafia
  • Joined: 25 Jul 2009
  • None

#9

Posted 02 July 2011 - 05:16 PM Edited by Adler, 13 November 2011 - 11:31 PM.

QUOTE (fireguy109 @ Saturday, Jul 2 2011, 07:46)
Good job mate. icon14.gif There's a good chance this will be pinned.

There is a little typo in the Documenting GTA-SA memory adresses entry- it should be San Andreas not San AndreasI. Fixed.

Pinned!

EDIT - The following topics have been unpinned:

Mission Coding Directory (by DexX)
Tutorial Links and Mission Coding Information (by sleeper777)

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#10

Posted 05 July 2011 - 11:41 AM Edited by Adler, 13 July 2011 - 05:37 PM.

I updated it a bit. Aslo I am going to add some small tutorials.

Title updated by request. - Adler

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#11

Posted 15 July 2011 - 10:33 AM

Sorry for the double post but I had to do it.
This pobably the biggest and the last update.....

AndyGanteks
  • AndyGanteks

  • The Yardies
  • Joined: 03 Jun 2005
  • Jamaica
  • Contribution Award [Sports]
    Most Skilled Player 2013
    Best Event 2013 "GTAF Gang League 2013"
    Most Valuable Player 2012
    Best Contributor [Multiplayer] 2012
    Most Valuable Player 2011
    Winner of World Cup 2010 Prediction League
    Best Event 2010 "GTAF Gang League 2010"
    Most Valuable Player 2010
    Best Team Player 2010

#12

Posted 15 July 2011 - 10:38 AM

Seriously man, good job man on keeping track and making this huge topic! Keep it updated always, hopefully they reward you for it somehow. icon14.gif

miromiro
  • miromiro

    Time Killa™

  • Zaibatsu
  • Joined: 26 Nov 2009
  • None
  • GTANet Contribution Award [Newbie Guide]
    Most Improved 2010

#13

Posted 15 July 2011 - 12:58 PM

Very good topic, I've got to say. Nicely explained, and the links are useful. Not that I'd be into modding but it's still awesome.
I do agree with Andy, you should get some kind of reward for all the work put into this topic and for all your massive contributions to the GTA Modding community in general. Keep it up. icon14.gif

Adler
  • Adler

    Hello, Smith. ( ´-`)ノ

  • Leone Family Mafia
  • Joined: 25 Jul 2009
  • None

#14

Posted 16 July 2011 - 12:07 AM

QUOTE (BnB @ Saturday, Jul 2 2011, 07:24)
But remember led-bys are humans not slaves.

I'm totally recommending you for a commendation heehee. icon14.gif

Tommy.
  • Tommy.

    MUFC. #Glazersout

  • The Yardies
  • Joined: 01 May 2011
  • None
  • Most Knowledgeable [Sports] 2013

#15

Posted 16 July 2011 - 10:09 PM

Good job BnB and congrats on the medal icon14.gif

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#16

Posted 05 March 2012 - 03:45 PM

I added a few new sections and corrected some things.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#17

Posted 07 March 2012 - 02:39 PM

Check my sig. The link to Deji's Opcode Database is wrong tounge2.gif

BnB
  • BnB

    #OGAY_2014

  • The Yardies
  • Joined: 28 Jun 2010
  • Greece

#18

Posted 07 March 2012 - 02:55 PM

QUOTE (Deji @ Wednesday, Mar 7 2012, 16:39)
Check my sig. The link to Deji's Opcode Database is wrong tounge2.gif

Sorry for the inconvenience. ph34r.gif

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci Racing
  • Joined: 24 Dec 2007
  • None

#19

Posted 07 March 2012 - 03:02 PM

QUOTE (BnB @ Wednesday, Mar 7 2012, 14:55)
QUOTE (Deji @ Wednesday, Mar 7 2012, 16:39)
Check my sig. The link to Deji's Opcode Database is wrong tounge2.gif

Sorry for the inconvenience. ph34r.gif

lol... no prob, I just found it amusing tounge.gif

TLFdjobaw
  • TLFdjobaw

    What?

  • Members
  • Joined: 20 Jan 2012
  • None

#20

Posted 21 June 2012 - 12:37 PM

hey guys... i read and learned some tutorials but i still not understand...
can you make an tutorials for making a cheat to spawn some weapons?? confused.gif
please.. sad.gif because i need it!
i just try make script like this:
CODE

//-------------MAIN---------------
thread 'VIB'
16@ = 0
33@ = 0

:VIB_25
wait 20
if
  Player.Defined($PLAYER_CHAR)
else_jump @VIB_25
if and
  Player.Controllable($PLAYER_CHAR)
  not Actor.Driving($PLAYER_ACTOR)
else_jump @VIB_25
if
0AB0:   key_pressed 71
else_jump @VIB_95
16@ = 1
33@ = 0

:VIB_95
if and
 16@ == 1
0AB0:   key_pressed 85
else_jump @VIB_131
16@ = 2
33@ = 0

:VIB_131
if and
 16@ == 2
0AB0:   key_pressed 78
else_jump @VIB_167
16@ = 0
jump @VIB_200

:VIB_167
if
 33@ > 5000
else_jump @VIB_25
16@ = 0
jump @VIB_25

:VIB_200
16@ = 0
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.2
1@ -= 2.5
2@ += 0.5
6@ = 1.0
0@ = 20.0

:VIB_276
wait 50
if
  Player.Defined($PLAYER_CHAR)
else_jump @VIB_276
if
 25 > 16@
else_jump @VIB_724
02F6: 4@ = sine 0@ // (float)
02F7: 5@ = cosine 0@ // (float)
006B: 4@ *= 6@ // (float)
006B: 5@ *= 6@ // (float)
005B: 1@ += 4@ // (float)
005B: 2@ += 5@ // (float)
wait 0
0871: init_jump_table 16@ total_jumps 12 default_jump 0 @VIB_433 jumps 0 @VIB_440 1 @VIB_466 2 @VIB_492 3 @VIB_518 4 @VIB_544 5 @VIB_570 6 @VIB_596 7 @VIB_625

:VIB_433
jump @VIB_700

:VIB_440
7@ = Pickup.Create(#ARMOUR, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_466
8@ = Pickup.Create(#GUN_PARA, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_492
9@ = Pickup.Create(#BRASSKNUCKLE, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_518
10@ = Pickup.Create(#GUN_VIBE1, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_544
11@ = Pickup.Create(#GUN_VIBE2, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_570
12@ = Pickup.Create(#GUN_DILDO1, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_596
13@ = Pickup.Create(#GUN_DILDO2, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_625
14@ = Pickup.Create(#JETPACK, 15, 1@, 2@, 3@)
jump @VIB_700                

:VIB_654
19@ = Pickup.Create(1240, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_683
20@ = Pickup.Create(1242, 15, 1@, 2@, 3@)
jump @VIB_700

:VIB_700
0@ += 20.0
16@ += 1
jump @VIB_276

:VIB_724
Player.CanMove($PLAYER_CHAR) = True
16@ = 0
33@ = 0

:VIB_745
wait 0
if
  Player.Defined($PLAYER_CHAR)
else_jump @VIB_784
if
 33@ > 25000
else_jump @VIB_745

:VIB_784
Pickup.Destroy(7@)
Pickup.Destroy(8@)
Pickup.Destroy(9@)
Pickup.Destroy(10@)
Pickup.Destroy(11@)
Pickup.Destroy(12@)
Pickup.Destroy(13@)
Pickup.Destroy(14@)
jump @VIB_25

but when i start the game.. and try the script.. the weapons doesnt appear??
how to fix it?? confused.gif help me please

Prometheus
  • Prometheus

  • Moderator
  • Joined: 18 Apr 2011
  • None

#21

Posted 21 June 2012 - 12:39 PM

@TLFdjobaw: It's better to make a new topic about that, so as to get more help. smile.gif

ESMODESTO
  • ESMODESTO

    Player Hater

  • Members
  • Joined: 21 Aug 2007

#22

Posted 01 January 2014 - 10:26 PM

Hey every body,Happy New Year! well I have a question.You know in Las Venturas when you are in debt,the guy you owe has people that come and find you and try to shoot? Well does any body know the code for that? I want it to be like that in every city in San Andreas that way its like you always gotta watch your back it kind of makes the game more fun! if theres already a mod for it let me know please or if you know anything about the code hit me up! Thanks in Advance.


ScatterBox
  • ScatterBox

    Lost in Los Santos

  • Members
  • Joined: 24 Feb 2014
  • United-States

#23

Posted 10 March 2014 - 02:00 PM

Sorry for the bump, but is it possible to compile LCS/VCS?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users