Jump to content
Sign in to follow this  
frosties

Trigger by trigger completed?

Recommended Posts

Im working on a mission with a VIP.

Im using this line to add the VIP to the "rescuer":

{[_x] joinSilent _ldr} forEach _grp;

Can i somehow use that the VIP has been added to the group and by that completing the task and triggering the next?

---------- Post added at 16:06 ---------- Previous post was at 16:00 ----------

Im adding more commands behind the join command and that completes the trigger.

BUT

How do i start a new task after this?

Share this post


Link to post
Share on other sites

Name your first trigger, set your second trigger condition as:

triggerActivated nameOfFirstTrigger

Share this post


Link to post
Share on other sites

Assuming you do not lose or gain any group members before you rescue this VIP, this would work in a trigger condition: (pretending your group is initially 5 men, and once the VIP joins it is 6)

{alive _x} count units GroupName == 6

My only other guess (this may not work) is to do this... At the top of the script file involving the VIP, put

VIPSecure=false;

and right under the line that adds the VIP to your group, put

VIPSecure=true;

And in the condition field of a trigger put

VIPSecure=true;

I am unsure how this will work between script and trigger, but what it does is it will know that when VIPSecure is false to not do anything, but once it is set to true it will proceed.

Share this post


Link to post
Share on other sites
Name your first trigger, set your second trigger condition as:

triggerActivated nameOfFirstTrigger

At the moment i only have one trigger, that with the true condition so i cant use that with a name.

When the VIP has joined the group it puts the first task as Succeeded.

{[_x] joinSilent _ldr} forEach _grp; tskFindVIP setTaskState "Succeeded"; taskhint ["VIP Located", [0, 1, 0, 1], "taskDone"]

Anyway i can use a code or command inside that code to trigger the 2nd trigger?

Share this post


Link to post
Share on other sites

Try what I posted, except maybe instead of doing script to trigger just trigger to trigger. So in the init.sqf put VIPSecure=false, then in the OnAct of the trigger that secures the VIP put VIPSecure=true; , then in the Condition of your task trigger put VIPSecure=false; .

Share this post


Link to post
Share on other sites

i did like this:

i put VIPSecure=false; in init.sqf

and added VIPSecure=true; after the join command, and then VIPSecure=true; as condition in the trigger.. but it didnt work.

escortVIP.sqf:

_per = _this select 0;  // Person who had the addAction
_ldr = _this select 1;  // Person who used the addAction
_act = _this select 2;  // ID of the addAction

// Group given in the arguments section (ie: [VIPS]
_grp = _this select 3 select 0;

// Remove the rescue option
_per removeAction _act;

// Join preselected units (VIPS) to callers group, silently.
{[_x] joinSilent _ldr} forEach _grp; tskFindVIP setTaskState "Succeeded"; taskhint ["VIP Located", [0, 1, 0, 1], "taskDone"] 
VIPSecure=true;

Share this post


Link to post
Share on other sites

Trigger condition of:

VIPSecure

= means assign, == means evaluate

I'm a moron, just VIPSecure would be enough since it's a true false. You'd use == if it were another value or comparison.

Edited by kylania

Share this post


Link to post
Share on other sites

Ah. I was saying only putting it in the init.sqf if you were doing trigger to trigger. Move the VIPSecure=false from init.sqf to the beginning of escortVIP.sqf

Edit: You know ky, I bet I keep forgetting that because I'm in algebra.

Share this post


Link to post
Share on other sites

Ky, do you mean to put VIPSecure==true; as the condition on the trigger i want to be next?

i tried to put that in but the editor wont let me.. if shows a message:

"==: Type Any, expected, Number, String Object...and so on"

Share this post


Link to post
Share on other sites

cant seem to get it to work.

But can i name my "squad" and when the VIP is in the squad the condition is filled?

just like vehicle VIP = rescue1?

maybe group VIP = group1?

Share this post


Link to post
Share on other sites

Stop thinking. :) Check out this demo and see how it's done. Even used Grimes' variable to add the second task. :)

Share this post


Link to post
Share on other sites

awesome!

Just like i wanted it.. you da man ky, thanks for your help.. yours to grimes!

Just to be a pain in the ass...

Is it possible to have several locations where the VIP might be?

a kind of random element?

i would like the mission to be re-playable, not just once.. :)

Edited by Frosties

Share this post


Link to post
Share on other sites

Yeah sure, simplest way is just group the VIP with empty markers where you might want him to start. He'll either start where places or randomly at one of the marker locations.

Share this post


Link to post
Share on other sites

So i just add markers all around the map and group them to the vip?

Share this post


Link to post
Share on other sites
So i just add markers all around the map and group them to the vip?

I've wondered about this to? How exactly to use multiple markers as possible location positions for a unit...

Share this post


Link to post
Share on other sites

Yeah, it's a little tricky though since markers will disappear when you enter group mode.

So like start the guy say on an airfield and put the markers on specific spots around him like this:

+       +      +
       guy
+       +      +

So you'll know where the markers are and can easily drag to them. Then switch back to marker mode and move them where you want.

Share this post


Link to post
Share on other sites

Okey, looks like its working.

Another thing, that is just trivial..

Me and my friends that plays likes a challenge...

should we remove the marker that shows where he is?

or can we make it it a bit bigger so it just shows wich part of town he is in?

Sounds a bit easy to know exactly where he is. A house-by-house search like the real army would be nice? :)

Share this post


Link to post
Share on other sites

Yeah, you can just remove the "setSimpleTaskDestination" line from where you add the Tasks to hide the location.

Then like maybe have a preset marker on the map somewhere and move that to the guy's position. The problem is the guy would still be in the middle of the marker, no matter how large you made it. Also he'll still end up at the same marker locations, so to make it really random you'd have to randomize the start positions instead of using markers. You'd also want to have the marker location, and possibly size be random as well. Meaning you'd need to use a method that's uniformly random rather than 'outside limits' like the easy way... and so on. It's possibly, but I'm too sleepy to work out the math for all of this at the moment and make it MP compatible. :)

Share this post


Link to post
Share on other sites

hehe.. Well i will do that another time.. :)

Gonna add me some ambushes and IEDs now ... :)

i was thinking of using your "spawn something in front of..." as an ambush script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×