GTA: Modification Area
Would you like to react to this message? Create an account in a few clicks or log in to continue.
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
Creating a Thread EmptySun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Creating a Thread EmptyThu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Creating a Thread EmptyThu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Creating a Thread EmptyThu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Creating a Thread EmptySat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Creating a Thread EmptyFri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Creating a Thread EmptyFri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Creating a Thread EmptyTue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Creating a Thread EmptyMon 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



March 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar


You are not connected. Please login or register

Creating a Thread

Go down  Message [Page 1 of 1]

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

gtasbigfoot

gtasbigfoot
Admin

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.

http://gtamodding.com

Back to top  Message [Page 1 of 1]

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