OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: magnar on 03 Jul 2005, 08:59:28
-
I have looked for information on this, but have come up empty. How can you, via trigger or script, whatever is easier, have an objective met when 5 mines are deactivated. I tried the not alive way, naming mines M1 through M5, but that doesnt work. Any help would be greatly appreciated. ??? :-\
-
Maybe try the "isnull" command? For example:
{isnull _x} count [M1,M2,M3,M4,M5]
-
will try right now. Thanks
-
oops. Sorry, does this go in the cindition field of the trigger, or is it used in a script? Noob to scripting here, my bad!
-
That would be the condition field of a trigger.
-
with this in condition field of trigger, am getting the TYPE NUMBER, EXPECTED BOOL error.......?
-
Whoops, I'm sorry, I didn't finish! It should look like this:
({isnull _x} count [M1,M2,M3,M4,M5]) == 0
-
thanks again ;D
-
({isnull _x} count [M1,M2,M3,M4,M5]) == 0 ; this makes the trigger go off but none of the mines were deactiviated yet? hmmmmmm?
-
Damn it... I need to go to sleep.
({! isnull _x} count [M1,M2,M3,M4,M5]) == 0
-
unfortunately same result. It seems as if the mines are not responding to the is null command. I really appreciate your help, and hope you can sleep soon!
-
This is really odd. I placed a mine on the map called m1 and then I set up the following radio hint
hint format["XLocation = %1\nisNull = %2\nAlive = %3",getPos m1 select 0,isNull m1,alive m1]
And it seems that as far as the mine is concerned its location, its isNull status and its alive status are all undefined. If I call something else m1 then the hint gives the correct values.
It seems there is some other property of the mine that needs to be checked - or maybe it is not possible.
-
I think you are right, its status is undefined, as least as far as those two commands are concerned. Ive been looking in the command ref, but I dont see anything else (with my limited knowledge) that would serve to change its status. Maybe its not possible, unless someone has a different suggestion? Thanks for your help with this............ ::)
-
Mines are not proper objects. Most scripting commands do not apply to them. magnar, give us more details or rethink your mission. A complex and sophisticated workaround will probably be required. AFAIK the only people who have managed to do anything like this are macguba and Sui.
-
It is as if you can't give mines a name.
I am going out now and so can't test it, but could you get the mine by using nearestObject command and then check its status?
It is a bit fiddly otherwise I would do it now.
-
how about not canmove and not canfire
they might work but i doubt it but worth a go
-
As far as details go, I just wanted the player, an engineer, to deactivate 5 mines to clear a path for following armor. I can still do this, just cant tie it to an objective. Thats OK though, I just thought it could be done. I thought it would work with grouping the mines to triggers with the "vehicle" and "Present/not present/or not alive" options. The game has to recognize them with some type of command, as when you deactivate them they filp sideways!
Finding the key seems to be more work than its worth at this point, but I hope I am wrong. Thanks all, for your help.
-
Alternative approach - why not have a radio trigger or an action for the player to call the armour forward when he's happy the road's been cleared. That can set the objective to "DONE".
Then, if you haven't done it properly, losing a vehicle within a suitable time period (i.e. on a mine) could reset the objective to "FAILED".
Part of the skill would be for the sapper to 'judge' when the road is clear, rather than a treasure hunt for a known quantity of mines.
-
Here is another alternative... don't make the player an engineer. Instead, add an action to each of the mines, which runs a script that does 2 things: increases a global var (Mines_disarmed), and moves the mine off into the abyss [0,0,0] (or just deletes it, if that is possible).