First off I Would like Give crdit where it is due
Brok3n Halo - Finding at scripts
FFIIMan - Teaching me alot about scripts
Code: Select all
Part 1: Different types of scripts...
1 Dormant:
A dormant script is the effect of a triggered action.
(i.e) (script dormant sampl_scrip
(physics_set_gravity 0.5)
1b Wake:
Wake is how to activate the dormant script.
(i.e) (wake sampl_scrip) - That basicly says to activate the already stated script -
(script dormant sampl_scrip
(physics_set_gravity 0.5)
1c Sleep: Sleep is the opposite of wake but you can set it to a certain interval of time
(i.e) (sleep 500) This will make the command below this wait for 25 seconds... How do I know this well I have been doing some tests Halo's time is 20 times more than our time... So really Say you wanted your script to sleep for 1 minute you would multiply
100 x 20 = 2000
>> EDIT: Actually, in Halo 2 scripts 30 = 1 second, so if you want 5 seconds, you multiply 5 and 30, or if you want a minute, you multiply 60 and 30. <<
2 Startup: This kind of script activates on startup of game.. and is only activated once unless told to by another script...
(i.e) - (script startup grav_edit
(physics_set_grav .5
That makes gravity .5 at the begining of game..
(Note)- Default Gravity is "2"
2b Continuous: This will allow you to loop through your script without stopping until told to...
(i.e)- (script continuous edit_grav
So we have learned so far different kinds of scripts
Dormant
Wake
Sleep
Startup
Continuous
______________________________________________________________
Part 2
Disection of a Script
All scripts must start with-
(script
The next part would be The Type of scripts Which we just went over I will choose a startup So now we have put together this:
(script startup
Now we must determine the name of the script's name lets call it grav_edit we need this so in other scripts we can reference this script
You should now have:
(script startup grav_edit
Now we must tell the script what it must do on startup... For this we must give a new line of code and brackets... lets make it give us the gravity value of .8 (you can edit .8 to what you want) You should now have this: (note)- For spaces in a line of code that are together like physics set grav would be physics_set_grav
(script startup grav_edit
(physics_set_grav .8)
Now we could get even fancier by adding a timer to the gravity lets say after 1:00 min of gameplay the script will be exacuted there are 2 different ways to do it here is the easier way add the line (sleep 2000) above physics_set_grav... Now you say why 2000? I only wanted a minute wait... Well H2 Scripts multiplies time by 20 so multiply your desired time by 20 So...
100 x 20 = 2000 Your Script will look like:
(script startup grav_edit
(sleep 2000)
(physics_set_grav .8)
-Note- This script will only be activated once unless told to unless you edit startup to continuous
-this script has been tested and worked-
______________________________________________________________
Part 3
Multiple scripts to accomplish one thing
Well in the last section of the tutorial we had the script
(script startup grav_edit
(sleep 2000)
(physics_set_grav .8)
Lets change it aroumd to
(script dormant grav_edit
(physics_set_grav .8)
What did we change? First we replaced startup with dormant...
And we took out (sleep 2000) We are going to Link 2 scripts together to create one effect.
Now lets make another script...
(script startup grav_wake
(sleep 500)
(wake grav_edit)
Right now this script is called grav_wake and notice its a startup script... This script Currectly will sleep for 25 seconds then it will trigger our earlier dormant script...
Part 3
Multiple scripts to accomplish one thing
Well in the last section of the tutorial we had the script
(script startup grav_edit
(sleep 2000)
(physics_set_grav .8)
Lets change it aroumd to
(script dormant grav_edit
(physics_set_grav .8)
What did we change? First we replaced startup with dormant...
And we took out (sleep 2000) We are going to Link 2 scripts together to create one effect.
Now lets make another script...
(script startup grav_wake
(sleep 500)
(wake grav_edit)
Right now this script is called grav_wake and notice its a startup script... This script Currectly will sleep for 25 seconds then it will trigger our earlier dormant script...
-note- All scripts must end with a closing bracket )
______________________________________________________________
Part 4
Relating scripts to objects
With this type of script you can spawn almost any object referneced in a certain reflexe!
For this you must get the lastest SCRN Plugin Dependening what map you are modding you have to have the reflexes
"Script Objects", "Script Location"
Say you want to spawn a Sniper Rifle 1 minute into game well heres how...
First add 20 chunks to the Script object reflexe...
Open up any Single Player map... Navagate through The SCRN Chuncks and copy the Weapon Pallete Chunk... Add that chunck to your map. Now look in your newly Added chunck With Entity's Meta Editer and Find the Sniper Rifle and remember its Chunck at the top... Now scroll through and find the script object Chunk and find one of the new cloned chunks
Now Make the
Type-Weapon
Placement Index- The chunk i said to remember
Object name- This will define the snipers in your scripts...
Now we must Refrence the Chunk in Script locations you can set the X, Y, Z coordinates there...
The script would be
(script startup spwn_snip
(sleep 2000)
(object_create snipr_mine
For further more detailed explanation Visit
http://files.halomods.com/viewtopic.php?t=58368
______________________________________________________________
Thank you for Reading my guide plese credit me if you found this helpfull