Home   Help Search Login Register  

Author Topic: Synchronize??  (Read 1586 times)

0 Members and 1 Guest are viewing this topic.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Synchronize??
« on: 15 Jun 2010, 07:25:54 »
Hello OFPEC members,
I was wondering is there such a command, used in a script, to synchronize ''Load'', and ''Get In'' waypoints?

Thanks!
~MadPup~
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Synchronize??
« Reply #1 on: 15 Jun 2010, 08:39:18 »
There isn't, but the equivalent would be a slowish loop which checks for all of the "getting in" group to be in before issuing any move command to the vehicle.

Offline Mad Pup

  • One Who Asks A Lot.
  • Members
  • *
  • OFPEC Is Awesome
Re: Synchronize??
« Reply #2 on: 18 Jun 2010, 22:50:50 »
Okay, so like in a script I would put
Code: [Select]
? player in _jeepOneCorrect?
"The object of war is not to die for your country, but to make the other poor bastard die for his" - General Patton
[SH]MadPup
[SH]Squad

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: Synchronize??
« Reply #3 on: 19 Jun 2010, 00:27:48 »
Yeah, or to check if an entire group is in a vehicle,

Code: [Select]
{_x in _jeepOne} count (units _groupOne) == {alive _x} count (units _groupOne)

In other words, "number of groupOne units boarded in jeepOne equals number of alive groupOne units."

And you can also put that in the condition field for a waypoint, or a trigger synchronized to one, of course.
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Synchronize??
« Reply #4 on: 19 Jun 2010, 00:40:40 »
The "_" underscore identifies a variable that is local to the script (which means it is unknown outside of the script). In order for it to work, you must pass the name of the jeep to the script through an array and then assign a local to it at the start of the script. But since editor assigned names are global variables (which means they are known in and out of scripts), it's best to refer to the jeeps editor assigned name which is whatever you name it, without the underscore.
Code: [Select]
#wait
? player in jeepOne : goto "proceed"
~1
goto "wait"
#proceed
The words with a # symbol before them are called labels. You use them to jump around within scripts when specific conditions are met. It must be used with a goto command.

Below is an example I'm using in a mission to make sure the player and his group are in a vehicle before executing a cinematic. I have the player separate from the rest of the group just in case he/she boards and then decides at the last minute to get out and do something outside of the vehicle before the rest of his group has boarded.
Code: [Select]
#wait
? vehicle player != vehiclename : exit
? ({alive _x} count units group player) == ({_x in vehiclename} count units group player): goto "proceed"
~1
goto "wait"
#proceed
vehiclename setfuel 1

The ": exit" bit is used to exit the script if the player gets out.
vehiclename must obviously be changed to whatever you desire.

Hope this helps.


Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Synchronize??
« Reply #5 on: 25 Jun 2010, 04:38:58 »
waypoint the desired chopper to the desired location.
Put a HeliH at the location.

Put a MOVE waypoint for the chopper right beside or on the helih,
type in on act :
Code: [Select]
helicoptername land "land"
Note : just type like that, no changes required!
NOTE: using 'this' instead of helicopter name might not work sometimes.
And put another MOVE waypoint right beside the first MOVE wp.(must be close)
Put the desired condition,in this case :

Code: [Select]
player in helicoptername
NOTE : using 'this' here might not work too!
Go on with the extraction....

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(