OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: fragsta on 24 May 2003, 15:18:59

Title: CNC mission script help me
Post by: fragsta on 24 May 2003, 15:18:59
here is the thread. Anyone who can help, please post here or there: http://www.ofpec.com/yabbse/index.php?board=22;action=display;threadid=9668;start=0;boardseen=1 (look at bottom)
Title: Re:CNC mission script help me
Post by: deaddog on 24 May 2003, 16:02:47
Can anyone tell me how to make it so that when I am inside a trigger area, an action will allow me to build an M1A1, and then it will pop up at a marker?

Use a repeating trigger:
type anyone
condition:player in thislist (only player will activate trigger this way)

on activation: build=player addaction ["Build Tank","buildtank.sqs"]
on deactivation: player removeaction build

Of course, "buildtank.sqs" would be whatever script you choose.

The build action will be removed when you leave the trigger area, or you could remove in the script.

To build the tank, your script would have something like this in it (in case you don't know already):

tank="m1a1" createvehicle getmarkerpos "markername"


Title: Re:CNC mission script help me
Post by: fragsta on 24 May 2003, 22:28:22
Kewl thanks! I thought I would need to use loads of variables and stuff!
Title: Re:CNC mission script help me
Post by: fragsta on 24 May 2003, 22:35:15
Ok everything works fine, i did the trigger the way you said and then i put a marker called warfactory, and made the script like this and saved it:

Code: [Select]
tank="m1a1" createvehicle getmarkerpos "warfactory"
but nothing happens when i select the action, not even an error message. No tank appears. Wat have i missed out?

thanks in advance
Title: Re:CNC mission script help me
Post by: deaddog on 24 May 2003, 22:55:18
It's actually M1Abrams, not m1a1.  Sorry about that.
Title: Re:CNC mission script help me
Post by: fragsta on 24 May 2003, 23:25:45
It works perfectly, thanks!