!alive and (optional) extra VIP

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
User avatar
Posts: 59
Joined: Mon Mar 11, 2013 12:09 am

!alive and (optional) extra VIP

Post by pvtbones » Mon Sep 09, 2013 4:13 am

Hello all, working on a small adversarial mission, where indfor has to kill a VIP. I've got the victory trigger set up but I've run into a small issue. I want there to be a second optional VIP slot in case there's a couple extra players on the server. I can't seem to get the trigger to work for both scenarios (just the mandatory VIP or with the VIP + optional VIP) I can st it to one or the other and have it work. but I can't seem to figure out an way for both possibilities to be present within the mission trigger.

below is my trigger. perhaps I'm missing something stupid?

http://steamcommunity.com/sharedfiles/f ... =177088011


User avatar
Ferrard Carson
Posts: 565
Joined: Sun Aug 12, 2012 6:08 am

Re: !alive and (optional) extra VIP

Post by Ferrard Carson » Mon Sep 09, 2013 5:13 am

Sorry to say this, but the best course of action is to completely change the way you're attacking the problem. The tool is already out there for you to use. Declare a variable at the start that keeps track of the VIPs being alive or not, then Advanced CasCap the VIPs. Advanced CasCap, like the standard CasCap, checks the numbers in the specific groups as of 10-seconds after the start of the mission, then uses that as the baseline of 100%, therefore it doesn't break like !alive does when the unit in question doesn't exist. When the Advanced CasCap triggers, have it flip the variable you declared earlier to 0, and broadcast that value to players (make sure you do that one to synch everyone up). Then have an end trigger with condition "VIP == 0" that sends the command to the end controller.

unPBO the latest Rook Valley and take a look at the Advanced CasCap script in f/server to get an idea of what to do - I use it to keep track of the life of the pilots, because you get different endings to that mission if you complete it with or without surviving pilots. There are also elements in the mission file itself, and, IIRC, an element in init. in order to set the "PilotsDead" variable in the first place.

~ Ferrard
"Take a boat in the air you don't love, she'll shake you off just as sure as the turnin' of the worlds. Love keeps her in the air when she oughta fall down, tells you she's hurtin' before she keels... makes her home."

User avatar
Posts: 365
Joined: Fri Jul 29, 2011 3:35 pm
Location: Finland

Re: !alive and (optional) extra VIP

Post by harakka » Mon Sep 09, 2013 7:37 am

Have the VIPs in the same group, then add "GrpVIP = group this;" into their unit inits in the editor. Then you can use the normal casualty cap script (http://ferstaberinde.com/f3/en//index.p ... alties_Cap) to end the game when all units from the VIP group are dead, this in init.sqf should do the trick:

Code: Select all

[["GrpVIP"],100,1] execVM "f\server\f_endOnCasualtiesCap.sqf";
Me and him, we're from different ancient tribes. Now we're both almost extinct. Sometimes you gotta stick with the ancient ways, the old school ways. I know you understand me.

Post Reply