Jump to content
Grester

[SOLVED]Trigger on presence of specific units

Recommended Posts

I found this thread of Arma2 from 2009 which asks the very same question. Now I must say I haven't tried this yet but, I wonder upon the release of Eden update if there are better alternatives given sync seems to have been sort of discontinued (I'm a Mission Editor amateur so I don't know if sync still actually exists.) or if simply there are better methods as of 2016's Arma 3 capabilities unlike A2 from 2009.

 

Assurance of A2's method and possible alternatives are welcome. Thanks in advance.

  • Like 1

Share this post


Link to post
Share on other sites

Whats the problem?

 

Just group your unit with the trigger.

 

Even says so in the thread you linked.

Share this post


Link to post
Share on other sites

Whats the problem?

 

Just group your unit with the trigger.

 

Even says so in the thread you linked.

Yeah but I think Eden brought quite a few changes to the mechanics of things, I'm trying to group a unit to the trigger but no line is drawn or sign of grouping appears to be done. Am I supposed to group through code?

 

UPDATE: Odd, although no line is drawn, History says I did a grouping, I'll debug see if it actually worked.

 

UPDATE 2: I ended up using "NameOfUnit in thisList", just unfortunate I can't simplify with a group instead of each group member.

Share this post


Link to post
Share on other sites

Hi guys, i'm trying to make a wave defense type mission for me and my buddy's, but i cant figure out how the triggers work, what i want to do is pretty simple. 

 

I just want to trigger another squad to move to their way point when another squad has been killed. 

 

I have set the activation to blufor, and the activation type to not present, which i assume means they are dead? 

 

But i cant find the code/variable for how to get another squad to move to a way point on another squads death.  

  • Like 1

Share this post


Link to post
Share on other sites

 

I just want to trigger another squad to move to their way point when another squad has been killed.

You need a trigger synced to the second group first waypoint. Waypoint statement should be empty.

In trigger statement you need a condition like:

({alive _x} count units firstgroup) <1

Share this post


Link to post
Share on other sites

 

You need a trigger synced to the second group first waypoint. Waypoint statement should be empty.

In trigger statement you need a condition like:

({alive _x} count units firstgroup) <1

 

 

So i dont know what im doing wrong but it's not working, i tried it out just with 2 civs, i set the trigger to, !alive civ1, synced it to the civ i was going to kill, and set the trigger type to skip way point and attached it to the hold way point of the second civ. 

When i killed the first civ the 2nd one wouldnt move. 

 

Any ideas? 

 

Thanks. 

Share this post


Link to post
Share on other sites

Everything are wrong,  here is example mission, test and analise it to find out how to trigger waypoints.

 

I have created 2 groups called grup1, group2.

Wait until both group reach his way points and do not move anymore.

 

You have an action to kill first group.

Do it and look at  the second group behavior.

  • Like 1

Share this post


Link to post
Share on other sites

Everything are wrong,  here is example mission, test and analise it to find out how to trigger waypoints.

 

I have created 2 groups called grup1, group2.

Wait until both group reach his way points and do not move anymore.

 

You have an action to kill first group.

Do it and look at  the second group behavior.

 

 

Thanks so much, makes it much easier to understand, a couple of final questions, what identifys Alpha 1-1 as group1, because in your trigger it says, ({alive _x} count units group1) <1 but i couldn't see a identifier on alpha 1-1 that IDs them as group1. 

Share this post


Link to post
Share on other sites

Thanks so much, makes it much easier to understand, a couple of final questions, what identifys Alpha 1-1 as group1, because in your trigger it says, ({alive _x} count units group1) <1 but i couldn't see a identifier on alpha 1-1 that IDs them as group1. 

 

Dont worry i found the variable on alpha 1-1 group leader, but it begs the next question, if i kill the leader first, does that trigger the trigger? 

Share this post


Link to post
Share on other sites

@OP:

 

There are a couple of ways to do this easily. First is as tajin said: Group the trigger with the unit or group you want to check. In Eden, this is accomplished by right-clicking on the trigger and going to Connections > Set Trigger Owner; after that, you just click on your unit and the connection is established. Now the trigger detection criteria will have options like "Owner only" and "Any group member" instead of the usual filtering by side.

 

Alternatively, you can change the condition code of your trigger to check for specific units by variable name. As long as the unit in question meets the general detection criteria of the trigger (e.g., a "BLUFOR -- Present" trigger would require that the unit in question be on the BLUFOR side), the unit will appear in the array represented by the special variable "thisList" within that trigger's code fields (condition, activation, deactivation). If you want to check for one unit specifically, then, you could change the trigger condition from the default "this" to "myUnit in thisList". Now the trigger will only fire if myUnit meets the trigger detection criteria; anyone else will be ignored. 

  • Like 2

Share this post


Link to post
Share on other sites

@OP:

 

There are a couple of ways to do this easily. First is as tajin said: Group the trigger with the unit or group you want to check. In Eden, this is accomplished by right-clicking on the trigger and going to Connections > Set Trigger Owner; after that, you just click on your unit and the connection is established. Now the trigger detection criteria will have options like "Owner only" and "Any group member" instead of the usual filtering by side.

 

Alternatively, you can change the condition code of your trigger to check for specific units by variable name. As long as the unit in question meets the general detection criteria of the trigger (e.g., a "BLUFOR -- Present" trigger would require that the unit in question be on the BLUFOR side), the unit will appear in the array represented by the special variable "thisList" within that trigger's code fields (condition, activation, deactivation). If you want to check for one unit specifically, then, you could change the trigger condition from the default "this" to "myUnit in thisList". Now the trigger will only fire if myUnit meets the trigger detection criteria; anyone else will be ignored. 

Thanks for the multiple ideas however unfortunately the best option of using the Set Owner link and setting any group member doesn't seem to work. The purpose of the trigger is so that a couple of AI joins the group of the person in the trigger. If the trigger is simply set to BLUFOR it works, however if I set it using the Any group member filter it doesnt. Using this option only works if it's group leader that enters the trigger which doesn't make much sense and defeats the purpose of the link.

 

Update: I've been testing it setting to a group member as trigger owner and setting the trigger to activate to group leader and it still won't trigger to anyone besides the trigger owner.

Share this post


Link to post
Share on other sites

Thanks for the multiple ideas however unfortunately the best option of using the Set Owner link and setting any group member doesn't seem to work. The purpose of the trigger is so that a couple of AI joins the group of the person in the trigger. If the trigger is simply set to BLUFOR it works, however if I set it using the Any group member filter it doesnt. Using this option only works if it's group leader that enters the trigger which doesn't make much sense and defeats the purpose of the link.

 

Update: I've been testing it setting to a group member as trigger owner and setting the trigger to activate to group leader and it still won't trigger to anyone besides the trigger owner.

 

That sounds like it might be a bug in Eden. Did you try the thisList option?

  • Like 1

Share this post


Link to post
Share on other sites

That sounds like it might be a bug in Eden. Did you try the thisList option?

Yeah thisList has always worked. I ended up doing something like "(myUnit in this list || myUnit2 in this list)" so that it includes all group members.

Should be bug, I've also had to manually create a description.ext to specify the author since the editor despite identifying the author in reality it doesn't show up.

Share this post


Link to post
Share on other sites

Yeah thisList has always worked. I ended up doing something like "(myUnit in this list || myUnit2 in this list)" so that it includes all group members.

Should be bug, I've also had to manually create a description.ext to specify the author since the editor despite identifying the author in reality it doesn't show up.

 

I can't tell if they just have that as a feature, that it doesn't create a description.ext for local testing or what, but i have the same, so i took the time and just made my own template instead of trying to find fixes because, who has time for that?

Here's that template if ANYONE needs it.

author = "NAMEHERE";
onLoadName = "MISSION NAME";
onLoadMission = "CREDITS / LINK / OR WHATEVER";
joinUnassigned = 1;
respawn = BASE;
respawndelay = 5;
disabledAI = 1;
disableChannels[]={1,2,3,4,5,6};
enableDebugConsole = 1;
respawnDialog = 1;
equalModRequired = 1;

class Header
{
	gameType = Coop;
	minPlayers = 1;
	maxPlayers = 50;
};

wreckLimit = 3;
wreckRemovalMinTime = 60;
wreckRemovalMaxTime = 320;
corpseLimit = 150;
corpseRemovalMinTime = 999;
corpseRemovalMaxTime = 9999;

class CfgNotifications
{
	class Message
	{
		title = "Notice";
		iconPicture = "icons\notice.paa";
		description = "%1";
		duration = 10;
		priority = 6;
	};
	class Assist
	{
		title = "Assistance";
		iconPicture = "icons\assist.paa";
		description = "%1";
		duration = 10;
		priority = 6;
	};
};

It also seems that if you leave the editor, and rejoin, it doesn't remember the settings w/o a description.ext with in the mission file.

Share this post


Link to post
Share on other sites

Hello, it's me again. For some reason turns out the "in thisList" method doesn't work in multiplayer as I had intended the mission to be aimed for. Atlhough I'd swear I used to have it working in multiplayer (perhaps I had only tested in single player) I can't recall the way I had done as I have no save from that "version". Given this unexpected issue I've come across and since setting trigger ownership doesn't work either, is there a way using sync to make this work? The original thread I mentioned one of the dudes mentions sync but so far the attempts I made to sync the trigger were unsuccessful. I've googled for information but the only thing I find is triggers syncing to waypoints not to units. Was the guy who mentioned it wrong? 

 

Update: I tested with a simpler standlone example and turns out "in thisList" actually works which means the error is somewhere else. Anyway, is there an alternative using sync?

 

Update 2: Found the error, in the condition, because I'm refering to non existant units, the condition gets no return to "myUnit in thisList" and thus cannot conclude wether the condition is true or false, is there some kind of command that simply returns false otherwise or something?

Share this post


Link to post
Share on other sites

Update 2: Found the error, in the condition, because I'm refering to non existant units, the condition gets no return to "myUnit in thisList" and thus cannot conclude wether the condition is true or false, is there some kind of command that simply returns false otherwise or something?

Simply check for existance/non-existance of units before checking if they're in list:

(!isNil "unit01") && (!isNull unit01) && (unit01 in thisList)

Share this post


Link to post
Share on other sites

 

Simply check for existance/non-existance of units before checking if they're in list:

(!isNil "unit01") && (!isNull unit01) && (unit01 in thisList)

The problem is that because unit01 does not exist the function "in thisList" returns no value and thus the condition final state is [TRUE + TRUE + ?] = ? Because of the blank it ends up not concluding wether the condition is true or not.

 

Update: Found out this exists for trigger conditions, it solves the problem.

Share this post


Link to post
Share on other sites

Put this in a trigger

 

Condition:

_unitname inArea thisTrigger

 

on activation:

//whatever your heart desires

  • 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

×