OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: dematti on 14 May 2007, 18:38:28

Title: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 14 May 2007, 18:38:28
hi,

I'm making this mission where soldiers patrol a town wich they have to defend soon as the enemy's arrive.
I set up cycle waypoints so the blufor keeps patrolling the town without end.
to let them patrol in a realistic way I use behaviour "safe" (only waypoint in wich they walk (except careless))

So heres the big problem; soon as a shot goes off near the location of a patrol they just stop moving, lie down and hold position. Even after hours they dont get up and proceed with the patrol (ive tried it)
Off course, this mission has become a complete disaster just because of this.

Help would be verry welcome, i've spent a lot of hours creating this mission.

thanks very much

Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: smoke52 on 14 May 2007, 20:18:39
I read in another post that you can break the cycle waypoint. I added it to my mission but I haven't tested it yet. To do this just make a trigger activated by whoever, type "SWITCH", then syncronize the trigger with your cycle waypoints.

You can also make more waypoints after the cycle, so when it breaks the cycle they will go to the next you make. for example:

1. move
2. move
3. cycle
4. move
5. guard

Another thing you could do is add to the trigger's on act field a small script with something like

_guards = [guard1,guard2,guard3];

_guards setCombatMode "RED"
_guards setBehaviour "COMBAT";

or whatever you feel necessary. im sure someone with better knowledge of the editor could help cause im still new myself :)
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 14 May 2007, 21:03:26
thx smoke

thats nice never thought of it :)  I can sure use it on some of the patrols.
Need some help on the scripting stuff though, I got no experience in any of that :confused:
I was thinking more of a way to lower their weapons while on "combat" behaviour, which will make them walking, right?  :yes:
i'll trie it out anyway
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: smoke52 on 14 May 2007, 23:31:31
yeah i know what you mean and i would like to know as well!
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 14 May 2007, 23:46:02
as a player you can shoose to raise and lower weapon (lowering will make you walk)
default key= r
maybe we can do it with the AI soldiers also? (then they will also walk while on combat behaviour)
something in their init or waypoints maybe?
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mr.Peanut on 15 May 2007, 19:06:04
The following text is from the ArmA Action Reference List on the Biki:

Code: [Select]
WEAPONINHAND / WEAPONONBACK

unitName action ["WEAPONINHAND",<target unit>]
unitName action ["WEAPONONBACK",<target unit>]

Soldier 'unitName' does nothing, 'target unit' moves his weapon from/to the safety
position (gun held across chest pointing at the ground). Change is persistent with
player, but AI units will change back to suit their current behaviour mode. AI
generally keep their rifles safe unless moving or targeting.

Example: SoldierOne action ["WEAPONONBACK", SoldierTwo]

Also keep in mind that you can use the commands setWaypointBehaviour  and setWaypointCombatMode to alter any given waypoint. Remember that a group's waypoint 0 is where they are placed in the editor, so for your waypoints start counting at one.

Let's say you want all your waypoints to change from "SAFE" to "COMBAT". Let's say you have 5 editor-placed waypoints for group myGrp. You could place a trigger in your map with the condition you want(detected by East, repeatedly) and in the On Activation put:
Code: [Select]
{[myGrp, _x] setWaypointBehaviour "COMBAT"} forEach [1, 2, 3, 4, 5]
In the On Deactivation put something similar to switch them back:
Code: [Select]
{[myGrp, _x] setWaypointBehaviour "SAFE"} forEach [1, 2, 3, 4, 5]
This is untested, but it should work....  :whistle:

Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 16 May 2007, 00:15:47
{[myGrp, _x]  #setWaypointBehaviour "COMBAT"} forEach [1, 2, 3, 4, 5]
error type any, expected string
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mr.Peanut on 16 May 2007, 03:26:34
You have to set the name of your group of guards to myGrp, or something else. So make sure in the init field for the leader of your guards:
Code: [Select]
myGrp = group this
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 16 May 2007, 19:11:31
ok got the code running (no error messages)
but soon as gunshots fire near them still lie down, hold position while they should be continuously patrolling
they dont even look for cover they just stay in formation and lie still.
i wonder why this hasnt annoyed anyone before, to me it ruins a big part of what i like in this game
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mr.Peanut on 16 May 2007, 21:40:24
Well, I don't know what to say. What is the combat mode set to on your waypoints? I suppose you could disable the move and targeting and then turn them back on.

In the detection trigger On Deactivation change to:
Code: [Select]
{_x disableAI "AUTOTARGET" ;_x disableAI "MOVE"} forEach units myGrp ; {_x enableAI "AUTOTARGET" ;_x enableAI "MOVE"} forEach units myGrp ; {[myGrp, _x] setWaypointBehaviour "SAFE"} forEach [1, 2, 3, 4, 5] ;
I am going out on a limb here. The code above is correct, but I do not know if it will give the desired result.

Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 16 May 2007, 23:02:23
never mind mr.peanut thanks for the help anyway
tried the code and some others in many different ways, see some changes but still they dont move
I think you should try, its fast just give group some waypoints on safe and fire into the air when near them
you'll see its VERY annoying. It means you cant let soldiers walk because you are never sure they get to their last WP.
A simple bullet or 5 flies overhead and the patrol just stops (when on "safe")
Maybe there is no solution, maybe its a bug i dont know
help is off course still welcome altough i"m not counting on a solution anymore (after almost 4evenings of trying and trying)
I even had a nightmare about the code snippets :D
see ya
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 17 May 2007, 00:01:58
ok got a breakthrough i think
we got a bug im pretty sure
if you place a group in editor: first waypoint combat, 2nd safe
more then half of the squad stays at the end of the first waypoint, only some of them will actually go to the 2nd.
They cant go from combat mode to safe mode, half will stay stuck.
can someone report this or something?
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mandoble on 17 May 2007, 00:27:16
Certainly there is a bug there, in fact two, and quite important ones.
This is how a group in safe mode behaves:
If they detect shooting nearby they switch to combat and will lie down holding position until they detect AN ENEMY causing the shots. Then they'll engange and when clear, they'll proceed with next waypoint. And doesnt matter the behaviour set in next waypoint, they'll never return to safe.

And now comes a funny test, add a blufor group with some waypoints (set SAFE in all of them), place the player near them, also blufor. When game starts, fire at the ground in front of the leader, all will lie down and will keep there forever trying to locate the enemy causing the shots, they'll not move.

Now repeat the test, but place an OPFOR soldier near them and at their back. The opfor soldier will fire, the blufor ones will return fire killing it AND this time the group will resume its waypoint plan, but in AWARE mode.
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: rhysduk on 17 May 2007, 00:35:44
dematti,

First of welcome to OFPEC. :good:

In order to try and keep the forums shiny and tidy, we encourage members to not double post.
You can Click the MODIFY (http://85.17.58.182/smf/Themes/OFPEC_armaforum/images/buttons/modify.gif) button and modify your previous post.

Rhys
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mr.Peanut on 17 May 2007, 01:59:39
Looks like a bug in the FSM. Anybody have the time to zip a demo and report the bug to BIS? Is the bug independant of the units' skill?
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: h- on 17 May 2007, 09:13:02
Quote
And doesnt matter the behaviour set in next waypoint, they'll never return to safe
At least in version 1.05 this was not true.

Yes, the group will not change it's behavior immediately to what the waypoint tells them, it takes time, but they did change their behaviour eventually..

Encountered this while writing a random patrol script (which I never finished because someone else wrote a better one..)
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mr.Peanut on 17 May 2007, 16:19:49
Quote
..., but they did change their behaviour eventually..
How long was eventually? Does this mean the 1.06 patch is bugged or not?

Quote
(which I never finished because someone else wrote a better one..)

Don't you just fucking hate that? It makes your life suddenly easier, but causes shrinkage.
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: Mandoble on 17 May 2007, 18:00:39
the problem is there, in 1.07 beta, so I assume the problem is also in US 1.06. I did wait several minutes (case where the troops moved on after detecting and killing the enemy) and they never switched to safe again. They were just moving between two waypoints, both with "SAFE" in behaviour box. But in the first test, my firing in front of them and they being unable to find any enemy nearby, they simply never moved and this was tested in both 1.05 and 1.07 beta.
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: h- on 17 May 2007, 21:46:04
Quote
How long was eventually?
Never measured it but it was fairly long..
Of course this doesn't mean it's not a bug, it seems that something overrides the waypoint orders..

Quote
But in the first test, my firing in front of them and they being unable to find any enemy nearby, they simply never moved and this was tested in both 1.05 and 1.07 beta.
I can confirm this on the 1.05 part as well.
But, it happened quite rarely, I would say once or twice out of like 50.. :dunno:

EDIT:
Ok, just tested the time it took the group to return to "safe" (in a situation discussed) and it took approx. 3 minutes..
Until that the group followed it's waypoints but in combat or aware mode (didn't test which, probably aware because they didn't crawl or go prone constantly)..
Title: Re: waypoint problem ?bug? (behaviour-safe)
Post by: dematti on 20 May 2007, 04:36:30
was out few days but found a solution for my problem now
simply by making 2 triggers wich will set them to combat when enemy is near and another one to safe when they are gone.
Although this doesnt solve the problem
But, it happened quite rarely, I would say once or twice out of like 50.. :dunno:
happened every time to me (1.05) they just hold position forever (maybe until they see enemy wich will make them go combat behaviour)
its a bug for sure and needs to be reported.