OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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?
-
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:
MyEmpties=[This]
Then for every additional one you add, put this in there init fields:
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.
-
Hey guys, Unnnamed is right about the trigger, empty vehicles are classed civillian...
-
Thanks a lot! It's working and it's simple! How didn't I think of that! :)
-
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?
-
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
-
Thanks! Nice to know all those small things.
-
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
-
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:
MyEmpties=[Vehicle01,Vehicle02,Vehicle03]