GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Sun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Thu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Thu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Thu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Sat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Fri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Fri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Tue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Mon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))

Log in

I forgot my password



December 2016
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 

Calendar Calendar


You are not connected. Please login or register

Creating a Thread

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Creating a Thread on Fri Feb 06, 2009 2:48 am

This one is from the scripting tut I written like the "Mission Template"

Creating a thread: (main.scm) Note: Any changes to main will require you to start a NEW GAME

Open up main.scm
find command


Code:

create_thread


After or before these commands add to it you're create thread command:


Code:

004F: create_thread @thread  // You can name this label anything, of course.


Now find:


Code:

//-------------Mission 0---------------


After this is where the first mission starts, so BEFORE this insert you're thread:


Code:

:thread  // Must match the name, of what you created the thread with.
03A4: name_thread '  ' // You can name this with anything (max is 16)
// Here goes you're script contents
004E: end_thread


Now note if you end the thread with 004E: the game will only read this thread once,
for the thread to be in a loop you must repeat the script with 0002:
(above code, will only be read once, the one I'm going to show now is in a loop)


Code:

:thread  // Must match the name, of what you created the thread with.
03A4: name_thread '  ' // You can name this with anything (max is 16)

:thread_01
0001: wait 0 ms
// Here goes you're script contents
0002: jump @thread_01


Because the thread is in a loop, a wait within the loop is necessary, otherwise BOOM! (the game will crash!)
The thread now will repeat it's self, so make sure you don't put stuff which should only be read once within the script.



Note:
You do not necessary have to name the thread, but you will find that it's best to name them.
Empty string is also allowed:


Code:

03A4: name_thread '  '


Numbers are also allowed. Max character's allowed is 16.

View user profile http://gtamodding.com

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum