Jump to content
Sign in to follow this  
Tom_Anger

Check Area Trigger upon entry, death, leaving

Recommended Posts

Simply put, I need to know how I can implement the ability to check a trigger condition every time a player enters an area, is killed, or leaves the area. I have tried to make this happen with the Repeatedly function, but it does now work.

Here is a breakdown of what the triggers are supposed to do. Lets just work with 1 zone to make the idea simple.

1. If no one is in the triggered-area nothing is done and that zone is deemed "neutral"

2. If upon entry from OPFOR (similarly done for BLUFOR) the triggered-area activates and starts a countdown of 30 seconds. After the timeout it sets a variable called SEC which represents that the team is securing the area.

2a. I have another trigger which is dead center in the primary trigger-area (smal small) which activates when the player gets to it. It checks for this SEC variable and depending on what team SEC is equal to - that is the team that then becomes owner of that area. So in essence it is a 2-tier situation to own the base. Larger primary to secure then the 2ndary to take it.

3. Since this is for 2 teams to fight each other the triggers are doubled so that it can check based on which team enters the zone. In other words, a set of OPFOR triggers - 1 for the trigger checks which I mentioned above and the other for the base ownership. BLUFOR would have a similar set for them.

Scenerio and issue:

Taking then neutralizing

2 OPFOR players enters the area (I have a simple hint box for testing that informs me that OPFOR is securing the zrea). If then 1 BLUFOR enters the area nothing happens which is correct. If a 2nd BLUFOR enters, the trigger stops/deactivates. This is also correct.

Attempt to overtake and issue

If a 3rd BLUFOR now enters the area I would like to have the tables turned and now see the test hint box show me that BLUFOR is securing the area. This does not happen.

How overtaking seems to currently work

I've been testing this with me and AI's.

The only way I found that BLUFOR would be able to secure the area is if all OPFOR left the zone after they started to take it (that triggers conditions which makes it happen) or if ALL OPFOR was killed in the area.

I get mixed results as I try different things with triggers and conditions so I was wondering if there was a template out there that helps accomplish this or if someone knows of a script that does this. Please don't say UNPBO someone's maps. Having to unpbo and disect some and figure out what they are doing can take forever. I am looking for input on how to do this from a coder who knows. Thanks for your time.

I am thinking a script or method to check how many of each player is in the trigger-area EVERY TIME a player enters, is killed, or leaves the trigger-area. Help!!!

I will continue to make attemps and get this to work, but in the meantime I will check back here to see who has the answer.

Share this post


Link to post
Share on other sites

For the area domination, I'd use a looping script to check against the desired conditions every second or so. Use either one <side> present trigger for each side, or a filtered anybody present trigger to check how many units are in the area. Use a script that compares the two count thisLists to calculate domination. When the right conditions for one side to cap exist, a global variable should be set. The seized by trigger is also probably suitable for this purpose.

Use either a single anybody present with side filtering conditions and effects or two more side present triggers for the capture point. This trigger(s) should require the appropriate value for the global variable to activate.

Share this post


Link to post
Share on other sites

Shuko - that was pretty much what I was looking for so thanks.  Your coding is easy to follow and the comments helped.  Also I am very glad you chose .sqf.

I PM'ed you on a little more.  I am looking to implement that type of script for more than one base they must be taken in a specific order starting with the center then work your way out heading in the direction of the enemy spawn.  I believe a template can be created if I took what you had and used a similar script for each base, but I am thinking the redundancy may cause slowness so the possibility of the 1 script to accomodate multiple bases may be better.  Not sure how much work that is to do, but it looks like just adding in the bases within the _b (while-do) loop may be the key.

Much more easier to discuss on teamspeak or ventril, but we can chat in PM's.  I may try to work your script for this (if that is OK).

EXAMPLE

Lets use 5 bases for the example:

(alpha, bravo, charlie, delta, echo)

At the beginning

east will own Delta and Echo

west will own Alpha and Bravo

So if you were OPFOR (east) both teams would fight for charlie 1st (the neutral one) and if OPFOR won it would work this way

Charlie --> Bravo --> Alpha  (Win)

It would go in the opposite direction if BLUFOR won charlie.  

Charlie --> Delta --> Echo (Win)

Kind of like a timeline sort of thing

(west) <--Alpha---Bravo---Charlie---Delta---Echo--> (east)

So OPFOR cannot be allowed to take Bravo until they take Charlie 1st and they cannot go to Alpha until they take Bravo.  Likewise for BLUFOR going the other way.

I hope this is clear enough to understand.  The gametype is explained a bit in the Multiplayer missions section under the title NEW GAMETYPE and this project is in demand.  Many Joint Operation players from Novalogic have upgraded and have or are getting this game and this is the gametype they are mostly comfortable with.

To boot - I am also looking to have a waypoint show in the game as the teams are trying to get to their bases, but that can be for another time.  I appreciate your help and I understand the logic you wrote.  Just trying to see what would be the most efficient method to make this happen.  When this is done I will be sure to mention your name - you pretty much gave me the response and logic that I was looking for to move forward.

Share this post


Link to post
Share on other sites

http://www.derfel.org/arma/bases.zip

Can you get few people to test it (add a couple of playable men on both sides)?

If it works as you wanted, Ill try to clean it up and make it more dynamic (so it works with any number of bases and regions).

Share this post


Link to post
Share on other sites

Shuko if we can get this project functional you don't know how much that would mean to many. Every day I see friends getting the demo and getting ready for the full version. I have spent the past 2-3 days with your template in the original post and trying to tweek it. Some of it worked and in other parts I had problems, but I understand the logic behind how you wrote it so that is good, lol. I will check your newest post. Thanks for not giving up on me. We can talk on TS or in PM's or at a website of your choice if you don't want to clutter this post up and then when it is all set a template will be created with a new post. Anyway - I am checking it out now. Thanks again.

Share this post


Link to post
Share on other sites

I made a template map for you to open for the idea.  This map does nothing other than show you the markers and stuff.  The picture will explain more.

AAS basic idea mission (unplayable just for map viewing)

Here is a link to the picture (shown below) in large sized format

http://downloads.shadowcompanyelite.com/arma/images/aas.jpg

The screenshot should hopefully help explain more on this concept.  For testing we can keep the time limit to 30 to secure a zone - ultimately a parameter on map load screen would be beneficial, but stickng to the idea is what to stick with for now.  Your recent script is closer, but no need for 3 alphas, 3 bravos, or 3 charlies.  I hope this pic will help explain.

Keep in mind each team will already own a portion of the zones at the start.  That is for spawning purpose (will cross that bridge once the general game idea is working).

If west takes charlie, they move onto delta.  Although they left charlie to go to delta that does nothing to charlie other than leave it vulnerable to an east attack.  The color of the markers should change bases on capping.  Changing marker colors is trivial so not a huge concern.  I am using a simple bunker in the center of the zones to show the capping locations.

Please keep in touch and let me know if there is anything else I can do to help.  You have done the legwork which is huge and very much appreciated.

aas_800x640.jpg

Share this post


Link to post
Share on other sites

What you gave me in this latest version is extremely close if not exact so I will test further and let you know.

BTW I can be reached at tomanger@comcast.net, MSN at the same address. I am director of a couple of gaming sites as well so I hope once this is fully operational we can set it up as a template. Looks great!!!

I like the idea that the players only have to concentrate on the green base. I am guessing the box in the lower left was for testing purpose so I may look to make that small

[10: (base) under attack by (team)]

[9: (base) under attack by (team)]

[8: (base) under attack by (team)]

etc.

I am going to test it with some people and see if the neutralization works and if the tug of war effect occurs. Thanks so much.

Share this post


Link to post
Share on other sites
I am guessing the box in the lower left was for testing purpose so I may look to make that small

[10: (base) under attack by (team)]

[9: (base) under attack by (team)]

[8: (base) under attack by (team)]

Yes, if you check the code that line is commented as debug, and can be removed. All those under attack etc messages are done with titletext (white text in the bottom center).

Share this post


Link to post
Share on other sites

I would love to chat with you on teamspeak sometime. TS info is at the end of this post. I log in under the name SCE_FATMAN

Here's the scoop. Everything worked great. What we discussed was if Charlie is taken that it should not neutralize the next base in the list and that should remain the other team's base.

I made a simple change by commenting out the section of code where you see

// assign new target base and reset values

I commented out the setmarkercolor and _s = "neutral" section so that no ownership changes. I will continue to test this out.

Example:

If BLUFOR captured CHARLIE, CHARLIE should change to BLUE (which it does) and their focus is DELTA, however, DELTA needs to remain OPFOR's base and not be neutralized. At this point no bases are neutral and they fIght back and forth where the battle progresses.

With the commented out pieces it looks like it works. Still testing. I like the fact that I can add more triggers, then subscriptthem in the script calling to have more bases to have to capture.

TEAMSPEAK INFO

Normal TS IP's and Web Addresses

82.165.149.122:8767

u15192507.onlinehome-server.com:8767

217.160.242.34:8767

www.shadowcompanyelite.com:8767

Server Password

ecs

--------

Back-Up Teamspeak IP

66.135.38.11:8767

Server Password is ecs

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  

×