Jump to content
Sign in to follow this  
Powerstrip

Unmanned AirCraft. Waypoint to base.

Recommended Posts

I have a LittleBird AH-6J being controlled using the ULB module and a UAV terminal. It works great but I want to make an Auto Return to Base Feature.

I have the basic idea down, but I am not sure how the script will work to activate the trigger. The setup I am going for here:

AddAction to MouseWheel menu -> Activates the Trigger to start the waypoint -> Waypoint is landing pad at base(littlebird should move to this waypoint from anywhere).

I have everything I need I think except for the script to activate the trigger and how to implement the script for the trigger. Here is what I have:

AddAction added on the UAV terminal with:

 this addAction ["Auto RTB","AutoRTB.sqf"]

This is what I have in AutoRTB.sqf(found it somewhere on web):

On activation : ULBRTBTrig = true

I named a trigger ULBRTBTrig and placed it on the map.

I made a waypoint with MOVE type and in the OnAct field:

dostop ULB;ULB land "land"

I then synced the Trigger to the waypoint and synced the waypoint to the littlebird.

I know I didn't do this 100% correctly if at all, does anybody have any advice here?

Share this post


Link to post
Share on other sites

Delete your placed waypoint. Its not needed.

This should work as AutoRTB.sqf

//// Change these two values
_ULB = NameOfTheULB;
_RTBPos = YourHeliH;

_ULBGroup = (group _ULB);


//// Add waypoint
wp1 = _ULBGroup addWaypoint [(getPos _RTBPos),0];
wp1 setWaypointSpeed "FULL";
wp1 SetWaypointType "MOVE";
wp1 setWaypointFormation "WEDGE";
wp1 setWaypointCompletionRadius 50;


//// Set waypoint
_uavGroup setCurrentWaypoint [_ULBGroup, 1];


//// Wait until arrived OR not alive
waitUntil {_ULB distance _RTBPos < 100 || !alive _ULB};


//// If not alive
if (!alive _ULB) exitWith {};


//// If arrived - land
deleteWaypoint [_ULBGroup, 1];
_ULB land "LAND";
sleep 10;
_ULB action ["EngineOff", _ULB];

When using in multiplayer (dedicated) this may need some workarounds for a proper landing...

Edited by sxp2high

Share this post


Link to post
Share on other sites

Thanks a lot sxp2high, that looks great. I will give it a go. What exactly would be different on for dedicated? Would it just mean that latency would be a factor and need to be incorporated into the landing routine, or is something more that I am not aware of that would be different?

Also, while we are on the subject, do you know of a way to setup the re-spawn script that when the ULB is destroyed when it respawns it will still be forced to be linked to the ULB module? It seems that anytime the ULB is declared destroyed(weather it is completely destroyed or just needs repair) after re-pair or re-spawn it no longer is linked as a ULB.

Share this post


Link to post
Share on other sites

No Problem.

What exactly would be different on for dedicated?

Well, helicopter's behaviour in multiplayer is FUBAR, especially landings. :D

There are a lot of threads about that.

it will still be forced to be linked to the ULB module?

As far as i know this is not possible. Unfortunately, syncronizations are gone when dead. Anyway, there is the synchronizeObjectsAdd command which can sync objects, after createVehicle for example.

Share this post


Link to post
Share on other sites

So since I am doing this in a Domination map would I put the Sync command in the initialization field of my ULB vehicle or in the respawn script?

Share this post


Link to post
Share on other sites
Anyway, there is the synchronizeObjectsAdd command which can sync objects, after createVehicle for example.

I've been trying something like this for the UAV in my Domination edit. It works fine in singleplayer, but in multiplayer the UAV is always listed as "UAV Destroyed". If you or anyone else has a MP friendly UAV example (using createVehicle), I would be happy to take a look at it.

Share this post


Link to post
Share on other sites

Hi,

there is no way to get the UAV running constantly in multiplayer using the BIS module.

Well... here's a UAV script that i created for our server. Maybe you like it.

You can launch UAV and give it a waypoint to cycle around. If the UAV dies, you can simply launch another one.

Check it out. If you have any questions, ask. :) If you need any changes, ill do for you.

Oh, and take a look at the settings.sqf file, you can customize some stuff there.

Edited by sxp2high

Share this post


Link to post
Share on other sites

All I need is re-sync to ULB module on re-spawn of the LittleBird and I am good to go.

Or if you can mod up your script that you posted above to spawn a littlebird with the LaserTargeting system instead of a UAV or help to do that I would appreciate it.

Aerial recon with laser designating ability from a remote position? Sounds fun to me.

Share this post


Link to post
Share on other sites

@sxp2high: Thanks a bunch, you're a life saver. I'll have a look at what it "can do", although if it works in MP I'm pretty much sold already.

Edit: Managed to get it to work in SP, haven't tested yet in MP. Replaced paths with own, and actions with buttons in the vehicle dialogs. Added _UAVPILOT disableAI "AUTOTARGET"; to engine.sqf (annoying little bastard that one). Set marker to "b_uav" instead of "airport" (ehh, what? :D) and just some general touchups pluss had to make some adjustments to my own scripts.

Will see if I can add some verbal communications in due time, and maybe an interface dialog. I noticed you don't have control over altitude or possibility to place markers. Also since I'm gunner, I may actually get killed, and I am not in harms way around the terminal. You think it is possible somehow to make it truly remote? I'm considering allowDamage false for operator, and a spawned dummy unit of my class to "take my ground damage" and kill myself if he gets killed. Others won't see "me" as "me" though, they will only see some AI looking like me. He will have stop order though.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×