Jump to content
Sign in to follow this  
twistking

Trigger conditions

Recommended Posts

Hello,

how can i emulate the default trigger activation  conditions ("present", "detected by", etc.) as an expression in the trigger condition field?

The reason is, that i would still like to use those editor-placed triggers instead of more sophisticated scripts, but i find them a little bit lacking and would like to "modify" them. Also this would help if you need multiple conditions fullfilled that are in the same area. (f.e. "redfor not present", "blufor present" with the same trigger and trigger area.

 

I am looking for expressions to put in the condition field to have triggers that:

- Detect when an object (unit, vehicle) is present or not present (similar to what is already a preset condition, but with the ability to call object by name and not have to link it to the trigger as owner).

- Detect when units of a specified coalition, that are in the trigger area detect units of another specified coalition (similar to "detected by" but the other way round basically).

 

Also are the preset conditions in some way more optimized for performance instead of coded conditions that do the same? Or in other words: Is a preset Eden trigger conditions spiced with magic sauce, or is it just a nice UI for the same line of code you could put in the condition field?

 

Thanks!

Share this post


Link to post
Share on other sites
5 hours ago, twistking said:

Also this would help if you need multiple conditions fullfilled that are in the same area. (f.e. "redfor not present", "blufor present" with the same trigger and trigger area.

 

 

I have a solution to that.

Place 2 boxes on the map. Put them in an out of the way place in the corner of the map. Name them   box1   and   box2.   

Place a trigger on the map.  The trigger fires only if both boxes are destroyed.  (!alive box1) && (!alive box2)

Place 2 more triggers on the map.   

trigger:  If redforce is not present, then delete box1.

trigger:  If blueforce is present, then delete box2.

 

So blueforce occupies the ground and that trigger at the top of this post fires - and presto!  Done!

 

.

 

 

 

Share this post


Link to post
Share on other sites

@Joe98 I don't know if i understand you correctly, but why not just use variables instead of destroying precious boxes. trigger a on activation > trigger_a_fired = true < trigger b on activation > this and trigger_a_fired <

btw. i think i figured out how to check for "present" and "not present" with code > !(xyz in thislist) < , but how would i check for subjects being detected by enemies or subjects detecting enemys?

 

Share this post


Link to post
Share on other sites
3 hours ago, twistking said:

how would i check for subjects being detected by enemies or subjects detecting enemys?

 

Take a look at knowsAbout. Read all of the documentation, particularly where it pertains to A3. It can be tricky to implement, mainly due to having to find the "sweet spot" for your purposes.

  • Thanks 1

Share this post


Link to post
Share on other sites

Oh, and to your original question, I think the "preset conditions" are really just that - simple presets of basic conditions for your convenience. Using the condition field allows for more complex/specific conditions.

  • Thanks 1

Share this post


Link to post
Share on other sites
42 minutes ago, Harzach said:

 

Take a look at knowsAbout. Read all of the documentation, particularly where it pertains to A3. It can be tricky to implement, mainly due to having to find the "sweet spot" for your purposes.

 

thanks. i will test some values, but i don't even need it that precise. until now i simply checked for combat state or similar, or used sentry (?) waypoints to trigger an ambush. having a custom detected trigger seems just so much "cleaner". could you maybe push me in the right direction for the syntax?
for example:

condition:
any independent unit in thislist that knowsabout any player/client(MP) (isplayer?) > 1
or
any independent unit in thislist that knowsabout any blufor unit > 1

Share this post


Link to post
Share on other sites
{_x knowsAbout player > 1} count thisList > 0

something like this, but i would like to specify that it only counts independent units and i would like to run it on a dedicated server, so "player" won't cut it. unfortuantely i have no clue how to archieve this.

 

*edit* oh, i could probably use the eden trigger UI to limit it to independet only (independent "present") and then run the condition as above. only problem left would be "player", because it will not work in MP.

Share this post


Link to post
Share on other sites
1 hour ago, twistking said:

{_x knowsAbout player > 1} count thisList > 0

 

this does work, however for MP compatibility i would need to replace the player with either "any player" or "any unit of specific group" or at least any unit of specific coalition. any ideas?

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  

×