Jump to content
Sign in to follow this  
Zewdon

How do I get a trigger to trigg when a player joins a squad?

Recommended Posts

How do I get a trigger to trigg when a player joins a squad? is the question I have.

pls help me

Share this post


Link to post
Share on other sites

Players can't join squads spontaneously, so how is it that you don't already know when they do?

Share this post


Link to post
Share on other sites

But if it is a AI. When the AI joining the squad I want something to happen

Share this post


Link to post
Share on other sites

Same thing, units cannot switch groups on their own without some kind of editor based change or scripting command happening. That means you, as mission editor, caused it to happen and therefore you should precisely when it happened so don't need a trigger.

Can you explain what exactly you're trying to do?

Share this post


Link to post
Share on other sites

I'm using this http://www.arma3editor.com/2013/04/16/hostage-rescue/ to have hostage. And have them lockdown with this disableai "move";. So I wanna do so the hostage can walk wen I Rescue him. or is it some thing other I can use to have the hostage stand still maby?

This is the guide that I followed to make my hostage:

IMPORTANT First of all you need to save your mission, name it “Test†or something similar. Then you have to go to the mission folder and put a file in your “Test†mission file. The only file inside there now should be the “mission.sqmâ€. Add a notepad and name it “rescuePows.sqf†Inside you just put the following text.

_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: [POWS]

_grp = _this select 3 select 0;

// Remove the rescue option

_per removeAction _act;

// Join preselected units (POWS) to callers group, silently.

{[_x] joinSilent _ldr} forEach _grp;

Good. Now lets create the player unit and place the following code in his init field.

POWS = [p1,p2,p3,p4]

Now create four hostages, I usually use civilians for this. Name them p1, p2, p3 and so on. On the one hostage you just named p1 you should add this code to his init field.

this addAction ["Rescue POWs","rescuePows.sqf",[POWS],1,false,true,"","(_target distance _this) < 3"];

This will present an action prompt for the player when you are 3 meters away from the hostage that says “RescuePOWs. The hostages will join the player’s group and you will be able to give them orders just like normal units.

Next step should be to create a helicopter and name it “Rescue1″. You will send the hostages to this helicopter to get them saved.

After that just create a trigger and make the Axis A/Bs value 0. In the condition field you type in.

{alive _x && (_x in rescue1)} count POWS == {alive _x} count POWS

And on the on activation field you write.

hint "POWs rescued!";{[_x] joinSilent grpNull} forEach POWS

And I use the command [this disableai "move";] to get them to stand still. So I want to lock them up so they can go again when I save them. or is there maybe another way to get the child to stand still?

Edited by Foxhound
doublepost

Share this post


Link to post
Share on other sites

Gee, that guide looks familiar. :)

So you've put disableAI "MOVE" on your units and want to know how to make them move again once they get rescued? Just change your joinSilent line to this:

{[_x] joinSilent _ldr; _x enableAI "MOVE";} forEach _grp;

Share this post


Link to post
Share on other sites

It works so thank you very much for your help

Share this post


Link to post
Share on other sites

hijacking thread so I don't have to start a new one...

I am using the exact script as above to rescue the hostage. the missions is for MP use. I cannot for the life of me figure out how to set the module task 'rescue the hostage' to succeed when the ai joins a players group.

I have tried 'p1 in units group player' and '{alive _x && (_x in units group player)} count POWS == {alive _x} count POWS', but I always get the same result which is task succeed will fire on sp or preview but not mp

so what do I neeed to do to make the trigger fire and set off the succeed module for all players to see it?

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  

×