Quantcast

Jump to content

» «
Photo

SCM Coding FAQ

52 replies to this topic
Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#1

Posted 24 March 2009 - 10:43 PM Edited by Dutchy3010, 24 August 2009 - 03:52 PM.

SCM Coding FAQ
Frequently Asked Questions


General

I want to learn coding, what do I have to do?
First notice that you don't learn coding within 24 hours, you have to put time and effort in it. There are several tutorials which can help you learning coding, best tutorial is the Coding Bible (Part I and Part II).

I want to make my own missions, how can I do that?
If you want to do it by coding, so not using other mods (like Design Your Own Mission), you can try this tutorial.

Who wants to code my ideas?
First, there is a thread for this kind of topics. You can find it here. But don't have high hopes, because most likely your idea won't be coded, because it takes a lot of time to make a scm script. When you desperately want something to be coded, I advise you to learn coding yourself.

What is CLEO?
CLEO contains several things:
  • Custom scripts: with these scripts the user doesn't have to start new game.
  • New opcodes
  • Plugins
More about CLEO
CLEO Tutorial

I want to have two .scm mods at the same time!
Most likely, this is not easy. You can use them seperate by using MPACK. More then one CLEO-script is possible, but only if they don't have a conflict.

Which software do I need to edit the main.scm?
There are two major programs for this: SannyBuilder and Mission Builder.

Can I use SCM coding for GTA IV modding?
No, it is a different language. However, you can use the knowledge of scm, because the III-era opcodes look a lot like the functions in IV scripting.

No, but you CAN use the knowledge of how mission scripts are put together and what most of the opcodes do (save a few extra parameters here and there) to help in creating scripts for IV


SannyBuilder errors

I'm getting an error in SannyBuilder: not enough actual parameters!
There are too few parameters in this opcode. Look at an example of the opcode, so you can compare it. Also check if there nee to be commas or not, this is a common mistake. For example:
CODE
0100:   actor $PLAYER_ACTOR in_sphere 1793.068, -1904.254, 12.3989 radius 4.0 4.0 4.0 sphere 1 in_car

This is wrong, because the commas should not be in there.

Compiler error: "Label 'loop' redeclared."
This means that you are jumping to a label whose name is twice used in the code.

Compiler error: "Incorrect number of conditions, 9 max".
Most likely you will have a loop which contains only one condition, but you said "if or". For example:
CODE
:MODEL_LOAD
if or
8248: not model #NRG500 available
else_jump @MODEL_LOAD


I have another error, what do I have to do?
Use the SannyBuilder explanations: select help when you get the error.

Animation


Ingame errors

The game freezes, I can't do anything with my PC!
This is a very frequent bug: you forgot a wait somewhere in your code. Any loop in your code should at least 1 wait opcode. I will advise you to play SA in a window, then you can stop it with CTRL-ALT-DELETE.
Another solution is to run this program: http://tjbp.net/uplo...A_SA_Killer.zip. Simply press F7 and gta_sa.exe is killed.

Help! My game crashes!
Sadlye, there isn't a clear answer for this, but you can do something. First, you have to see when it crashes. When the game starts? When there is a condition true? This way you can exclude parts of the code, so looking for the mistake will be easier. Then, when you know which part causes the crash, you have to eliminate possible wrong opcodes. Just put // before it, and test again. If the game doesn't crash, you know which opcode contains the fault. Then you have to find out what is wrong about this opcode. There is also an CLEO add-on (SCMLOG.cleo), which logs the opcodes, so you can see which opcode was the last one before the crash.
When you don't find the problem, you can post it this forum. Be sure you are doing the following things:
1. Make a topictitle which refer to your problem.
2. Describe what the fault is.
3. Post your code, and mark which code is causing the problem. Otherwise people aren't willing to check your code.
4. Add scmlog.log to the post.
5. Give all possible information about the script/problem.

Nothing happens ingame!
This surely is too little information. This could happen when you forgot to compile, this can also happen because your code is stuck in a loop, due to some coding mistake.


Coding

I can't find an opcode...
Use the opcode search tool (Tools > Ide tools > Opcode search or CTRL+ALT+2), or typ a word/opcode in SannyBuilder and press (repeatedly) F1.

What is the difference between Player_Char and player_Actor?
$Player_Char: Used with opcodes that you can only use for the player (like 0109: player $PLAYER_CHAR money += 1000000)
$Player_Actor: Used with opcodes that you can use for all actors (like 00A1: put_actor $PLAYER_ACTOR at 345.5621 306.2212 998.4484)

Is there a difference between editing the main.scm of SA and VC?
Yes there are many things added in SA, like external scripts and some opcodes and constructs.

Where can I find the object ID's?
You can use Mapviewer or MapEditor for that.
If you know the model name, you can find the object by using CTRL+ALT+H in SannyBuilder. You can also take a look at this site

Where can I find the model-names of pedestrians, weapons and vehicles?
For pedestrians you can use Ped Editor. For pictures of all peds you can look here.
For Vice City you can look here.

For weapons you can look in the help-files of SannyBuilder (SCM Documentation > GTA SA > Weapon Numbers).

For vehicles you can open vehicles.ide, located in the data folder (Program Files\Rockstar Games\GTA San Andreas\Data), or take a look at this site. It is also possible to use this tool.

Why isn't my FXT text showing up?
Either you named it too long or you could have had two spaces between the second part of the line instead of one or you have a space at the end

GXT editor to edit american.gxt
I use Hammers SAgxtEditor. Version 1.3 was the latest and cant be found on famous download pages. Its still available at thegtaplace.

All gxt name entries are numbers by default. It needs to inject an ini-file to inject the entrynames. Hammer posted one but its disappeared. Get the ini here: http://zazmahall.de/...merican_ini.zip

Then click on search icon (field glas) and choose "String List Match", a window opens. click on Open, change in open screen the file extension to "ALL FILES *.*" Open then american.ini, confirm with OK. But it injects not all, only the half. But you can also inject it manual. Maybe you found IE10 in main.scm. Sso use search function(click on field glasses) of gxtEditor and search for IE10. You will find the injected entry and the text for displaying also.

Note: there are 2 different search functions:
"Find Name" means: search for exact entry of main.scm or exe like fem_ok
"Find Value" means: search for any word of the text

Important: if you have changed text so click first on an other entry before you save the file

In addition there was made a complete translation of american.gxt as textfile from AleX AciD.
Dont know where it can be downloadable
I uploade it at rapidshare:
http://rapidshare.co...A_text.txt.html

GXT texts for all supported games can be found in the Sanny Builder\help\GXT Strings folder.

How can I get coord ingame?
You can use this tool or the coords tool in Sanny Builder.

How can I change the keys used in a mod?
Take a look at this topic.

CLEO
(written by James227uk)

Game crashes when opening gta_sa.exe
This is related to your EXE being incompatible. Download this EXE:

http://public.sannyb...idb/compact.rar

Password to archive is CVehicle

(Note: C and V MUST be in caps)

Game crashes on loading bar
One of your scripts is not working when the game loads. Try deleting the script you most recently added. If it still crashes remove all your scripts and try the game. If it still crashes it's not the scripts that's the problem. You've modded another file and that is causing the crash. If it doesn't crash now, try adding each of your scripts back one by one. When the game crashes, remove the script you just added.

Game crashes when pressing appropriate key
The script you have added is causing the crash. Something is wrong with the script code after the keypress. Consider telling the script author in the topic or by PM if possible.

Game crashes when in an area
There are 2 reasons for this. Either something is wrong with the script, or there is something sort of conflict between this script and another. Try removing all but this script and see if it still crashes. If it doesn't, there is a conflict. If it does consider writing to the mod author


Corrections and additions are appreciated.


Thanks to:
  • PatrickW
  • Seemann
  • ZAZ
  • goin-god
  • james227uk
  • ceedj
Last update:
  • cyrilaeshell, maoffense01 and HardluckStyle like this

coin-god
  • coin-god

    High Roller

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

#2

Posted 24 March 2009 - 11:10 PM

Good work with this FAQ. icon14.gif
Hopefully we will have less stupid posts in here.

When i code i use a little application in the background, which i can use if my game crashes, simple i press F7 and gta_sa.exe is killed.

You may want to add it to your FAQ:
http://tjbp.net/uplo...A_SA_Killer.zip
Its very usefull.

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#3

Posted 24 March 2009 - 11:17 PM

Nice find, I will add it in the faq. icon14.gif

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2013 "Sanny Builder"
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#4

Posted 25 March 2009 - 10:04 AM

QUOTE (Dutchy3010 @ Mar 25 2009, 06:43)
SannyBuilder errors

Sanny Builder also gives possible solutions for each error. They can be read when you click the Help button on the error message window.

View animation, 317 Kb
  • cyrilaeshell likes this

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#5

Posted 25 March 2009 - 10:12 AM

Added. icon14.gif

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2013 "Sanny Builder"
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#6

Posted 25 March 2009 - 10:33 AM Edited by Seemann, 25 March 2009 - 10:41 AM.

QUOTE (Dutchy3010 @ Mar 25 2009, 06:43)
Where can I find the model-names of pedestrians, weapons and vehicles?
For pedestrians you can use Ped Editor.
For weapons you can look in the help-files of SannyBuilder (SCM Documentation > GTA SA > Weapon Numbers).
For vehicles you can open vehicles.ide, located in the data folder (Program Files\Rockstar Games\GTA San Andreas\Data).



Also you can see screenshots of all SA vehicles/actors there:
http://wiki.sa-mp.co...ki/Vehicles:All
http://www.gtatools....les&site=sapeds
For VC I've uploaded collection of screenshots of actors there:
http://public.sannyb...r.com/vc_actors
(those were made by spinnie I believe, not by me)

QUOTE (Dutchy3010 @ Mar 25 2009, 06:43)
Where can I find the object ID's?
You can use Mapviewer or MapEditor for that.

Also Ctrl+Alt+H feature in SB and
http://wiki.sa-mp.co..._Object_ID_List
  • TheBMXMega likes this

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#7

Posted 25 March 2009 - 10:47 AM

Thanks for the additions, added. blush.gif
  • TheBMXMega likes this

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#8

Posted 25 March 2009 - 07:22 PM Edited by ZAZ, 25 March 2009 - 07:37 PM.

Good topic. smile.gif
  • TheBMXMega likes this

Seemann
  • Seemann

    Ruhe

  • GTA Mods Staff
  • Joined: 03 Sep 2004
  • Russia
  • Best Tool 2013 "Sanny Builder"
    Contribution Award [Mods]
    Helpfulness Awards [Mods]

#9

Posted 25 March 2009 - 08:13 PM Edited by Seemann, 26 March 2009 - 05:57 AM.

GXT texts for all supported games can be found in the Sanny Builder\help\GXT Strings folder. An the SA's list of GXT entries wasn't made by sleeper (he just hosted it), the actual creator of it is AleX AciD.

!
Dont want to make a new post, but Dutchy, your link to the Coding Bible part 2 is directing to the part 1.

Can this FAQ also be copied to the GTAModding Wiki so we could easily add / fix stuff in it without bothering you? wink.gif
  • TheBMXMega likes this

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#10

Posted 25 March 2009 - 10:08 PM

QUOTE (Seemann @ Mar 25 2009, 20:13)
GXT texts for all supported games can be found in the Sanny Builder\help\GXT Strings folder. An the SA's list of GXT entries wasn't made by sleeper (he just hosted it), the actual creator of it is AleX AciD.

thx, now I remember where I saw it
at first i found it in the sig of sleeper

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#11

Posted 28 March 2009 - 12:00 AM

QUOTE (Seemann @ Mar 25 2009, 21:13)
Dont want to make a new post, but Dutchy, your link to the Coding Bible part 2 is directing to the part 1.

Can this FAQ also be copied to the GTAModding Wiki so we could easily add / fix stuff in it without bothering you? wink.gif

Well, that isn't very clever, I will change it.

Of course you can add it. smile.gif

NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Best Conversion 2014 [ViIV for GTANY]
    Most Knowledgeable [Tech] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Contribution Award [Mods]

#12

Posted 28 March 2009 - 08:11 AM

For the fullscreen script thread hang, you can also solve it by using Windows key + L, waiting for the screen to lock, unlock the screen, press Ctrl+Shift+Escape, select gta_sa.exe from Processes, and End Process -- it's annoying, but saves having to reboot smile.gif

coin-god
  • coin-god

    High Roller

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

#13

Posted 30 March 2009 - 01:27 AM

QUOTE (NTAuthority @ Mar 28 2009, 05:11)
For the fullscreen script thread hang, you can also solve it by using Windows key + L, waiting for the screen to lock, unlock the screen, press Ctrl+Shift+Escape, select gta_sa.exe from Processes, and End Process -- it's annoying, but saves having to reboot smile.gif

Thanks for the tip, i will do that with Vice and other games. smile.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#14

Posted 05 April 2009 - 03:47 PM

One more theme for faq:
Set your own keys for script mods with Sannybuilder

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#15

Posted 05 April 2009 - 03:50 PM

QUOTE (ZAZ @ Apr 5 2009, 16:47)
One more theme for faq:
Set your own keys for script mods with Sannybuilder

Added! Good work on that "tutorial". icon14.gif

trickstar34
  • trickstar34

    ATM, Money

  • BUSTED!
  • Joined: 14 Dec 2008

#16

Posted 07 July 2009 - 08:38 AM Edited by trickstar34, 07 July 2009 - 10:13 AM.

Game crashes in an area could also mean you either removed a car's model or replaced it with one that the game doesn't support and there is a spawn location in that area for it.

Another thing you could add to the faq is
Q. Why isn't my FXT text showing up?
A. Either you named it too long or you could have had two spaces between the second part of the line instead of one or you have a space at the end

Q. Why aren't my numbers working for my FXT/GXT entry?
A. Either the opcode you used don't support numbers or you didn't use the ~1~ dummy, representing a number.

Dutchy3010
  • Dutchy3010

    Female SCM coder!

  • Moderator
  • Joined: 30 Jul 2006
  • Netherlands
  • Best Script 2013 [DYOM]
    Best Script 2012 [DYOM]

#17

Posted 07 July 2009 - 09:51 AM

First: there are thousands of reasons why it could crash when you are in a particular area. Yours is an example of what I said in the FAQ.
Second: true! Added!
Third: again, there are also other reasons why it shouldn't work.

trickstar34
  • trickstar34

    ATM, Money

  • BUSTED!
  • Joined: 14 Dec 2008

#18

Posted 07 July 2009 - 10:01 AM Edited by trickstar34, 07 July 2009 - 01:44 PM.

Q. How do I make cutscenes?
A. Well, you can do basic cutscenes, but sadly you can't make ones as good as Rockstar, read the cutscene tutorial in Mission Coding for Dummies.

bozghaleh
  • bozghaleh

    Player Hater

  • Members
  • Joined: 14 Jul 2009

#19

Posted 14 July 2009 - 11:39 PM

QUOTE
Game crashes when opening gta_sa.exe
This is related to your EXE being incompatible. Download this EXE:

http://public.sannyb...idb/compact.rar

Password to archive is CVehicle

(Note: C and V MUST be in caps)


i downloaded this EXE, but the problem still persists: when i start it, it immediately crashes. the only mod/script i have for CLEO is a speedometer, and i have checked 3 times already that i have correctly installed it

trickstar34
  • trickstar34

    ATM, Money

  • BUSTED!
  • Joined: 14 Dec 2008

#20

Posted 14 July 2009 - 11:43 PM

This is a FAQ, not a troubleshooting topic, so post a topic either in Mission Coding forums or the Troubleshooting forums and we'll help you there.

DJ-Print3
  • DJ-Print3

    Player Hater

  • Members
  • Joined: 15 Feb 2009

#21

Posted 24 August 2009 - 11:36 AM

i install the compact file but it says the vorbisfile.dll was not found sad.gif



Can any one help me! suicidal.gif

archey
  • archey

    Thug

  • Members
  • Joined: 18 Oct 2008

#22

Posted 01 November 2009 - 07:53 AM

If its okay for me to add. Another way to kill the process of any game/program(Vice, III, ect).

1. Create a shortcut on your desktop(right click, select New ShortCut) then in browse type in:

CODE
taskkill.exe /IM GTA_sa.exe


2. Click Next, and Choose a name.

3. Go back to your desktop, right click the shortcut.

4. Choose Properties

5. Two Lines under Target you'll see and input box saying Shortcut Key

6. Click inside it, and hit the key you want(F7, F2, Ect)

7. Choose Apply, Choose Okay.

And there you have it your own process killer, great when the game crashes/freezes, save a reboot.

ghost of delete key
  • ghost of delete key

    chrome vanadium

  • The Connection
  • Joined: 27 Dec 2003
  • United-States

#23

Posted 19 January 2010 - 12:19 PM

The link for AleX AciD's american.gxt
http://rapidshare.co...A_text.txt.html

is dead.

Please, rapidshare is teh suk. colgate.gif
I'm sure there are more durable places to host this, no?
icon14.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#24

Posted 19 January 2010 - 04:04 PM

QUOTE (ghost of delete key @ Jan 19 2010, 12:19)
The link for AleX AciD's american.gxt
http://rapidshare.co...A_text.txt.html

is dead.

Please, rapidshare is teh suk. colgate.gif
I'm sure there are more durable places to host this, no?
icon14.gif

Seemann allready gave the answer
QUOTE (Seemann @ Mar 25 2009, 20:13)
GXT texts for all supported games can be found in the Sanny Builder\help\GXT Strings folder. An the SA's list of GXT entries wasn't made by sleeper (he just hosted it), the actual creator of it is AleX AciD.

unpenitrible
  • unpenitrible

    Rion James

  • Members
  • Joined: 07 Feb 2010

#25

Posted 07 February 2010 - 07:22 PM

Can someone upload the exe fix to another site? sannys is down sad.gif suicidal.gif cryani.gif

unpenitrible
  • unpenitrible

    Rion James

  • Members
  • Joined: 07 Feb 2010

#26

Posted 09 February 2010 - 11:22 PM

HOW DO I INSTALL THE EXE FIX? WHERE? HOW? WHAT? !~!!!! suicidal.gif

Junior.
  • Junior.

    All you had to do was follow the damn train...

  • Members
  • Joined: 12 Jan 2010
  • Brazil

#27

Posted 15 March 2010 - 05:02 PM

how to decompile/compile gta3 main.scm in sanny builder?

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#28

Posted 15 March 2010 - 05:42 PM

QUOTE (Junior123456789 @ Mar 15 2010, 17:02)
how to decompile/compile gta3 main.scm in sanny builder?

Click in the right lower corner of sannybuilder on to the game icon
a tiny poup menue appears, choose gta3
user posted image

The go to options; Programms>Options>General
Insert there the path to game directory

then open gta3 main.scm

gtafan113
  • gtafan113

    Untitled

  • Members
  • Joined: 01 Mar 2009

#29

Posted 12 April 2010 - 04:02 AM

What works for me, is when my game freezes, I simply press ctrl + alt + delete and then just end the gta sa process through task manager.

james227uk
  • james227uk

    One Spartan Army

  • Andolini Mafia Family
  • Joined: 05 Feb 2008

#30

Posted 14 April 2010 - 06:47 PM

Which is what most people do




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users