Home   Help Search Login Register  

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

0 Members and 2 Guests are viewing this topic.

voodzia

  • Guest
problem with WP and condition field
« on: 26 May 2005, 16:29:22 »
Hello,
One of group of AI units (gr1) have a "get in" WP and in the condition field of this WP I put this:
("alive _x" count Units gr2) == 0
So basically everything should be fine - gr1 can't board uaz till all units from gr2 are dead. But that's not working - I mean gr1 do mount uaz even when whole gr2 is alive!?
Can someone tell me why is that and what should I do to make sure that gr1 won't board their vehicle on any other condition?
Thank you in advance for help.
voodzia

p.s
I've already tried the unassignVehicle command but it ain't working either.
And yes, I'm 100% sure that all units in gr2 are alive when gr1 is boarding uaz.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:problem with WP and condition field
« Reply #1 on: 26 May 2005, 16:37:14 »
Hey voodzia,

The way I've been using that command syntax is like this:
"alive _x" count (units wgrp1) == 0
and it seems/should work fine. Maybe you should try
"alive _x" count (units gr2) == 0
just incase and also make sure that you've got the command in the right waypoint and that you've defined the group gr2 properly.  :-\
Not all is lost.

voodzia

  • Guest
Re:problem with WP and condition field
« Reply #2 on: 26 May 2005, 17:13:42 »
I changed the parentheses but it still ain't working :(
Btw, are these parentheses so important in OFP? I thought that they're ignored by game engine. Can someone clear it up, please?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:problem with WP and condition field
« Reply #3 on: 26 May 2005, 17:18:54 »
Brackets or parentheses ( ) are most certainly not ignored by the game engine.   They are vital in working out how code is interpreted by the game.   If you're brackets are wrong your code won't work.

However, you can add brackets freely in places where they don't really matter and and it won't make any difference.   In this case I don't think its a bracket question.  

As a test, try putting a move waypoint immediately before the getin waypoint and put the code in there.     A waypoint is not complete unde the Condition field has been satisfied, but the group will do the basic stuff associated with the waypoint.

For example, if you put a Condition in a move waypoint the group will move to the position of the waypoint and wait till the Condition is true.    They don't stop at the position of the last waypoint.   So I think what's happening here is that they are getting in to the wagon then waiting for the Condition.      So, to stop them getting in, you must put the Condition in the previous waypoint.
Plenty of reviewed ArmA missions for you to play

voodzia

  • Guest
Re:problem with WP and condition field
« Reply #4 on: 26 May 2005, 18:28:59 »
I put this condition in the previous WP but no luck here either - they still boarding their vehicle when I start fire at them - however when I'm not - they stand still and don't mount the uaz. So it looks that the condition works but only when it's peacefuly and quietly out there - and when I start shooting the first thing they do is boarding the car. But that's not what I want them to do.
Maybe there's some other way to make them not follow this WP? Could you suggest me any solution?
Btw, thanks macguba for the info on parentheses.

Offline Grizzlie

  • Members
  • *
Re:problem with WP and condition field
« Reply #5 on: 26 May 2005, 19:34:15 »
Try lockWP.
group lockWP true should prevent this group to "complete" this waypoint.
U would need other trigger to set lockWP to false, but it should work

voodzia

  • Guest
Re:problem with WP and condition field
« Reply #6 on: 26 May 2005, 20:13:56 »
I know that it seems incredible a bit but it ain't working either. I guess I have to delete this car to prevent these AI units from boarding it. What a shame :(

UNN

  • Guest
Re:problem with WP and condition field
« Reply #7 on: 26 May 2005, 20:41:35 »
You can debug your condition by putting this in it's place. Acts the same way, but it will display the result of the condition to. It should display false until grp2 has all it's units killed. If grp1 still tries to board the vehicle and the condition=false, then it's not the condition.

Code: [Select]
Call {_Result=(("alive _x" count Units gr2) == 0) ; Player SideChat Format ["Result %1",_Result] ; _Result}
P.S If it's not the condition, you could lock the vehicle by moving a civilian game logic into the drivers position until your ready.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:problem with WP and condition field
« Reply #8 on: 26 May 2005, 20:55:17 »
Check out this example mission, to see if you did something wrong;

2 groups - one is called w1grp, other is called w2grp

w1grp has a move waypoint with a condition:

"alive _x" count units w2grp == 0

And then a GETIN waypoint onto an empty truck.
Then they will get in and drive to the players start position.

And there's a radio alpha trigger, which will kill group 2.

~S~ CD
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 #9 on: 26 May 2005, 20:55:37 »
Wow - that trick sounds very promising - I'll try it out in a minute and let you know if it works. Thank you UNN for this hint.

EDIT: and also thank you Chris for your mission - I'll check it out either.
« Last Edit: 26 May 2005, 20:57:36 by voodzia »

voodzia

  • Guest
Re:problem with WP and condition field
« Reply #10 on: 26 May 2005, 21:30:00 »
OK - I made some tests and thanks to UNN and this line of
Code: [Select]
Call {_Result=(("alive _x" count Units gr2) == 0) ; Player SideChat Format ["Result %1",_Result] ; _Result}I already know that gr2 is boarding uaz even when the condition isn't met - the result is false all the time when they're mounting the car.
So now I'd like to try this trick with "moving a civilian game logic into the drivers position" but I don't know how to do that? I mean I can only choose either civilian or game logic unit in the edtior but how I am to create a civilian game logic unit - could anyone tell me?

p.s
Chris - your mission works just fine -  thank you for your help.

UNN

  • Guest
Re:problem with WP and condition field
« Reply #11 on: 27 May 2005, 01:19:44 »
Hi,

Quote
I don't know how to do that? I mean I can only choose either civilian or game logic unit in the edtior but how I am to create a civilian game logic unit - could anyone tell me?

Well I thought it would be easy ::) But everytime I try and run a mission with a Game Logic grouped to a Civilan, OFP just locks up :'(

Edit:

Actualy, a civilan driver won't lock a vehicle the way an East driver would anyway......Strike two :)

Do the guys in the mission Chris sent you, ignore their waypoint condition when spooked with fire?

« Last Edit: 27 May 2005, 01:53:34 by UNN »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:problem with WP and condition field
« Reply #12 on: 27 May 2005, 05:42:19 »
Nope - they don't - i tried this out also, as i thought it
could be the case that if the groupleader of a group (player)
starts killing his guys, that they probably don't remain in the
same group - but it's not like that.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:problem with WP and condition field
« Reply #13 on: 27 May 2005, 06:09:23 »
hmm - just a quick summary:

You said:

Quote
One of group of AI units (gr1) have a "get in" WP and in the condition field of this WP I put this:
("alive _x" count Units gr2) == 0

gr1 waits for all gr2's to die

Then you said:

Quote
they still boarding their vehicle when I start fire at them

Do you mean gr2 boards the uaz now?

And you said:

Quote
I already know that gr2 is boarding uaz even when the condition isn't met - the result is false all the time when they're mounting the car.

Now i'm sure gr2 boards the uaz, but didn't you want gr1
wait for gr2 guys to be dead before gr1 mounts vehicle?

Make sure you didn't mix up something here now.

btw - the parentheses are not really required in this case

"alive _x" count (units wgrp1) == 0

works same as:

"alive _x" count units wgrp1 == 0

But in some cases they are required (like math operations,
or when using getpos/setpos and trying to add a few meters
somewhere inside the array).

~S~ CD
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 #14 on: 27 May 2005, 14:07:12 »
OK, I'll try to sum up my carrent situation:
1. Now the condition "alive _x" count (units gr1) == 0 is placed in a WP "talk" of gr2 and the next WP is "get in". I done this because I want gr2 to board uaz only when every AI unit from gr1 is killed by player's group.
2. In general this condition works fine - I mean when all units from gr1 are dead then AI units from gr2 are boarding the car and go where I want them to go. And that's cool.
3. But the problem occurres when the player's group starts shooting at some units from others groups that are near gr2 but a long way from gr1 and I'm 100% sure (also thanks to UNN and his small debug script) that all units from gr1 are alive. So it goes like this - I start shooting and all units from gr2 are immediately boarding their car - and it happens even though the condition is false. They're just mounting the car and then just sitting there like dummies.
And this is the real problem - in theory they can't do that because the condition of WP is not met. But it seems to me that they're ignoring this condition somehow and mounting uaz anyway.

So I don't want to examine how it's possible that this thing happens - I just would like to do something to stop gr2 from boarding uaz when condition is not met. But so far all my tries fail me - with one exception - deleting car works fine but I'd rather not do that.
Just one thought has crossed my mind lately - would it be possible to give gr2 a new different WP "move" and force them to follow it instead of this original one "get in"? Maybe that would work somehow - what do you think guys?