Jump to content
Sign in to follow this  
katipo66

Markername in thislist for seized by trigger

Recommended Posts

How can i make the condition true only if marker is inside a trigger with seized by activation? markername in thislist or "markername" in thislist doesnt seem work.

I am using upsmon with a way point marker inside 2 seized by triggers one for opfor another for blufor overlaying each other, depending on who seizes the trigger the marker moves either way to the next pair off triggers and so on.

What i dont want is units seizing other triggers while moving to the markers position.

Share this post


Link to post
Share on other sites

I think you're overcomplicating it.

The direct answer:

I don't think markers activate triggers. So you'll probably need to determine manually if the position of the marker is inside the zone.

If it's a circle then you can do:

getMarkerPos "mymarker" distance getpos mytrigger < _trigger_size

If it's another shape, then you need more complex math. Search.

The proper answer, however, is probably that you don't need to do any of that.

If you set a bool for each trigger, and each trigger tests the previous triggers bool, then you can fix the order in which the triggers execute:

trigger 1

condition: this

acivate: trg1_west = true

trigger 2

condition: this && trg1_west

activate: trg2_west = true

trigger 3

condition: this && trg2_west

activate: trg3_west = true

etc.

If you have opposing sides you could do this:

EAST trigger 1...

trg1_east = true; trg1_west = false

Hope it helps.

edit: just know that with several triggers you may have to turn on/off multiple bools. Perhaps keeping a count is an easier system? I guess it depends on what you want.

Edited by wamingo

Share this post


Link to post
Share on other sites

Thanks wamingo,

I think i tried the bool option as per Demonized instructions but then i realized that the marker could move backwards or forwards repeatedly therefore ruling that option out?

Ill have a go at doing it manually as per your first suggestion as it is an ellipse

Share this post


Link to post
Share on other sites

BIS_fn_inTrigger is what you're looking for. Something like:

this && [getMarkerPos "markername"] call BIS_fn_inTrigger

Not 100% sure about the function name, place the function module and check it out yourself.

Edit: Realized there probably is a parameter for the trigger name as well.

Share this post


Link to post
Share on other sites

there is also the trigger activated command.

not sure if its a one time value or a dynamic one, easy to find out.

having a sleeper script running:

while {true} do {
sleep 5;
if (triggerActivated west1) then {"marker1" setMarkerColor "somecolor"; "marker1" setMArkerPos someposition};
if (triggerActivated east1) then {"marker1" setMarkerColor "somecolor"; "marker1" setMArkerPos someposition};

if (triggerActivated west2) then {"marker2" setMarkerColor "somecolor"; "marker2" setMArkerPos someposition};
if (triggerActivated east1) then {"marker2" setMarkerColor "somecolor"; "marker2" setMArkerPos someposition};

etc....
};

Share this post


Link to post
Share on other sites

you made me unsure so I went ahead and did it...

http://www.gamefront.com/files/20538684/test_Seize%26Hold.Desert_E.zip

the gist of it is:

condition: not already captured && previous zone captured

activation: capture; opposing team uncapture.

Should work back and forth endlessly.

note: I hope it's clear though I made a second set of triggers needlessly.

Share this post


Link to post
Share on other sites

i checked the functions library and BIS_fn_inTrigger is correct, ive included the trigger name like below, is that the correct way?

this && [getMarkerPos "markername" ,triggername] call BIS_fn_inTrigger

Thanks for the responses, and thanks for that mission wamingo, its not what im after but thats great to have/know :D

sorry i should have explained better, im only using one upsmon waypoint marker which will be used by both factions.

There are going to be sets of seized by triggers such as your example with the single upsmon waypoint marker inside one of those sets of triggers, so in one of the middle sets.

The idea is the factions will clash at the pair off triggers with the marker in it and whom ever seizes the trigger the marker will move forward to the next set of triggers and so on

"Markername" setMarkerPos getPos triggername; 

This all works somewhat in my test mission on utes but every now and then units from either side while moving to the marker will move over the other triggers and inadvertently seize them and therefore moving the marker?

Share this post


Link to post
Share on other sites

BIS_fn_inTrigger 

Is there a way using this to determine if a certain type of vehicle is in the trigger? Like a subclass classname "M1A1" or "tank"..?

I have a script that spawns a random vehicle.I need to get the type of vehicle thats in the trigger so the players are assigned the proper objective. ie, blow up the tank, blow up the plane etc.

Edited by Iceman77

Share this post


Link to post
Share on other sites
BIS_fn_inTrigger 

Is there a way using this to determine if a certain type of vehicle is in the trigger? Like a subclass classname "M1A1" or "tank"..?

I have a script that spawns a random vehicle.I need to get the type of vehicle thats in the trigger so the players are assigned the proper objective. ie, blow up the tank, blow up the plane etc.

Hard to say, I can't even get it to work.

I'm not even sure this is the correct way round

this && [getMarkerPos "markername" ,triggername] call BIS_fn_inTrigger

Looking in the function it should be trigger then position but it still fails.

Share this post


Link to post
Share on other sites

I hope they iron out the kinks in some of these functions.Instead of having to use large scripts or w/e we can reliably resort to using these functions without the seemingly random reliability of some bis functions.

Share this post


Link to post
Share on other sites
why not just use distance checks instead? quick, and i asume less load, ( no extra functions called )

please eleberate all mighty demonized :man3:

Share this post


Link to post
Share on other sites

allright, if you want to determine if a marker is within a trigger area, gather the size of the trigger and measure if markerposition is within half trigger size, position.

_size = [url="http://community.bistudio.com/wiki/triggerArea"]triggerArea[/url] trigger1; // result is [200, 200, 45, false]
if ( (getMarkerPos "marker1" distance trigger1) < ((_size select 0)/2) ) then {
hint "marker is within trigger area";
} else {
hint "marker is NOT within trigger area";
};

Note, this only really works 100% accurate with round trigger areas, a and b axis that are same.

When using on rectangle trigger areas, you need some more math to recalculate it, im sure someone has a formula for you somewhere, ive just used to add up the _size select 0 and 1 and then divide that by 2 to get half approxmiate, all depends on your need for acurate readings here.

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  

×