Page 1 of 1

Multi-Scripts

Posted: 11 Jun 2012, 15:32
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...

Re: Multi-Scripts

Posted: 11 Jun 2012, 17:57
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".

Re: Multi-Scripts

Posted: 11 Jun 2012, 18:11
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.

Re: Multi-Scripts

Posted: 11 Jun 2012, 18:14
by T.M.
Yep, you typed it wrong, check correct typing from the manual:
http://projectcerbera.com/gta/2/tutoria ... CH_MISSION

Re: Multi-Scripts

Posted: 11 Jun 2012, 18:15
by kim00000
Oh! I forgot the parentheses. Sorry :)