Jump to content
Sign in to follow this  
Rail82

Stopping vehicle inside a trigger and moving again with radio trigger

Recommended Posts

I'm having some problems with a checkpoint mission. I have several civilian vehicles spawning randomly, with differing probabilities of presence. All the vehicles have a 10% chance of being a suicide car bomber. I have my checkpoint set up with my bar gate and the "escape" routes blocked off so AI won't try to bypass the checkpoint.

Here's what I want to have happen. Since any car can be a suicide bomber, I don't want to let them into my checkpoint without stopping the vehicle and approaching it with a soldier first. I then want to use a radio trigger to move them through the waypoint once I "clear" the vehicle.

I set up an anybody present trigger with a _unit stop true command for every vehicle, but obviously, when ANYBODY enters the trigger ALL the civs stop moving no matter where they are on the map. I only want them to stop within the 10x10 trigger area. I've been playing around with the triggers and waypoints and have also tried the disableai and lockwp commands but I'm running into the same or similar issues. I want this mission to be able to get hectic so I don't want AI stopping all over the map and reaching the checkpoint one by one. I want to be able to get backed up with vehicles, or have a nice little break with no or little action, based on how and what vehicles spawned.

Also for the triggers, I can't figure out how to make it universal, so any vehicle will stop in the first trigger and 1 repeating radio trigger will move the vehicles through the checkpoint once cleared. I have way too many civ vehicles to individually assign them radio triggers, and since the mission has a large amount of randomness too it, I will never know which vehicle unit is at my checkpoint at any given time.

Or, does anyone know a way I can link these commands to the opening and closing of the gate? Like if the gates down vehicle will stop, and if gate is opened they will proceed through? I can make the gate open and close via trigger.

I know I read something about this in a thread a week ago or so while looking for something else, but for the life of me I can't find it now.

Thanks

edit:

I also forgot to add that I only want civs to respond to these triggers, an OPFOR force advances on the checkpoint at some point and I don't want them to stop at my bar gate, even though they more than likely won't be getting that close ;-)

Edited by Rail82

Share this post


Link to post
Share on other sites

I think you'll find it very difficult to have more than one vehicle at a checkpoint at any one time, triggers find it hard to keep track of multiple objects entering and leaving the trigger area. Single vehicles are quite easy.

See if you can load this small example.

http://www.sendspace.com/file/ygn8on

Share this post


Link to post
Share on other sites

Well I only have OA so I can't look at the mission inside the editor, but taking a look at the mission.sqm it looks like your using a trigger to forcespeed 0 if the gate is closed and on deactivation (when the gate is open) to forcespeed 20, and your opening the gate via an alpha trigger, and using vehicle waypoints to close the gate?

I think I figured out a way, just need to test it with more than 2 vehicles now, to see how it does with a lot.

I put waypoints in front of the bar gate with the condition set to checkpoint_done, I then made an alpha trigger and a bravo trigger.

the alpha does:

MYBARGATE animate ["barGate",1]; checkpoint_done=false

and the bravo does:

MYBARGATE animate ["barGate",0]; checkpoint_done=true

Like I said, it works with 2 vehicles, not sure how it will respond with multiple vehicles, especially if they get bunched up at the checkpoint, going to test it with more vehicles.

If I'm understanding your way correctly, I'll try that too and see which works better.

edit:

well tried my way, and while it did "work" so to speak, it was cumbersome, and like you suggested it didn't perform well when a lot of cars where in the area. The problem arised when more than one vehicle was at it's waypoint that had checkpoint_done as it's condition. In cases like this, if I open the gate for the first car and then try to close it again, since the 2nd car already met the condition to move to the next waypoint, it just keeps going and tries to ram through the gate, even though their waypoint is set to safe and limited. Because all the spawns and probabilities are random, a few times when I tested the mission I was able to succesfully check and clear every vehicle without issue, because they came spaced out a little bit, but a majority of the time, 2-3 vehicles are arriving at the same time, and that's what causes the problems. I might have to space them out a little more, but since it's random I really won't be able to test whether or not they come in bunches. There is no way I can account for every possible spawn pattern.

I think I understand your method, so I'm going to give that a shot and see if the chaos is a little more controlled.

edit2:

Just tried to set up a test using your method but I couldn't get it to work for me, I must have missed something when looking over your mission.sqm.

Edited by Rail82

Share this post


Link to post
Share on other sites

That's exactly the problem, the trigger can't cope with multiple events as the conditions are already meet.

I'm thinking that a trigger placed in front of the main trigger could be used to halt the next vehicle if the main trigger is still active. There are a couple of commands that could help with that.

Triggeractiveation and Triggeractivated. the extra trigger would act as a stacking point.

You could have several and when the main trigger is clear move them all forward to the next trigger.

As for getting things to run in OA you can usually just swap the offend unit in the mission.sqf for one that you have and remove the offend addon if that is a problem.

But you seemed to have the idea anyway.

Edited by F2k Sel

Share this post


Link to post
Share on other sites

yeah after looking at how both ways functioned, they are really just 2 sides of the same coin.

I'll look into using Triggeractiveation and Triggeractivated, if I can get that to work, that might do the trick. I'm trying really hard not to have to take the randomness out of the mission.

My wife hates video games so I don't get hours at a time, I need to sneak a half hour to an hour at a time, so I'm trying to make a bunch of "quick hitter" missions that won't play out the same every time that cover all the different types of missions I like in a milsim. So making them as random as possible is the ultimate goal, while still being able to function the right way consistently.

Edit:

Just figured it out. All I needed was a trigger before the checkpoint, set to CIV present and onact: checkpoint_done=false. Now I don't even have to close the gate and they still stop at the checkpoint. Obviously the next thing will be linking the gate to the new trigger so the trigger is only active when it's down, but I think that's where the triggeractiveation you mentioned will come into play... I'll have to look into it later, but right now my mission is at least functional so I'm going to play it as is, for the time being.

Thanks again for your help. All I need is for someone to give me ideas on how to accomplish things, and I can usually piece them together myself. This is the second thread you helped me solve my problems in, and I want you to know it's really appreciated. Thank you for your time.

Edited by Rail82

Share this post


Link to post
Share on other sites

I like the challenge myself, I never actually play any missions.

I also got a little further and the extra triggers really helped but the problem comes when a vehicle approaches in the other direction. I can give the other vehicles priority which works but the problem comes when the low priority vehicle is in the main checkpoint and another approaches from the opposite side. I don't know if I can get it to give way.

I'm currently looking at double barriers as the vehicles still keep hitting the posts. They should remove the post from the barrier that would work much better or just remove the collision detection from it.

I've also added some sound to the gate.

Share this post


Link to post
Share on other sites

There is something special about taking an idea in your head and bringing it to fruition in the game. It can be extremely frustrating at times, but when it all works right it can be extremely rewarding.

Yeah, I never even thought of vehicles coming from the other direction. Now that would be intense if you can get it to work properly. Maybe set it up like a one-way construction zone irl. One side clears, then they flip the signs and the next side clears. Maybe radio triggers to activate one side or the other. Let one side stack up as you check and clear vehicles from the other, then switch to the now stacked up side and deactivate the side you were just letting through the checkpoint.

Not sure exactly how you'd implement that, but in theory it seems viable. But, as we all know theory is theory for a reason.

Share this post


Link to post
Share on other sites

No improvements yet, it was looking good until I moved a few triggers and it all fell apart.

Now the cars keep going off road, I can't see why moving a trigger would cause this.

Using a double gate worked better for allowing cars through trucks being wider flatten it.

I've made a post over at dev-heaven.net to see if we can get the gate model changed.

http://dev-heaven.net/issues/17805

Edited by F2k Sel

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  

×