Jump to content

Recommended Posts

Hello guys,
I'm working on my own mission for multiplayer, actually on hostage rescue task. I've done triggers to make task accomplish when two insurgents are dead or failed if civs ( hostages ) are dead.
Now I need your help. I need to solve out how to make hostages join group of player who saved them, maybe better by addAction in civs init and then leave player's group when hostages (civ1 and civ2) are present in trigger (base) 
I'm not much experienced with scripting, so I'm trying to make as much things as possible in editor by triggers. Still don't understand how to use scripts in sqf and sqs files. For example I did one action on laptop that spawn mk82 on given object ( this addaction "Blow off castle", "CastleBomb.sqf"; ) ( CastleBomb.sqf > CastleBomb01="Bo_Mk82" createVehicle (getPos CastleBomb01);  ), that's only thing I understand in scripting, using these simple scripts. I can't use "if", "else", "then" and these things. Also if you could explain me how to make trigger if I want to make trigger triggered when three insurgents are dead. ( Actually I have done it by " !alive opf1 and !alive opf2 ", and I don't know how to make list of objects with combination of !alive ) 

So if anyone can help me:
 

  •  Civ1, Civ2 = Hostages
  • Opf1, Opf2 = Insurgents
  • Base = trigger ( triggered when hostages are present )

 

If you could explain me:

 

  • Using multiple given objects with combination of !alive (I'd like to make for example "!alive civ1, civ2, civ3...." but not possible)
  • How to make teleport action (on flag pole of OPFOR) hidden if BLUFOR is present in trigger around enemy weapon cache and then reveal if there's no BLUFOR anymore in trigger.
    ( Tried it by repeating trigger: Activation: "OPFORFlag removeAction 0;" Deactivation: "OPFORFlag addAction "Teleport to Weapon Cache 1", Teleport.sqf" but it worked one time and then it won't remove action but only adds action
  • Using sqf or sqs and "if", "else", "then"... I think I could get it if you explain me some practical usage of these things.

 

Thank you a lot!

  • Like 1

Share this post


Link to post
Share on other sites

I myself use basic scripting so triggers are my thing :sun:

 

Now to place two conditions you have got to place in the condition field:

 

!alive opf1 && !alive opf2

 

That will make the trigger fire once both are dead. If you use:

 

!alive opf1 or !alive opf2

 

That means that the trigger will be activated once either opf1 or opf2 is dead.

To reveal and hide an action I cannot find a specific way but you can place a repeatable trigger where if BLUEFOR is present:

removeAllActions nameofflagpole;

and if OPFOR is present:


 

nameofflagpole addAction ["Teleport ", "scriptFile.sqf"];

In the scriptFile.sqf you can simply place:

player attachTo [anobject, [0, 0, 1] ]; 

sleep 0.01;

unattach player;

That should teleport the player where you want them to go. The anobject can be an invisible helipad. The [0, 0, 1] are the X, Y, Z distance from the object.

 

For the grouping you can use an addAction and a .sqf where you can write:

 

[_civ1, _civ2] join player;

To leave the group:

 

[_civ1, _civ2] join grpNull;

 

Most likely there are other ways to do what you need but the more advanced scripters can help you with that. If you want to see how triggers can make missions you can just download and unpbo one of my own. 

 

Good Luck with your mission!!

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
18 hours ago, JohnKalo said:

I myself use basic scripting so triggers are my thing :sun:

 

Now to place two conditions you have got to place in the condition field:

 


!alive opf1 && !alive opf2

 

That will make the trigger fire once both are dead. If you use:

 


!alive opf1 or !alive opf2

 

That means that the trigger will be activated once either opf1 or opf2 is dead.

To reveal and hide an action I cannot find a specific way but you can place a repeatable trigger where if BLUEFOR is present:


removeAllActions nameofflagpole;

and if OPFOR is present:


 


nameofflagpole addAction ["Teleport ", "scriptFile.sqf"];

In the scriptFile.sqf you can simply place:


player attachTo [anobject, [0, 0, 1] ]; 

sleep 0.01;

unattach player;

That should teleport the player where you want them to go. The anobject can be an invisible helipad. The [0, 0, 1] are the X, Y, Z distance from the object.

 

For the grouping you can use an addAction and a .sqf where you can write:

 


[_civ1, _civ2] join player;

To leave the group:

 


[_civ1, _civ2] join grpNull;

 

Most likely there are other ways to do what you need but the more advanced scripters can help you with that. If you want to see how triggers can make missions you can just download and unpbo one of my own. 

 

Good Luck with your mission!!

 

 

Thank you for your reply! Could I also ask you if you know how to make !alive with combination of more than two objects? I'd like to make trigger activated when three or more opfs are dead or if any of three or more civs are dead. 
For teleport script I have this:

Teleport.sqf

// name your MHQ or forward deployment vehicle something you want showing up in the player messages
/* just add the following line into your teleporter (flag pole) init
this addAction ["Move to USS Freedom", "teleport.sqf", USS]; this addAction ["Move to APX HQ", "teleport.sqf", HQ];
********** just remember to name the vehicles you want to telport to MHQ1 MHQ2 ect...
*/
//Place below in flagpole
//this addAction ["Teleport -destinationName","teleport.sqf",[objectName]];

3 fadeSound 0;
cutText["Spawning on position...","BLACK OUT",3,false];

sleep 3;
// Get the destination.
_dest = (_this select 3) select 0;

// Get a random direction
_dir = random 359;

// Get destination
_spot =  getPosATL _dest;

// Move the person a few meters away from the destination then turn in the direction of _dir)
player setDir _dir;
player SetPosATL (_spot vectorAdd [5 - random 5, 5 - random 5,0]);

cutText["Spawning on position...","BLACK IN",3,false];
3 fadeSound 1;
waitUntil {player == player};
waitUntil {time > 5};
[
(getPos player) call BIS_fnc_locationDescription,
format ["%1/%2/%3", (date select 0), (date select 1), (date select 2)], 
format ["%1", ([dayTime, "HH:MM"] call BIS_fnc_timeToString)]
] spawn BIS_fnc_infoText;

I used more actions in flagpole, so there are like 6 actions in flagpole for teleport and I think I can't use removeAllActions because it would remove all actions, usually I use removeAction <number>. The problem is trigger won't use removeAction more times than once. I really don't know why because when trigger is deactivated it always only adds new action but not uses removeAction. I use addAction with priority to be sure which action number the given action is. So actually I use just removeAction that removes action from flag pole and not adds action then.
Any tips to make action removed and then added again please because it really won't work by using repeating trigger. 

Share this post


Link to post
Share on other sites
Quote

Could I also ask you if you know how to make !alive with combination of more than two objects? I'd like to make trigger activated when three or more opfs are dead or if any of three or more civs are dead. 

 

Quote

Any tips to make action removed and then added again please because it really won't work by using repeating trigger.

Yep it is true that removeAction has got some issues sometimes. That is why I use removeAllActions command which especially works when you place an addAction on a player.

 

For the addAction does this help:

 

https://www.reddit.com/r/armadev/comments/1qeed4/arma_3_addaction_only_when_trigger_requirements/

  • Thanks 1

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

×