Jump to content


How to use timers and trigger areas


No replies to this topic

#1 Short Stuff

    The Music Man

  • Member Test
  • 1448 posts

Posted 03 January 2007 - 01:02

Scripting 101

This weeks scripting 101 is on...Timers And Trigger Areas

Now i know you all thought i would be doing how to make cars follow waypoints, but im saveing that for when I do a movie makeing Scripting 101 :D

And also sorry for the delay, been off to weird places :D

So lets get started!


1)Createing A Trigger Area

* Click the trigger area button, and make a nice box, or octagon, or whatever, but make it big enough for which ever unit you want to use it

* name the trigger area in its drop down box, lets name this

MyFirstTrig

this is for later when we script the trigger area to start a timer

2) The Lacky

* Now, place any unit you like (Preferbly infantry, so it will fit in the trigger area) on the map, and name it anything you want, but for now, lets call him

Bill

He will be your lacky :D

* Make a waypoint that goes through the trigger area and name it anything you want, again. but lets name it

BillsRoute

this will be the route Bill takes when triggering the trigger area.

3) The Scripting

* Go to the scripting menu, and under the civilian folder, go to create new script.

* everything should be set up, so go to scripting conditions and scroll down to "Make Unit Follow Way Point Path" (I think that's the name, ill update when i find out ;) )

* in the options for this script there is a drop down menu of the units you have on your map. Dropdown to bill and choose him :D

* Next there is a drop down list of your waypoint paths, Choose BillsRoute.
Now Whenever playing Bill Will follow that route

4) The Lacky And The Trigger

*Now go back, and create another script this time, go to the tab before scripting conditions, and change IF True to, the script that says something like Unit Bill Walks Through Trigger MyFirstTrig

*Now back in scripting conditions find the script that involves timers, and choose the one that says set timer to expire in sec.

* Make the seconds be 10, for now. And name the timer

Boom

5) The Timer And Dead Lacky

*Create yet another script and go to the tab before scripting conditions again, and change it from If True, to If Timer "Kill" has expired

*Now go back to scripting conditions and choose from your lists of scripts the script that says "Destroy Unit"

*Choose the "Bill" from the dropdown list

And tada u just made Bill walk into a trap :D he killed him self for walking, talk about ironic.

Scripting Trigger areas and timers is one way to make a map, even more interesting, these type things are used for createing dams that flood areas, and for mission maps when you want to spawn re-inforcements.

Experiment with these new scripting skillz of urs, and make the best maps you can.

And again, i will update this post when i have the exact script names and such :D

Untill then, HAPPY SCRIPTING! And Pics will be added, just not yet :D

Edited by Revantheemperor, 03 November 2007 - 14:10.

Posted Image





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users