OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Uldics on 09 May 2004, 20:14:50

Title: Empty vehicles in trigger
Post by: Uldics on 09 May 2004, 20:14:50
I have a trigger, where I have placed some empty tanks. I want to make an array of those tanks.

_tanklist = list triggerW
_tanksleft = "LandVehicle" countType list triggerW

Both of these lines are not working in my script. I have placed following in my triggers condition field:

LandVehicle in thislist

But it is not activating the trigger, so I could count and get my tanks in the array. So, what should I write in the trigger?
Title: Re:Empty vehicles in trigger
Post by: Unnamed on 09 May 2004, 21:57:39
Make your trigger detect anybody rather than a certain side.

But there are better ways than triggers, in the first empty vehicle you placed in the editor add this to it's init field:

Code: [Select]
MyEmpties=[This]
Then for every additional one you add, put this in there init fields:

Code: [Select]
MyEmpties=MyEmpries+[This]
This way you will have a global array with all the empty vehicles in it. Plus you wont have redundant triggers banging away, thoughout the duration your mission.
Title: Re:Empty vehicles in trigger
Post by: nEO iNC on 10 May 2004, 09:45:54
Hey guys, Unnnamed is right about the trigger, empty vehicles are classed civillian...
Title: Re:Empty vehicles in trigger
Post by: Uldics on 11 May 2004, 21:58:07
Thanks a lot! It's working and it's simple! How didn't I think of that! :)
Title: Re:Empty vehicles in trigger
Post by: Uldics on 12 May 2004, 22:15:32
By the way, why isn't the array working, when I define it in Init.sqs and just add the tanks to it in their init lines?
Title: Re:Empty vehicles in trigger
Post by: Chris Death on 12 May 2004, 22:33:03
By the way, why isn't the array working, when I define it in Init.sqs and just add the tanks to it in their init lines?

nope - init.sqs will be executed after any unit's init field.

You could still do it using that technique, without init.sqs.

Init fields of units will become executed in the same order as when they were placed in the editor. This means: use the init field of the very first unit which you have placed in your mission
to initialize the empty array and then you can add each unit you want to that array by their own init fields.

hope this helps

~S~ CD
Title: Re:Empty vehicles in trigger
Post by: Uldics on 12 May 2004, 22:40:22
Thanks! Nice to know all those small things.
Title: Re:Empty vehicles in trigger
Post by: Chris Death on 12 May 2004, 23:06:31
Thanks! Nice to know all those small things.

lol - i know what ya mean - this can be a pain hehe

Took me almost 3 years now - and believe me there's always
something new to learn.

singleplayer = alot of small things

multiplayer = alot of small things³

~S~ CD
Title: Re:Empty vehicles in trigger
Post by: Unnamed on 13 May 2004, 08:42:34
If you want to do it via Init.sqs and you know exactly how many you will have at the start of the mission, just name them Vehicle01,Vehicle02 e.t.c

Then in Init.sqs just have:

Code: [Select]
MyEmpties=[Vehicle01,Vehicle02,Vehicle03]