Forum Jump :

Author Message


Posts: 6
Rank:


Level: Member

Country: au
Location: Queensland
Occupation:
Age:
In-game name:

 
#1 Posted at 2016-01-20 09:15        
     
Trying to find a way to synchronize 2 way-points that are created from a sqf. file called from a trigger in game.
I know how to create reinforcements, call the scripts, and add waypoints and deletion, but I want to make an extraction script, where a helicopter will land and synchronize its "LOAD" waypoint with a squad's "GET IN" waypoint.

To explain
> Once ZoneA has been cleared of Opfor, a Helicopter will spawn
> A helicopter "LOAD" Waypoint will be placed on a Helipad.
> Create the "GETIN" waypoint for the group "Delta"
> Synchronize the 2 waypoints for the Helicopter and Delta, so that the Helicopter does not leave without loading.
> Create a "TRANSPORTUNLOAD" waypoint at a base, where Delta will have a "GETOUT" waypoint.

The Helicopter can stay at final destination.

I know there is a complicated way about doing this manually in the 2D editor by placing this in a waypoints condition:
((!alive Unit1) or (Unit1 in blackhawk)) and ((!alive Unit3) or (Unit3 in blackhawk)) and ((!alive Unit4) or (Unit4 in blackhawk))
but I don't know what command to use to put that code in the condition in the spawn script, (but there should be a way right?)
I've looked at setwaypointstatements, and by description it looks to be what I need to set conditions of waypoints, but I can't find an example to base it off.

I've also found SynchronizedWaypoints, but again, no examples to base it off.

Just to clarify, what's happening with my script is the helicopter doesn't land at the helipad and the Ground units Waypoint has already been accomplished

You can download a very basic version of what I've tried HERE:

If anyone knows how to make a spawned Evac, please let me know. I want to learn how to do this, so please HELP me and not DO it for me :D
Better yet, if anyone knows if those commands work with what I'm doing, could you let me know.


Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2016-01-20 09:49        
     
As it is in description:
synchronizedWaypoints
only return already synchronized wp.
You must use this: https://community.bistudio.com/wiki/synchronizeWaypoint
or this: https://community.bistudio.com/wiki/synchronizeWaypoint_trigger


Advertisement


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#3 Posted at 2016-01-20 10:46        
     
I'm assuming ZoneA is already cleared of Opfor, and that the helipads are named helipadA and helipadBase. The helicopter's name is blackhawk and the groups leader's name is Unit1. I know I literally did it for you after you said not to, so feel free to ask about any part of this script.

_wp0 = (group blackhawk) addWaypoint [getPos helipadA, 0];
_wp0 setWaypointType "LOAD";
_wp0 setWaypointStatements ["", "doStop blackhawk; blackhawk land 'GET IN'"];

_wp1 = (group Unit1) addWaypoint [getPos helipadA, 0];
_wp1 setWaypointType "GETIN";

_wp0 synchronizeWaypoint [_wp1];

_wp2 = (group blackhawk) addWaypoint [getPos helipadBase, 0];
_wp2 setWaypointType "TR UNLOAD";

_wp3 = (group Unit1) addWaypoint [getPos helipadBase, 0];
_wp3 setWaypointType "GETOUT";

_wp2 synchronizeWaypoint [_wp3];

I've also optimized your current script. Please learn about private, local and global variables (Here is another one), and make sure to check the Scripting Commands List for better alternatives to some commands.


This post was edited by 654wak654 (2016-01-20 11:15, 642 days ago)

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2016-01-20 18:01        
     
Wak, you don't need any waypoint statements in wp0. Helo is just waiting the ground units are at their waypoint to land for pick up them.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#5 Posted at 2016-01-20 21:41        
     
Wasn't the case for me, it just moved on to the next one like it's a move waypoint.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#6 Posted at 2016-01-21 00:11        
     
*SCRATCH*
your script works for me, without setwaypointstatements (which is the same in fact). The doStop is probably useful for an helo under fire or if your group is already on site (waypoint completed) or something like that.
I don't like these type of waypoints with sync. I experienced weird behaviors many times.
Now, I'd rather add "MOVE" waypoints, some unitready and waituntil cond for the sequence to be done and crew behavior.
That works better, imho.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 6
Rank:


Level: Member

Country: au
Location: Queensland
Occupation:
Age:
In-game name:

 
#7 Posted at 2016-02-04 14:37        
     
Just thought I'd update you guys on what I've done to get this to work.
I tried both your methods 654wak654, (My script you altered, and your own method).
For some reason neither worked (yes i changed the classnames to suit and names of units/groups). They either didn't sync properly, or the helicopter didn't land at all, and just proceeded to its next waypoint.
After a little tweaking i got the ai to get into the chopper, but the helicopter then got near it's next TR UNLOAD waypoint, and for some reason the "Setfuel 0" statement executed while it was mid air (before it landed) which the helicopter stalled and exploded on impact.

This was my final script which works completely. It is a little messy, but it works.
if (!isServer) exitWith {}; // Tells everyone who is not the server to exit the script here. Everything in a triggers onAct field is done for all clients connected to server so this is important to stop the script running for every client.

GroupUH80 = CreateGroup West;

Blackhawk = createVehicle ["B_Heli_Transport_01_F", [(getMarkerPos "UH80Spawn") select 0,(getMarkerPos "UH80Spawn") select 1,100], [], 0, "FLY"];

//UH80 Close Air Support
UH80Pilot10 = GroupUH80 createUnit ["B_HeliPilot_F", [0,0,1], [], 0, "CAN_COLLIDE"];
UH80Gunner11 = GroupUH80 createUnit ["B_Helicrew_F", [0,0,1], [], 0, "CAN_COLLIDE"];
UH80Gunner12 = GroupUH80 createUnit ["B_Helicrew_F", [0,0,1], [], 0, "CAN_COLLIDE"];
UH80Pilot10 moveInDriver blackhawk;
UH80Gunner11 moveInTurret [blackhawk, [0]];
UH80Gunner12 moveInTurret [blackhawk, [1]];

wp1 = GroupUH80 addWaypoint [(getmarkerpos "pickup"), 0];
wp1 setWaypointSpeed "FULL";
wp1 setWaypointType "LOAD";

getin = Delta addwaypoint [(getmarkerpos "pickup"), 0];
getin setWaypointSpeed "FULL";
getin setWaypointType "GETIN";
getIn synchronizeWaypoint [wp1]; 

wp2 = GroupUH80 addWaypoint [(getmarkerpos "uh80drop"), 0];
wp2 setWaypointSpeed "FULL";
wp2 setWaypointType "TR UNLOAD";
wp2 setWaypointStatements ["true", "Blackhawk setfuel 0"];

getout = Delta addwaypoint [(getmarkerpos "uh80drop"), 0];
getout setWaypointSpeed "FULL";
getout setWaypointType "GETOUT";

Not very short, but all the methods of the simpler creatvehiclecrew didn't allow the full script to work the way i needed it.
Thanks for all your help anyway, definitely saved myself a couple of hours.


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#8 Posted at 2016-02-05 01:25        
     
If that's the case, you can use the land command instead of setFuel to make the heli land and shut down it engines.
Blackhawk land "LAND"

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage