Quantcast

Jump to content

» «
Photo

Editing main.scm code

23 replies to this topic
San andreas master
  • San andreas master

    .:%$Catonic$%:.

  • BUSTED!
  • Joined: 28 Dec 2004

#1

Posted 02 August 2005 - 08:51 AM Edited by Gangsta Killa, 24 April 2009 - 11:44 PM.


S.A.M Screenshot tutorial



    Hey,
    this is a thread for noob scripters in SA. If you are experiencing difficulty adding someone else's mission code into your main.scm follow this simple tutorial.
    (NOTE THIS IS FOR MOST CODES NOT ALL) But i can update via request.



  • Step 1. You will need to be prepared and have bartons mission builder as well as the code/source
  • Step 2. Open your main.scm using bartons mission builder
  • Step 3. Here is where youll need to post your create thread (eg.004F: create_thread ��mymod)
    user posted image
  • Step 4. This is where i recommend you put the actual code, its right near the top and easy to find

    user posted image
  • Step 5. Click run then compile:)
    user posted image
    colgate.gif
  • Step 6. close bartons mission builder and go into its folder, then copy the main scm file that is in it into the date/script folder


  • FIXES


If you encounter the error:
user posted image
You will need to edit the define memory (at the top of the main.scm file) to what it says in the information box that will come up so from the above to pic to this:
user posted image

If you entounter something that says "label not found" or something like that then do this:


I received this error when compiling the mod scm: "Label not found: LABEL019B18"

I then searched for this string in the code and found this:

CODE
:BBALL_586
00D6: if 21
09CC: object @0 model_is #BSKBALL_LAX
09CC: object @0 model_is #VGSXREFBBALLNET
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1921 == 0;; integer values
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1016 == 0;; integer values
004D: jump_if_false £BBALL_602
00D6: if 0
00E1: key_pressed 0 19
004D: jump_if_false £BBALL_601
0004: $1016 = 1;; integer values
004F: create_thread ££Label019B18 @0 <-here's our string



I then searched the original scm for ":BBALL_586" and found this:

CODE
:BBALL_586
00D6: if 21
09CC: object @0 model_is #BSKBALL_LAX
09CC: object @0 model_is #VGSXREFBBALLNET
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1921 == 0;; integer values
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1016 == 0;; integer values
004D: jump_if_false £BBALL_602
00D6: if 0
00E1: key_pressed 0 19
004D: jump_if_false £BBALL_601
0004: $1016 = 1;; integer values
004F: create_thread ££BBCHAL_1 @0 <---THIS LINE IS DIFFERENT


so I then replaced "Label019B18" with "BBCHAL_1" in the mod scm
(you'll want to use the find&replace method while starting at the very top)

Tried to recompile and received this error: "Label not found: BBCHAL_1"

I then referenced the original code to find out what BBCHAL_1 is and where, and found this:

CODE
:PROJECT_237
004E: end_thread

:BBCHAL_1
03A4: name_thread 'BBCHAL'
0006: @19 = 0;; integer values




So I then searched the mod scm for ":Project_237" and found something interesting:
QUOTE

CODE
:PROJECT_237
004E: end_thread
03A4: name_thread 'BBCHAL'
0006: @19 = 0;; integer values


IT'S A BUG!! AAHHHH!!

I then changed it to match the original:


CODE
:PROJECT_237
004E: end_thread

:BBCHAL_1 <-- the builder forgot this line
03A4: name_thread 'BBCHAL'



This fix contributed by "Bigun".



After compiling again I then received this error: "Label not found: LABEL0193A4"

It's a DIFFERENT label... Noticing a trend here..

After doing the same thing for this I only noticed a couple that were 'bugged' like the "BBCHAL_1", the rest just needed the label0... replaced with whatever the original scm has.

ask if you want any other screenies or need any help or queries feel free to ask
Regards S.A.M

brotherbozar
  • brotherbozar

    Rat

  • Members
  • Joined: 16 Jul 2005

#2

Posted 02 August 2005 - 03:35 PM

Sweet tutoral.

Many people ask how to do this, I've asked several times with no luck so Thanks San Andreas Master!

San andreas master
  • San andreas master

    .:%$Catonic$%:.

  • BUSTED!
  • Joined: 28 Dec 2004

#3

Posted 03 August 2005 - 06:51 AM

thats alright mate, let me know if you experience any further difficulty biggrin.gif

justa_newbie
  • justa_newbie

    Square Civilian

  • Members
  • Joined: 31 Jul 2005

#4

Posted 03 August 2005 - 05:49 PM

Sweet! Just what I was wondering. smile.gif

Thanks for posting this, San andreas master.



justa_newbie

Kill3r
  • Kill3r

    Die Balla Fools!

  • Members
  • Joined: 27 Jul 2005

#5

Posted 03 August 2005 - 09:57 PM

This is my problem. Sometimes I get these errors like not enough defined memory or something to that effect or Label so and so not found. This is what I need help with. cry.gif

San andreas master
  • San andreas master

    .:%$Catonic$%:.

  • BUSTED!
  • Joined: 28 Dec 2004

#6

Posted 04 August 2005 - 06:29 AM

if this occur replace the scm your editing with a backup then it should work:)

Bigun
  • Bigun

    wandering about

  • Members
  • Joined: 10 Jul 2004

#7

Posted 04 August 2005 - 11:20 AM

QUOTE (Kill3r @ Aug 3 2005, 21:57)
This is my problem. Sometimes I get these errors like not enough defined memory or something to that effect or Label so and so not found. This is what I need help with. cry.gif

Both are pretty easy to fix, no need to revert to a backup. On the not enough defined memory one, MB tells you in the error box what you should set the memory to. Then, go to the very top of the file and change
CODE
DEFINE MEMORY 0000

According to the number it tells you, so if it tells you 4409 you simply put...
CODE
DEFINE MEMORY 4409


On the label not found, it tells you WHAT label isn't found. CTRL+F that label, if it tells you:
'Label Xoo not found'
CTRL+F:
CODE
£Xoo

Now it will bring you to the code which jumps, or does anything with that 'label'. Most of the time it will be a typo, like
(freestyle)
CODE

:LabelA
wait 100 ms
if 0
key pressed 0 X
jump_if_false ££LabelA
request_model #NRG500

:LabelB
if 0
model #NRG500 available
jump_if_false ££LabelB
create_car #NRG500 at X Y Z angle X
jump ££Label     <-- This should be ££LabelA

Now just correct the label to what you think it should be and yer pretty much done..

San andreas master
  • San andreas master

    .:%$Catonic$%:.

  • BUSTED!
  • Joined: 28 Dec 2004

#8

Posted 05 August 2005 - 07:46 AM

updated, i added a new segment for fixes biggrin.gif

brotherbozar
  • brotherbozar

    Rat

  • Members
  • Joined: 16 Jul 2005

#9

Posted 05 August 2005 - 07:58 PM

About the 'Label not found...' error when trying to compile an scm.
Thanks to the person who posted this, i can't remember their name but this is copied and pasted from their thread:

QUOTE:

It requires de-bugging the code. I am not fluent in the programming language used in the scripts, but I was able to figure it out, so it shouldn't be too difficult

First off, I got the ££LABEL0... error like everyone else was getting, but I wasn't satisfied with giving up. I figured the most logical thing would be to compare the code with that of the original main.scm that comes with the game. When compairing I noticed something:

When the script was decompiled it replaced some of the variables with generic ones (i.e. ££LABEL012345.. instead of ££BBCHAL_1 or whatever)

To keep this easy i will walk you through fixing the 'opened up' mod (partially, as it is a long process, about 30 minutes or so for me)

I received this error when compiling the mod scm: "Label not found: LABEL019B18"

I then searched for this string in the code and found this:
QUOTE

:BBALL_586
00D6: if 21
09CC: object @0 model_is #BSKBALL_LAX
09CC: object @0 model_is #VGSXREFBBALLNET
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1921 == 0 ;; integer values
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1016 == 0 ;; integer values
004D: jump_if_false £BBALL_602
00D6: if 0
00E1: key_pressed 0 19
004D: jump_if_false £BBALL_601
0004: $1016 = 1 ;; integer values
004F: create_thread ££Label019B18 @0 <-here's our string


I then searched the original scm for ":BBALL_586" and found this:
QUOTE

:BBALL_586
00D6: if 21
09CC: object @0 model_is #BSKBALL_LAX
09CC: object @0 model_is #VGSXREFBBALLNET
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1921 == 0 ;; integer values
004D: jump_if_false £BBALL_606
00D6: if 0
0038: $1016 == 0 ;; integer values
004D: jump_if_false £BBALL_602
00D6: if 0
00E1: key_pressed 0 19
004D: jump_if_false £BBALL_601
0004: $1016 = 1 ;; integer values
004F: create_thread ££BBCHAL_1 @0 <---THIS LINE IS DIFFERENT


so I then replaced "Label019B18" with "BBCHAL_1" in the mod scm
(you'll want to use the find&replace method while starting at the very top)

Tried to recompile and received this error: "Label not found: BBCHAL_1"

I then referenced the original code to find out what BBCHAL_1 is and where, and found this:

QUOTE

:PROJECT_237
004E: end_thread

:BBCHAL_1
03A4: name_thread 'BBCHAL'
0006: @19 = 0 ;; integer values



So I then searched the mod scm for ":Project_237" and found something interesting:
QUOTE

:PROJECT_237
004E: end_thread
03A4: name_thread 'BBCHAL'
0006: @19 = 0 ;; integer values


IT'S A BUG!! AAHHHH!!

I then changed it to match the original:
QUOTE

:PROJECT_237
004E: end_thread

:BBCHAL_1 <-- the builder forgot this line
03A4: name_thread 'BBCHAL'



After compiling again I then received this error: "Label not found: LABEL0193A4"

It's a DIFFERENT label... Noticing a trend here..

After doing the same thing for this I only noticed a couple that were 'bugged' like the "BBCHAL_1", the rest just needed the label0... replaced with whatever the original scm has.

This may seem rather sh*tty, and I agree, but it did work for me. And it doesn't take as long as it seems. After it finally let's you compile, you then have a bug-free main.txt! Like I said, all this code is Greek to me, but I had been playing around with car spawning and wanted to add cars across the map without having to do all the missions to get there.

Hopefully this helped some of you, and I'm sorry it's so long..

UNQUOTE
...worked for me colgate.gif

Kill3r
  • Kill3r

    Die Balla Fools!

  • Members
  • Joined: 27 Jul 2005

#10

Posted 06 August 2005 - 02:12 PM

Thanks alot for the information on this everyone. biggrin.gif

San andreas master
  • San andreas master

    .:%$Catonic$%:.

  • BUSTED!
  • Joined: 28 Dec 2004

#11

Posted 07 August 2005 - 10:39 AM

updated again, i added biguns fix for the label error biggrin.gif

Jabooncaboon
  • Jabooncaboon

    Player Hater

  • Members
  • Joined: 30 Aug 2005

#12

Posted 31 August 2005 - 06:38 AM

Whenever I add high mod, it says...

user posted image

Mr. Someguy
  • Mr. Someguy

    Gold Member

  • Members
  • Joined: 10 Dec 2004

#13

Posted 15 December 2005 - 12:38 AM

All it does is open an empty file, no text mad.gif

ronny8525
  • ronny8525

    Player Hater

  • Members
  • Joined: 10 Aug 2006

#14

Posted 11 August 2006 - 08:09 PM

if I wanna add the "FirstPersonCamera" mod into my main script.i donno what to do with Mission builder for add script...teach me pls

Vonsid
  • Vonsid

    Gta Modding / Fan

  • Members
  • Joined: 10 Jul 2005

#15

Posted 08 September 2006 - 02:43 PM

My problem is that I place the memory that that says to me it places, and equal the game is crashed to me… That I do? Sorry for my bad english...

I put very very mods!!

Vonsid
  • Vonsid

    Gta Modding / Fan

  • Members
  • Joined: 10 Jul 2005

#16

Posted 08 September 2006 - 02:44 PM

My problem is that I place the memory that that says to me it places, and equal the game is crashed to me… That I do? Sorry for my bad english...

I put very very mods!!

DEFINE MEMORY 44473 i put this memory!!

botatoboom
  • botatoboom

    Player Hater

  • Members
  • Joined: 23 Oct 2006

#17

Posted 23 October 2006 - 11:44 PM

THANKS BRO FOR THIS TUTORIAL , ILL NEVER FORGET THAT . THANK YOU VERY MUCH

cheeseballbob
  • cheeseballbob

    Player Hater

  • Members
  • Joined: 10 May 2007

#18

Posted 17 May 2007 - 09:53 PM

is there like a list for all the different codes for like...the buttons u press?...like next weapon...etc...yea...is there a code for all those?

blazevski
  • blazevski

    PrOfEssIoNaL

  • Members
  • Joined: 07 Dec 2005

#19

Posted 10 August 2007 - 12:05 PM Edited by blazevski, 10 August 2007 - 12:31 PM.

I made a code:
CODE
004F: create_thread ŁŁINITIAL_2

:INITIAL_2
03A4: name_thread "myfirst"

:INITIAL_3
0001: wait 250 ms
00D6: if  0
00FF:   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2487.47 -1670.604 13.33595 radius  1.0  1.0  2.0
004D: jump_if_false ŁŁINITIAL_4
014C: set_parked_car_generator $infernus_savepoint cars_to_generate_to  101
004E: end_thread

:INITIAL_4
0002: jump ŁŁINITIAL_3


and I have put it there:

CODE

;-------------Mission 0---------------
; Originally: Initial 1

004F: create_thread ŁŁINITIAL_2

:INITIAL_2
03A4: name_thread "myfirst"

:INITIAL_3
0001: wait 250 ms
00D6: if  0
00FF:   actor $PLAYER_ACTOR  0 ()near_point_on_foot 2487.47 -1670.604 13.33595 radius  1.0  1.0  2.0
004D: jump_if_false ŁŁINITIAL_4
014C: set_parked_car_generator $infernus_savepoint cars_to_generate_to  101
004E: end_thread

:INITIAL_4
0002: jump ŁŁINITIAL_3

:INITIAL_1
03A4: name_thread 'INITIAL'
06C8: toggle_riot  0
0004: $1515 =  0;; integer values
0004: $1499 =  0;; integer values
0005: $1500 =  5.0;; floating-point values
0005: $1501 = -5.0;; floating-point values
0005: $1502 =  8.5;; floating-point values
0005: $1503 = -1.5;; floating-point values
0005: $1504 = -30.0;; floating-point values
.
.
.


I also made these 2:
CODE
02A7: $myfirsticon = create_icon_marker_and_sphere $55 at 2487.47 -1670.604 13.33595
02A8: $myfirsticon = create_marker $55 at 2487.47 -1670.604 13.33595

CODE
014B: $infernus_savepoint = init_parked_car_generator #INFERNUS color 44 44  1 alarm  1 door_lock  0  0  10000 at  2495.786 -1671.794 13.33595 angle  90.0
014C: set_parked_car_generator $infernus_savepoint cars_to_generate_to  0


I put those 2 sumewhere in mission 0 aswell...
wont work

S.O.S.

help me please dontgetit.gif

blazevski
  • blazevski

    PrOfEssIoNaL

  • Members
  • Joined: 07 Dec 2005

#20

Posted 11 August 2007 - 05:52 PM

anyoooooooooneeee? pleeeeaseeee? nervous.gif

coin-god
  • coin-god

    High Roller

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

#21

Posted 11 August 2007 - 06:17 PM

create_thread dont go there. confused.gif

blazevski
  • blazevski

    PrOfEssIoNaL

  • Members
  • Joined: 07 Dec 2005

#22

Posted 11 August 2007 - 06:31 PM

thanks, but I fixed the problem now... i put everything except icon creation code and car spawn code abowe mission 0... but now there is another problem...
the car spawns there even if I aint on foot... when I arrived to groove street with car he infernus was already there...

any guesses?

TheTrekhippy
  • TheTrekhippy

    Player Hater

  • Members
  • Joined: 09 Nov 2007

#23

Posted 27 January 2008 - 02:21 PM

With the Mission builder, when I click on Compile and Save or Compile and Save and Run GTA SA it says INstall GTA SA, which I have already. What do I need to do>? Thanks for that tutorial also.

GTA SA MODER
  • GTA SA MODER

    Player Hater

  • Members
  • Joined: 04 Mar 2008

#24

Posted 06 March 2008 - 11:46 AM

biggrin.gif thank you this is working with sanny builder to so if u have problems with it try to use sany builder




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users