Jump to content
Sign in to follow this  
Big_Daddy

Help with UAV and Lock on Target/Ground

Recommended Posts

Ok, I'm working on getting my UAV up and running. I've gotten it working with MP, and with respawning. It's beautiful.. :) I'll post code later.

I'm trying to enhance the usefulness of the UAV. I've gotten the divebombing etc under control, what I'm working on now is the ability to lock onto a target or the ground. Arma 1 UAV's just created a camera with the position set to the UAV. By using a camera, you had the ability to "lock" onto anything by default. (camera.sqs functionality). It looked good, but with that approach you cannot control the missles, marker, etc.

Is there a way to lock your aim at a certain point? I've tried dotarget, dowatch, etc..

Thanks.

Edit:

worldtoScreen and setMousePosition looks promising but I'd need it to update every frame..

Edited by Big_Daddy

Share this post


Link to post
Share on other sites
Ok, I'm working on getting my UAV up and running. I've gotten it working with MP, and with respawning. It's beautiful.. :) I'll post code later.

I've seen a few of your posts regarding the UAV. I think our code is probably pretty similar at this point. Respawn was not a difficult problem it turns out, but the rest... Are you saying you want to lock the camera on a target?

By the way - how is your MP mission set up? Do you have sides? I noticed that I can't seem to run two UAV modules at the same time. I can give the West a UAV or I can give the East, but not both. Also, the Predator works pretty well, but the Pchela - haha, it seems borked, at least for me. The camera appears to be the pilot's view and isn't pannable at all.

The UAV module could definitely use some improvements, but I am not sure what can be done outside of reimplementing the whole thing as custom code. Based on what has been commented out in that code it looks like there was some intention to have more features.

Share this post


Link to post
Share on other sites

Well.. funny that you mentioned it.. :)

I'm not using the actual UAV mod anymore. I've taken the BIS scripts, and tied them into a game logic. With that, you could have as many as you want. You'd just have to change Variables. Since they use hard coded variables in the scripts.

I've also taken an arma 1 UAV mod and made it arma 2 compliant (sort of:))

As far as MP goes, no, I haven't set it up for 2 sides yet.. but MP works pretty well. Everytime I launch a UAV it sync's up to the 'UAV' mod.

Share this post


Link to post
Share on other sites

Did you guys find any way to add a "Camera Lock" function to the UAV? I am working on releasing a template mission with a fully MP-compatible, respawnable, non-aggressive UAV and the camera lock feature would definitely be a great one to add.

Thanks for any kind of info,

Share this post


Link to post
Share on other sites

I'm working on some UAV stuff at the moment. I've managed to bodge a camera lock, but the camera still rolls around it's axis. (Although not as bad as before).

I'm also working on a way around the divebombing issue. It's not really there yet as now the UAV won't report in targets. (Although I do have a workaround for that too). Basically, the whole thing is a workaround. I might rip the BIS scripts from the module and see if they can be used for the basis of an independent mod/script.

If I have anything concrete you can use, I'll post it up.

Share this post


Link to post
Share on other sites

Thanks! I understand I've resumed a very old thread but this seemed to me the most representative of the UAV problem *considering the users taking part to it, whose contributions helped me out a lot*

I am going to release my UAV template soon, so far it has worked in MP, it is not aggressive (ZERO dive bombs) and can be configured for various heights via an action menu.

If it's old water under a new bridge, well it won't hurt I suppose.

Feel free to PM me with the camera lock code if you want I can take a look at it and try to improve it. Or you will be able to get my code anyway since I am releasing it here.

From there on, I am definitely willing to improve it by adding the famous camera lock feature we all need :)

Share this post


Link to post
Share on other sites

While assembling the mission template I noticed one cool but surprising thing:

While in UAV camera mode I've always tried to chase, using the mouse, the "object" of my chase..a few hours ago I received a phone call while testing the template mission so I took the call and left the mouse alone.

I noticed, surprisingly, that the UAV camera keeps watching the same area even if the UAV rotates around it with it's four waypoints..

I have always been so busy chasing stuff with my mouse that I never tried leaving it alone and watching what happens.

I am guessing most users want a more effective lock and that the actual lock, at the moment, only works for the "center" of the Reconnaisance area..

I am curious to know what you guys think ;)

Share this post


Link to post
Share on other sites

Right on man! :)

All I did was open a dialog when the UAV camera is pointing in the direction I want and it locks it completely. It seems when you leave the mouse alone, it's pretty good but there's some 'creep'. I was using my All Round Defence addon and opened up the dialog while in the UAV cam - locks it completely!

Glad you're making some progress on setting the height. I only do it with setPos and flyInHeight (not variable). The disableAI "TARGET" and disableAI "AUTOTARGET" controls are good for keeping it at a constant height (no dive-bombing)

Share this post


Link to post
Share on other sites

So you did not know either? We must gather for a virtual beer for this. Writing "lol" is the best to describe this moment eheh

Since I prefer UAV recon rather than attack, I am loving the steady-but-not-locked feeling. Observing movement to differentiate OPFOR activity from civilians gives me late night relaxing fun from the peace of my FOB (boy, am I weird I know ;))

I know we could still make use of a full camera lock but still, I was like OMG!!

For me the disableAI did not work when used on the UAV only. I've used it on the pilot and gunner, I could sum it up like this:

How to make your UAV well-mannered:

- disableAI target and autotarget on UAV, pilot and gunner

- setskill to 0 for gunner and pilot in the UAV

- setCaptive true to give it some peace

You can further force stuff by using set behavior and combat mode .. But always make sure you do it on then pilot and gunner, too ehe

UPDATE: I think I know how to hard-lock the camera on the UAV, but I need to know how the camera itself is called in the script the UAV module from BIS calls..UAV.sqf

If you happen to know, that would speed things up, otherwise it's unPBO time.. ;)

Edited by Reezo

Share this post


Link to post
Share on other sites

If this is of any help in the matter, we at SR5 Tactical have developed a "UAV Reloaded" script suite that makes it non-agressive and more controllable.

Grab it here:

Please do not mirror the file, but feel free to release it everywhere

Share this post


Link to post
Share on other sites

Thanks for this script. Now my UAV are not going crazy). Is it possible to set the maximum speed for it? I would like to see it flying at a speed of not more than 200km/h

Share this post


Link to post
Share on other sites

run this loop to limit speed.

while {canMove _uavName} do {
  _uavName limitspeed 200;
  sleep 0.1;
};

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  

×