OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Uber-Pea on 14 Jun 2004, 16:23:40
-
I have a pbr and set 2 waypoints for it. the first directly below the pbr, so it doesnt move. In this one, i want to fill the condition field with a syntax that detecs if my 5 man group is onboard.
The thing is im not working with waypoints in this map, because of the nasty "waitin for ohers" thing and because it steals atmosphere, or the feeling of being able to do what you want instead of the need to follow waypoints whatever youre doing.
I played around a little and an accepted syntax was:
op1 in PBR && op2 in PBR && op3 in PBR etc...
It was accepted, but actually didnt work at all. when everyone was onboard the boat didnt move.
Now in a syntax like this there would be the problem, that, if one op dies, it wouldnt work at all (I guess. Is there a check that checks if one unit is dead and the script works anyway????)
Now what is the syntax? Maybe I could get the pbr under playercommand but this is a dirty and non-atmospheric way of playing.
Uber
-
Firstly, you're right about player waypoints, which is why a lot of people play in Veteran mode where you don't see them.
Secondly, you are right that the code you suggest would fail if one of those menetioned was dead.
The answer is to use something like this:
"_x in pbr2" count units grp1 == count units grp1
Syntax not guaranteed.
This problem usually comes up with a chopper rather than a boat. Hunt around the forum and the Ed Depot on that basis.
-
Here's one I use with great success-
count crew pbr == (("Alive _x") count units group player) + 2
the + 2 is for the pbr driver and gunner. The only limitation to this is if one of those 2 are killed. There's several ways to do what you want. This is just another option to consider.
-
crashnburn your script doestn work for me, could you please explain the several parts? especially the group player, and we must remember mine is a 5man squad. Any changes?
Uber
-
the condition counts the crew (total number of people in the boat) by counting how many are alive in the players group (you can put any group name you want there, and it makes no difference how many are in the group) and includes a "+ 2" to account for the driver and gunner. ;)
So when all the players group (or whomever) are aboard and the driver and gunner also, the condition is satisfied and the trigger will activate. If you can't get it to work then you're doing something wrong. :-\ The code syntax I wrote is good. :-*
-
Hi uber :) I know the proper way to do this check is to count units of a group, but since I've had numerous problems writing different scripts that would work both in SP and MP missions, I usually just name all parties involved and check each one. I know that Snypir has a script (in the Editor's Depot) to keep a chopper waiting till all are on board. But Here's a bit from the simple script I use. I tested it thoroughly solo and in MP with all scenarios of units dying, player as leader,player as non-leader, player on first,last, etc. This worked for me.
; Chopper Load and wait script modified by Mr.Bodean
?!(local server): exit
MH6 FlyInHeight 0
#CHECKIN
~0.5
?(GetPos MH6 select 2) > 0.5 : MH6 FlyInHeight 0
?(alive P5) and !(P5 in MH6):goto "CHECKIN"
?(alive P6) and !(P6 in MH6):goto "CHECKIN"
?(alive P7) and !(P7 in MH6):goto "CHECKIN"
?(alive P8) and !(P8 in MH6):goto "CHECKIN"
#FINISH
MH6 FlyInHeight 30
MoveNext = TRUE
exit
P5-P8 are the units , MH6 is the chopper.
You could modify the hold line easily with setfuel 0 if necessary.
MoveNext = True helps to move it along on its way.
Maybe that could help you. 8)
-
Thx 4 your script bodean but somehow it didnt work...
CrashNburn your script now worked for me, the problem was that somehow ive written something wrong in the group this command. I guess i wrote ops=group this instead of ops = group this or sth... Thanks for ya help m8s! :D
A sinister evil: The Uber-Pea