Jump to content
Sign in to follow this  
scifer

Triggers with no area

Recommended Posts

In editor, when you set 0 for x and y radius of a trigger, it will be activated at any place on map. But when you set this same value in scripts with setTriggerArea command nothing happens :confused:

_anything setTriggerArea [0,0,0,false];

How can I create a trigger in script that is activated every where on the map, without assigning astronomic values to its area?

Share this post


Link to post
Share on other sites

why not setting it to 20K big or whatever your map is,, whats the big deal???

To what end do you need an map covering trigger?

More info will help in getting answers.

Share this post


Link to post
Share on other sites
why not setting it to 20K big or whatever your map is,, whats the big deal???

To what end do you need an map covering trigger?

More info will help in getting answers.

This is exactly what I'm doing as a workaround. :o But I'm afraid and curious about such values lowering performance as variable sizes are assigned automatically.

Map covering triggers can be used to perform actions that default eventHandlers don't.

By the way. I made a trigger that fires when player detects enemies. This is one of the details that I couldn't find on BI wiki.

Share this post


Link to post
Share on other sites

Hello!

Change the condition of the trigger from this to true. That will make it trigger on start.

Kind Regards

Melvin

Share this post


Link to post
Share on other sites
Hello!

Change the condition of the trigger from this to true. That will make it trigger on start.

Kind Regards

Melvin

I appreciate you answer but I was referring just to the area.

Share this post


Link to post
Share on other sites

I have a few triggers setup in mine like this.

Condition

local player

On Activation

_dummy = [] execvm "script.sqf"

Share this post


Link to post
Share on other sites
I appreciate you answer but I was referring just to the area.

Hello again!

I may misunderstand, but as far as I understand from your post you want:

- To create a trigger from a script

- To have that trigger activate from anywhere on the map, without a huge radius (or instantly no?)

So I present to you the option to set the condition to true, that should work. Furthermore I'm pretty sure you use the

[i]yourtriggername[/i] setTriggerStatements ["this", "[i]whatever you want onactivation[/i]", ""]

to make your trigger do something.

Now if you change that to

[i]yourtriggername[/i] setTriggerStatements ["true", "[i]whatever you want onactivation[/i]", ""]

you have at trigger that cover your criteria.

If it still doesn't you need to explain better what you do and what you don't, if not it will be hard to help you :)

In editor, when you set 0 for x and y radius of a trigger, it will be activated at any place on map.

Are you sure about that? Because when I place a trigger on the map, with 0x and 0y it does not activate... (not by default anyway) If you set it to 0x and 0y and put ie. BLUFOR not present it will fire.

Kind Regards

Melvin

Edited by MelvinNor

Share this post


Link to post
Share on other sites

Yeah, as far as I understand it, if you want a particular condition for a trigger beyond the trigger's inherent Activation Type, you set the trigger's conditions to be something like (this && (your own conditions)); the "this" refers to the default Activation. Setting it to "true" instead would bypass the builtin Activation mechanism and ONLY activate the trigger when your own conditions become true. Depending on what the trigger's Activation Type was, you could probably convert it into a condition statement, then just make your trigger with the 0 area and set its conditions to be (true && (whatever its activation condition would have been)).

Not sure what your specific Activation Type was or whether it would actually be possible to do the above, but you haven't really told us what you're trying to do yet. At least in a way that I can discern the facts regarding the issue ;)

Share this post


Link to post
Share on other sites

Using setTriggerStatements to set condition to true is somewhat silly, when you could just run the same stuff directly in the script without any need for a trigger.

Using "true && someothercond" is silly as well, just use "someothercond", the true condition serves no purpose. However, you are correct with the "this && someothercond".

Share this post


Link to post
Share on other sites

Hello!

I agree SHK, but since we don't really know what he's trying to do, we can only help him with what he describes. :)

Kind Regards

Melvin

Share this post


Link to post
Share on other sites
Using "true && someothercond" is silly as well, just use "someothercond", the true condition serves no purpose. However, you are correct with the "this && someothercond".

Er, well, yeah, I guess you have a point; I kinda confused myself trying to figure out the discussion prior to my post, haha

Share this post


Link to post
Share on other sites

when i use a condition trigger i never include true in the condition field.

Example:

alive player

works just fine, no need to use:

true AND alive player

Edit: lol nvm, already answered.

wrong page X)

OP, you should tell us what is to trigger the trigger, what should trigger do, whats the purpos, then we will be able to help you.

More info please.

for checking if player is in a vehicle you only need condition in a small trigger and not cover entire map, as it will work no matter where he is... etc...

Edited by Demonized

Share this post


Link to post
Share on other sites
In editor, when you set 0 for x and y radius of a trigger, it will be activated at any place on map.

I think I saw it in Mr Murry's guide and misunderstood it. Actually what makes the trigger fires regardless of its assigned area is the replacement of "this" by other conditions. Is it right?

---------- Post added at 06:11 PM ---------- Previous post was at 06:01 PM ----------

To what end do you need an map covering trigger?

More info will help in getting answers.

I was trying to increase the "stress" variable in my Behaviour Jukebox script every time the player detects enemies.

But you answered that question on http://forums.bistudio.com/showthread.php?t=116084

Thank you very much.

Share this post


Link to post
Share on other sites
Actually what makes the trigger fires regardless of its assigned area is the replacement of "this" by other conditions. Is it right?

Yes. If you replace "this" with a condition of your own, the size and other activation settings of the trigger will be ignored.

Edit: unless, of course, your condition uses "thislist" variable. :)

Share this post


Link to post
Share on other sites
Edit: unless, of course, your condition uses "thislist" variable. :)

Why the trigger settings won't be ignored if you use "thislist"?

Share this post


Link to post
Share on other sites
Why the trigger settings won't be ignored if you use "thislist"?

Thislist is a special trigger variable, just like "this". It is an array which contains all units, who pass the trigger activation.

For example, if you have a blufor present trigger, thislist will have all the west units that are within the trigger area.

Share this post


Link to post
Share on other sites

Thank you for the help Shuko and LoneStar.

Share this post


Link to post
Share on other sites
if your looking to have your guy detect enemies automatically, i wrote a small script that did just that, you can rework so that it works on the player

http://forums.bistudio.com/showthread.php?t=112096

you can add your conditions for it as well (i marked where)

hopefully that helps

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
Sign in to follow this  

×