RjC_77 0 Posted March 10, 2007 Hi, Im trying to make the simplest of missions: A few soldiers patrol up and down a road whilst in safe mode and with limited speed. As soon as one of the soldiers detect the enemy (me), they will activate a guarding trigger (if OPFOR is DETECTED by BLUEFOR --> area is GUARDED by EAST). This shouldnt be too difficult to follow right...? Heres the problem: I noticed when i delete the trigger alltogether, the bluefor soldiers will still fire upon me as soon as they spot me. (with the patrolling soldiers being in safe mode) Without the trigger being around shouldn't the guards just keep patrolling even if they spot an enemy? Whats the use of a trigger then? Im a bit puzzled... Anybody? Share this post Link to post Share on other sites
He who dares 0 Posted March 10, 2007 have you tried setting them as careless. Share this post Link to post Share on other sites
RjC_77 0 Posted March 10, 2007 found out the problem... Its not the safe (or careless) mode, but the fact that i ordered the unit to engage at will. Ive now set him to never fire and it works perfectly now, but now a new problem occurs: when the trigger is activated the patrolguy will duck for cover and start running and stuff, but it wont fire... I suppose i have to add a script in the triggers init field that changes the never fire to engage and open fire as soon as the enemy is detected. What would the correct syntax be? Share this post Link to post Share on other sites
weedomatic 0 Posted March 10, 2007 I suppose i have to add a script in the triggers init field that changes the never fire to engage and open fire as soon as the enemy is detected. In the On Act. (on activation) field of the trigger put something like <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> enemyUnit setCombatMode "red"; where enemyUnit corresponds to the name you gave an enemy unit (not yourself) in its Name field. See setCombatMode for (some) more details. Share this post Link to post Share on other sites
Balschoiw 0 Posted March 10, 2007 It´s basically very easy to set up something like that with no scripting at all. Setup your patrol . Give them the desired waypoints in the desired "safe" mode and have a "cycle" waypoint to repeat the patrol endlessly. Now after the "cycle" waypoint add another waypoint, "seek and destroy" or "guard", speedmode "full", "engage at will" , etc. Usually that waypoint will not be reached as the patrol will always be on a loop bacause of the cycle waypoint. Now insert a trigger that detects enemy presence, or whatever you want to be the reason for the team to stop patrolling. In the trigger setup under "type" choose "switch" and finalize your trigger setup. Now place the trigger where you want it and use F5 or choose "synchronize" from the right menu and connect the trigger to the "cycle" waypoint. If enemies get into the trigger radius, the trigger will fire and the cycle will be broken and the units will move to the last waypoint with a different set of combat rules, just as you designed it. Share this post Link to post Share on other sites
RjC_77 0 Posted March 10, 2007 wonderful! Thanks a million! (i like that avatar of yours by the way; superfunny) *checkmark on list: 1 problem solved* now for the other 10000 problems.......hmmmmm edit: good heavens,... it actually works! Share this post Link to post Share on other sites
Balschoiw 0 Posted March 10, 2007 Triggers are actually quite powerful and in combination with waypoints can do a lot of stuff. Most people just don´t use synchronize and grouping of triggers that much just because they are not aware of the possibilities of these combinations. Glad I was able to help Share this post Link to post Share on other sites
RjC_77 0 Posted March 10, 2007 experimenting with this i stumbled upon one little thing i would like to ask about this: Is there a way to set a group of soldiers perform this switch from safe to combat/ guarding? I mean, like in the example above it mentioned one patrol. What if i have multiple little groups of soldiers working their patrolroutes independently for instance a base of some sort. In stead of assigning triggers to break the patrol routine of every little group, how do i do that for let's say every soldier from a certain side present on the map? recap: i have a trigger/ switch that activates once me or my men are spotted. How do i make every enemy soldier at the base or in a certain area stop the thing they are doing at the moment and start hunting for me? (a simple "you-are-detected-and-now-all-hell-breaks-loose" routine) Share this post Link to post Share on other sites
Balschoiw 0 Posted March 10, 2007 Quote[/b] ]In stead of assigning triggers to break the patrol routine of every little group, how do i do that for let's say every soldier from a certain side present on the map? You can use one trigger to break all of their waypoints. You can connect an unlimted amount of synchronizations from one trigger to variouzs waypoints. No need for an extra trigger for every single one You could also use a trigger covering the units you want to adress when the player is to near or whatever and list the trigger content , check what side they are on and then apply a bahaviour to all of them at once and order them to doMove to the playr´s position. But imo this is a bit too extreme as all enemies would exactly know where you are no matter if they have actually spotted you or not. Maybe adding a random function to the doMove command would make their approach a bit more lifelike. Share this post Link to post Share on other sites
RjC_77 0 Posted March 11, 2007 I understand that sending every single soldier to your exact spot would be overdoing it... Let's just say i keep a few groups like guards on hold in the base and send a single squad looking for me. That would be more realistic. Like you said it already (@balschoiw): I think it is possible to set up "clean sweep" type of missions (im referring to the opf mission: my fav) without using any scripting. Maybe only to occupy vehicles i would need a script? Or is this me being too positive...? Does this work out differently if you should use pure scripting to do this? (i.e.: units acting more "robotically" when not scripting) But anyway: thanks for your help. I am able to do tons more stuff in the editor now thet ive learned this little detail! Share this post Link to post Share on other sites
Balschoiw 0 Posted March 11, 2007 Quote[/b] ]Maybe only to occupy vehicles i would need a script? Not even for that. If you have the crew sitting around and give them one waypoint in front of their feet, careless, safe, never fire, etc and give them the second waypoint on their vehicle with GetIn, combat, Open fire engage at will and sync the first waypoint with your trigger in question, they will board their vehicle if the trigger is fired and get into their vehicle. You can give them as many waypoints as you want after that, but I guess a guard WP should be fine. You can even place them into the vehicle from the start , use setfuel 0 on the tank, so it can´t move and setfuel 1 the tank within the trigger´s OnActivation line. BTW, the "bug" that crews exited their vehicles when the fuel was set to 0 seems to be fixed with 1.05 version. This way they will start their engine once the trigger is fired and move on the their next waypoint. Quote[/b] ] (i.e.: units acting more "robotically" when not scripting) Not really as both, trigger defined behaviours and scripted ones are the same as the use the same Arma engine commands. It´s the same code. For sure you can define the behaviour more steady with a script but sometimes it´s good to have a bit of variety within the mission. Scripts that don´t have such often look weird ingame, for example a doMove getpos player scriptline is imo in most of the cases looking surreal as enemies out of nowhere know where the player is and are hunting him with the crystal ball in their hands. You know what I mean ? If the script is balanced it´s ok, but sometimes it just doesn´t end up right. Share this post Link to post Share on other sites