OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Diealot on 05 Nov 2002, 00:59:25

Title: Chauffered Group
Post by: Diealot on 05 Nov 2002, 00:59:25
I am crating a MP mission where when the group first spawns  A truck comes to their position and waits for them to get in. It than drives them to a town and alerts them of enemy presance which they than get out and the truck moves to a safe position. To do this I have named each playable soldier ap1,ap2 ect and use the command line (ap1 in car and ap2 in car) ect. There are 8 members in the grp. so this has to be repeated 8 times. The same when thet get out (NOT ap1 in car) 8 times. My problem is what if I only have X amount of players in the game not a full 8 or what if some of them Die. When evere they get back into the truck it will not mve until all eight are in.  Is there a way that I can change this to count the members alive in the group and for the car to check if that amount is in the car before it goes to it's next waypoint? :o
Title: Re:Chauffered Group
Post by: Sui on 05 Nov 2002, 02:13:40
Welcome to the forums, Diealot

There sure is. Try the line:

"_x in vehicle" count units group == west countside units group

Be sure to define your group name in your leader's init (eg. group = group this).

Also a condition checking when all living players are out of your vehicle:

(not ("_x in vehicle" count units group)) == west countside units group
Title: Re:Chauffered Group
Post by: Diealot on 05 Nov 2002, 05:36:42
Thank You I will try that tonight...couldn't get that other to work.
Title: Re:Chauffered Group
Post by: Diealot on 05 Nov 2002, 08:24:22
Works fine when you get into car the car moves to next waypoint 9.  Using the first part of the code. When I Try to put the "NOT" portion of the code  in waypoint 9 I get a error
"Type BOOL, expected object,group,side,number,string"
any Ideas?
Title: Re:Chauffered Group
Post by: Ranger on 05 Nov 2002, 21:52:04
The error occurs because Sui made a slight error in his code.  ;)  He meant to say:

"not (_x in vehicle)" count units group == west countside units group

However, I think more efficient code would be as follows:

"_x in vehicle" count units group < 1

That way, the game only has to count units 1 time.  :D
Title: Re:Chauffered Group
Post by: Sui on 06 Nov 2002, 00:38:23
Hmm.. Indeed I did ;)

However, the reason I compare the count array to west countside units group is because countside is life specific.

Count will return the number in the group including any dead units that the leader doesn't know are dead yet. Countside only counts units live at the specific point in time.

Either way, I really don't think you'll see a performance hit ;)
Title: Re:Chauffered Group
Post by: Ranger on 06 Nov 2002, 01:15:44
Aha.  I didn't realize that count was time-specific.  :o Thanks for pointing that out.    :)
Title: Re:Chauffered Group
Post by: Diealot on 07 Nov 2002, 18:20:20
The script works fine guys....dont't fight.. I Thank You very much. But I have added another problem to it, we will see which one comes up with the right answer.
I have included respawing in my map. The player is  respawned to another location on the map far away. So my groip is now split up. When I get into the car it will not move to the next waypoint because it waiting for all players to get in. How do I get around this.

Yes I think respawn is a must in co-op games. You have 7 or 8 people that sometimes wait for 15 30 mins for a game to start and they get killed on the first mission. This way they wait till the first mission is done and they can join in on the second one. Nothing worst than waiting all that time to be the first one killed and have to leave.