Multi-Scripts

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Post Reply
kim00000
Ped
Ped
Posts: 4
Joined: 23 May 2012, 12:43
GH nick: Kimo

Multi-Scripts

Post by kim00000 »

Hey Guys...
I'm making a map and the script file is called "gangs.mis", and to make the code more readable I wanted to put some functionality in separate script files. So I made a folder and called it "gangs" (like the main script) and made a new script file inside that folder called gangs_callgang.mis. When I use LAUNCH_MISSION in the main script the compiler doesn't recognize this command. How can I implement this thing?

Another question is that if I have some objects declared and created in the main script, can I use them in the "little" script without declaring them again?

Thanks in advance...
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Multi-Scripts

Post by T.M. »

Try putting the mission files in the compiler directory? What error message it gave? Check the manual if you typed it correctly. Also, show your code at the LAUNCH_MISSION line.

Yes, you can refer to objects from the main script in the "little script".
kim00000
Ped
Ped
Posts: 4
Joined: 23 May 2012, 12:43
GH nick: Kimo

Re: Multi-Scripts

Post by kim00000 »

The error message is as follows:
Syntax Error: unrecognized token in scriptfile
Current token = 'LAUNCH_MISSION' on line X

Code: Select all

// gangs.mis
...
IF((IS_CHAR_IN_ZONE(Pa, SendGang)) AND (ganga_created = 0))
     IF(CHECK_SCORE_GREATER(Pa, 9999))
          ADD_SCORE(Pa, -10000)
          LAUNCH_MISSION callgang
          // Where the mission script file is gangs_callgang.mis in the subfolder gangs
     ENDIF
ENDIF
...
I also chose LAUNCH_MISSION from the IntelliSense to make sure I have no spelling errors.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Multi-Scripts

Post by T.M. »

Yep, you typed it wrong, check correct typing from the manual:
http://projectcerbera.com/gta/2/tutoria ... CH_MISSION
kim00000
Ped
Ped
Posts: 4
Joined: 23 May 2012, 12:43
GH nick: Kimo

Re: Multi-Scripts

Post by kim00000 »

Oh! I forgot the parentheses. Sorry :)
Post Reply