Jump to content
HonzaVinCZ

Make trigger activated by any object in list.

Recommended Posts

Hello, I'd like to ask you for your help. My idea is that: BLUFOR and GUER has 1000 respawn tickets and for every killed civilian they loses 50 tickets depending which side killed the civilian. I want sides to be able restore their tickets by trasporting supply crates into town areas. Let's say 50 tickets per each crate. So players would must transport any crate they take from base to any town area (trigger) they choose to gain more respawn tickets. Supply crates would be removed after some time players transport them and drop them on place. Transport of crates is possible by using ACE3. Any ideas please? Thank you a lot!

Crates:
BLUFOR: SupplyB_1, SupplyB_2...
GUER: SupplyG_1, SupplyG_2...

Triggers:
Trigger_1, Trigger2...

Share this post


Link to post
Share on other sites

You can do it by using the class name object :

 

an exemple here :

trig condition :

getPos thisTrigger nearestObject "Land_PaperBox_open_full_F" inArea thisTrigger

 

trig activation :

[west, 50] call BIS_fnc_respawnTickets;

 

 

Each crate ( "Land_PaperBox_open_full_F") deliver in the trigger will add 50 ticket to blufor side.

 

 

You can also check this thread you will find usefull information :

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
17 hours ago, damsous said:

You can do it by using the class name object :

 

an exemple here :

trig condition :

getPos thisTrigger nearestObject "Land_PaperBox_open_full_F" inArea thisTrigger

 

trig activation :

[west, 50] call BIS_fnc_respawnTickets;

 

 

Each crate ( "Land_PaperBox_open_full_F") deliver in the trigger will add 50 ticket to blufor side.

 

 

You can also check this thread you will find usefull information :

 

I will test it, thanks a lot!

Share this post


Link to post
Share on other sites
19 hours ago, damsous said:

You can do it by using the class name object :

 

an exemple here :

trig condition :

getPos thisTrigger nearestObject "Land_PaperBox_open_full_F" inArea thisTrigger

 

trig activation :

[west, 50] call BIS_fnc_respawnTickets;

 

 

Each crate ( "Land_PaperBox_open_full_F") deliver in the trigger will add 50 ticket to blufor side.

 

 

You can also check this thread you will find usefull information :

 

It works perfectly! But now I need to solve how to remove crates after players deliver them. Let's say they would be removed after 10s player drop them in trigger area. I have no idea how to do it because if I would use deleteVehicle it would not work because crates has no name. 

Share this post


Link to post
Share on other sites

trig activation :

[west, 50] call BIS_fnc_respawnTickets; (thisList #0) spawn {uiSleep 10; deleteVehicle _this}

Share this post


Link to post
Share on other sites
9 minutes ago, pierremgi said:

trig activation :

[west, 50] call BIS_fnc_respawnTickets; deleteVehicle (thisList #0)

It doesn't work. It adds one point as I set but it doesn't delete the crate. 
My trig activation:
[west, 1] call BIS_fnc_respawnTickets;
systemChat format ["WEST Delivered civilian supply +1. WEST respawn tickets: %4", [west,nil,false] call BIS_fnc_respawnTickets];
deleteVehicle (thisList #0);

*edit
I tried damsous triggers but it won't delete the crate too.
Trig. activation was:
[west, 1] call BIS_fnc_respawnTickets;
systemChat format ["WEST Delivered civilian supply +1. WEST respawn tickets: %4", [west,nil,false] call BIS_fnc_respawnTickets];
_vehicles = nearestObjects [bSupplyT_1, ["B_CargoNet_01_ammo_F"], 10];
 {deleteVehicle _x} forEach thisList;

Share this post


Link to post
Share on other sites

Oups! sorry. thisList is not accurate. Try: deleteVehicle (getPos thisTrigger nearestObject "Land_PaperBox_open_full_F").

But, to say the truth, I'd rather setVariable on player to manage that.

  • Thanks 1

Share this post


Link to post
Share on other sites
7 minutes ago, pierremgi said:

Oups! sorry. thisList is not accurate. Try: deleteVehicle (getPos thisTrigger nearestObject "Land_PaperBox_open_full_F").

But, to say the truth, I'd rather setVariable on player to manage that.

It works, thank you! I still learn to script and I'm glad I was able to make script that punishes players for killing any civ in scenario at least. That's why I need your help here. I must say I have no idea how to make this thing work by using .sqf, it would be a less stressful for server because I need to make these triggers in every town on Takistan. I have done this now and actually I need one trigger in every town for each side to make it work for WEST and GUER. Both sides have set different crates but triggers on same place. I don't know how to make it by using one trigger or one script. I would also must make somehow the systemChat recognize which side delivered the crate to specific trigger because all triggers has different value for delivering cargo. 

Share this post


Link to post
Share on other sites

The reason why I mentioned the variable on player.

You can place/spawn your triggers on each location in Takistan.

Then, I don't know how players bring their crates (attached objects?) If it's the case, you just have to trigger for any player with attached object.

But you can also set a variable for candidate: player setVariable ["bringingCrate", true];

the trigger's condition could be for anyPlayer (preset) and: this && (thisList #0) getVariable ["bringingCrate",false]

the trigger will be activated locally (player's PC) but should work. Not tested.

Share this post


Link to post
Share on other sites
19 minutes ago, pierremgi said:

The reason why I mentioned the variable on player.

You can place/spawn your triggers on each location in Takistan.

Then, I don't know how players bring their crates (attached objects?) If it's the case, you just have to trigger for any player with attached object.

But you can also set a variable for candidate: player setVariable ["bringingCrate", true];

the trigger's condition could be for anyPlayer (preset) and: this && (thisList #0) getVariable ["bringingCrate",false]

the trigger will be activated locally (player's PC) but should work. Not tested.

Players delivering crates by using ACE logistic. So they load crate on base into truck or heli and transport them where they choose to. I'm not sure if setVariable would work in this case. 

Share this post


Link to post
Share on other sites

setVariable will work as you want! I'm not familiar with ACE, (and I don't want to be), but you can try to add (set) a variable when the player picks a crate. There is probably something already existing inside ACE itself for that. Perhaps someone else could answer more precisely.

Share this post


Link to post
Share on other sites

Just place an other trigger to delete the object :

 

trig condition :

getPos thisTrigger nearestObject "B_CargoNet_01_ammo_F" inArea thisTrigger

 

trig activation :

_vehicles = nearestObjects [delivery, ["B_CargoNet_01_ammo_F"], 100]; {deleteVehicle _x} forEach thisList;

 

set a time out 10s.

 

delivery should be a variable name of an invisible object (helipad or grasscutter), every "B_CargoNet_01_ammo_F" should be deleted in a 100m radius.

 

I think its work was using this method to carry huminatarian aid in a village.

 

 

  • Like 1

Share this post


Link to post
Share on other sites

That what i use in a mission its working :

 

trigger activation :

type : none

Activation : anybody

Activation type : present

Repeatable : yes

Server only : yes

 

condition field :

{typeof _x isEqualTo "Land_FoodSacks_01_cargo_white_idap_F"} count thisList > 0

 

activation field :

_vehicles = nearestObjects [cargo, ["Land_FoodSacks_01_cargo_white_idap_F"], 2];
 
{deleteVehicle _x} forEach thisList; [{hint "Hunanitarian aid was delivered, -1 ticket for the insurgent";},"BIS_fnc_spawn",true,true] call BIS_fnc_MP; [independent, 5] call BIS_fnc_respawnTickets; [east, -1] call BIS_fnc_respawnTickets;

 

cargo : its the variable name or an helipad, every food crate delivered on this helipad give 5 ticket for the independent faction and remove 1 ticket for the opfor faction.

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
4 hours ago, damsous said:

Just place an other trigger to delete the object :

 

trig condition :

getPos thisTrigger nearestObject "B_CargoNet_01_ammo_F" inArea thisTrigger

 

trig activation :

_vehicles = nearestObjects [delivery, ["B_CargoNet_01_ammo_F"], 100]; {deleteVehicle _x} forEach thisList;

 

set a time out 10s.

 

delivery should be a variable name of an invisible object (helipad or grasscutter), every "B_CargoNet_01_ammo_F" should be deleted in a 100m radius.

 

I think its work was using this method to carry huminatarian aid in a village.

 

 

Ahh I was using "delivery" as trigger area. This sounds good too. I will test it and tell you, thank you. 

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

×