Home   Help Search Login Register  

Author Topic: problem with WP and condition field  (Read 2860 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:problem with WP and condition field
« Reply #15 on: 27 May 2005, 14:42:27 »
OK Voodzia,

i will make a vague assumption now, as i just managed to recreate
exactly what happens in your mission.

These guys, standing near to gr2 you created by copying the
group gr1 without removing the: gr1 = group this from their
leader's init field.

Now as these guys were created after your real gr1 - ofp use
the first in first out method for units being placed - that means
if you place 2 units on the map and in both units init fields you
write:

unit1: a = 1
unit2: a = 2

Then a will be 2 as unit2 will be created after unit1.

Therefore you kill these other guys and the condition is met.

Once i changed gr1 = group this into gr3 = group this, gr2 stopped
mounting the vehicle when the third group was killed.

Let me see if i could be right here  :)

:edit - and btw - not trying to solve a problem but using a workaround is the very last thing on my list of things to do.
I tend to use this method only in case there is not really a possible
solution, but still then i'm after a solution, or at least i try to find
a reason for it. Believe me, everything else will just end up in
lot of problems with lot of workarounds and things messing up
themselves.

~S~ CD
« Last Edit: 27 May 2005, 14:46:17 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

voodzia

  • Guest
Re:problem with WP and condition field
« Reply #16 on: 27 May 2005, 16:18:46 »
I got two news for you Chris:
news no 1 - your assumption is wrong - all my units have unique group names - I checked it twice.
news no 2 - I read your post two or three times and finally I've taken a closer look to this sentence:
Quote
not trying to solve a problem but using a workaround is the very last thing on my list of things to do
And thas was very apt suggestion I must say - actually you're my savior Chris ;)
Here's this buggy piece of code that makes gr2 board their vehicle even though the condition of WP is false:

Code: [Select]
; guerilla - all resistance units within some trigger area

_i = 0
#LOOP1
_unit = guerilla select _i
_unit doMove getPos (nearestObject [_unit, "Tree"])
_i = _i + 1
~0.1
? (_i < count guerilla) : goto "loop1"

When I removed this loop from my script everything is fine now - gr2 is not boarding the uaz when I start firing at some other groups nearby. However I must say that it was pure chance that I discovered that - I'd never thought that this loop could cause such a odd behaviour of AI units from gr2.
Anyway, I'm happy now that I figured it out at last. And I'd like to thank you all for your great help and all your very useful suggestions - thanks a lot guys.