Jump to content
dark_spectre

Thoughts on how to implement a sort of "follow mode" for autonomous Stompers?

Recommended Posts

I've sort of delegated myself the unofficial logistics and UAV guy for the people I play along with.

A true dream come true would be to have a means of issuing a command to a Stomper to follow the attached/linked UAV Operator by say 50/100m/200m/300m etc.(variable)

In that way we can have extra ammo, med kits, and even a full blown potential VAS box If desired. Not to mention the optics package, and extra firepower for rear security if needed.

Constantly losing 100% situational awareness by opening the tablet and updating your waypoints every 2-3 minutes as we we move is dangerous, and inefficient at best. It's like putting wadding in your ears and pulling a burlap sack over your head every 100-300m

Is there perhaps some way of assigning/attaching to and designating a moving waypoint to a UAV Operator and instruct a linked UAV Stomper to maintain a set, though if possible variable based, distance until ordered otherwise?

Just brainstorming here. This sort of follow mode would genuinely provide a Swiss Army knifes worth of utility to the underutilized stompers.

Thanks for the read!

---------- Post added at 09:47 ---------- Previous post was at 09:18 ----------

Skadee @ r/armadev threw this up.

newUGVwaypointCoordinates = ([myOperator, 50, [myOperator, myUGV] call BIS_fnc_dirTo] call BIS_fnc_relPos);

Explanation:

`[myOperator, myUGV] call BIS_fnc_dirTo` returns the vector direction from myOperator to myUGV.

`[myOperator, distance in meters, returnvalue from BIS_fnc_dirTo] call BIS_fnc_relPos` returns a position array (same format as getPos/setPos uses) that is *distance* meters away from *myOperator* in the *vector direction* returned by BIS_fnc_dirTo.

Use [addWaypoint](https://community.bistudio.com/wiki/addWaypoint) and [setCurrentWaypoint](https://community.bistudio.com/wiki/setCurrentWaypoint) to have the UGV move to the new waypoint.

I'm guessing that the initial line stated goes into the stompers init line because of the myOperator call.

It's the usage of addWaypoint and SetCurrentWaypoint to translate that continuous stream of directional information being called in and translating that into actual movement without intervention that I'm lost on? ( what else is new :-P )

Edited by Dark_Spectre

Share this post


Link to post
Share on other sites

[stomper] join player;

The UGV stays in formation and takes commands just like a regular infantry soldier.

;)

Share this post


Link to post
Share on other sites
[stomper] join player;

The UGV stays in formation and takes commands just like a regular infantry soldier.

;)

It's going to be a loooong work day waiting to get home and try this all out. :-D

Awesome!

You've both made my month!

Just last night we were getting our asses handed to us by a pair of UPSMON controlled CSAT weapons squads, and I would have given my left nut for a stomper on station.

This is going to be a game changer for me if this all works.

Again thank you!

I need to setup a VPN on my home pc so I can remote test this stuff instead of spending the next 6 hours like a kid on Xmas eve.

;-D

The anticipation is gonna kill me! Thank you!!!!!!!

Share this post


Link to post
Share on other sites

Skadees update to my inquiry:

*myOperator* is just the unit the UGV will follow. There's no continuous stream of info here, unless you run that line repeatedly in a scripted loop.

**UGV.sqf:**

_range = _this select 0;

while (alive myUGV) do {

newUGVwaypointCoordinates = ([myUnit, _range, [myUnit, myUGV] call BIS_fnc_dirTo] call BIS_fnc_relPos);

//delete old waypoints

//addWaypoint with position newUGVwaypointCoordinates

//setCurrentWaypoint to your newly added waypoint

sleep 30; //delay between setting new waypoints

};

**Script call:**

myScriptHandle = [range in meters] execVM "UGV.sqf";

Make some radio triggers, each with it's own unique scriptHandle and range value. Use *[scriptDone](https://community.bistudio.com/wiki/scriptDone)* and *[terminate](https://community.bistudio.com/wiki/terminate)* to make sure only one instance of the script runs at a time.

Share this post


Link to post
Share on other sites

My question is sort of related to this, and very noob......how exactly do I setup in editor to get access to a ugv or uav? I was trying to last night and the connect to option in the terminal never lit up. I put down an empty ugv, a blue ugv, even a player uav operator just to make sure it wasn't an issue with soldier class, but I could never get connected. Sorry for the dumb question, if I know exactly how to setup and connect then ill know if its my fault or some mod or script im using thats screwing it up.

This UGV follow sounds awesome.

Share this post


Link to post
Share on other sites

works like a charm :)

---------- Post added at 17:34 ---------- Previous post was at 17:28 ----------

My question is sort of related to this, and very noob......how exactly do I setup in editor to get access to a ugv or uav? I was trying to last night and the connect to option in the terminal never lit up. I put down an empty ugv, a blue ugv, even a player uav operator just to make sure it wasn't an issue with soldier class, but I could never get connected. Sorry for the dumb question, if I know exactly how to setup and connect then ill know if its my fault or some mod or script im using thats screwing it up.

This UGV follow sounds awesome.

doesn't sound like your doing anything wrong. I'd say strip your modset, and start adding one at a time till you find the culprit.

---------- Post added at 19:31 ---------- Previous post was at 17:34 ----------

Actually not so much.

They don't respond to movement commands. They will pan and scan in a designated direction, watch the horizon, but they wont move. They show a move waypoint beneath their individual icons when its assigned, but it just doesn't happen.

I've gotten one to move of a fireteam of 4, once.

Edited by Dark_Spectre

Share this post


Link to post
Share on other sites

this

[stomper] join player;

which in my case was

[b_UGV_01_rcws_F] join REO1;

I named the stomper after its classname, and the UAV operator was REO1. I also tried just stomper..All the same result.

Some turret control only, absolutely no movement, and i cannot get her to fire.

This also disables the ability to issue commands/waypoints via the UAV tablet once shes joined your group

even tried

[b_UGV_01_rcws_F] join REO1; B_UGV_01_rcws_F enableAI "Move";

still wont move.

AI enabled or disabled in description.sqf makes no difference either.

unfortunately it all equals this.

http://youtu.be/0NS0DbQ4qp4

Edited by Dark_Spectre

Share this post


Link to post
Share on other sites

[stomper] join group player;

or

[stomper] join Group REO1;

unless you have created a group.

mygrp = group this

placed in group leaders init box, then you could use

[stomper] join mygrp;

without the group command as they are a group.

Share this post


Link to post
Share on other sites

Result is the same irregardless of method. (group, individual) It joins you, and you get semi-turret control, but that's all.

---------- Post added at 01:25 ---------- Previous post was at 23:48 ----------

theres a much easier solution actually, as its all already baked in vanilla.

Choose: NATO>Special Forces>UGV Attack Team.

Its consists of a team leader, a UAV operator and one UGV Stomper, all linked together as a group.

The Stomper follows natively and can be directed like any other AI unit. No scripting needed.

Share this post


Link to post
Share on other sites
Weird, just tried it again in the editor, working just fine.

Are you using any mods?

I can command it around, assign targets to the UGV etc.

http://i.imgur.com/1CMNlcS.jpg (276 kB)

http://i.imgur.com/3Lkr7Cx.jpg (209 kB)

Then it's definitely a mod on my end then. That's the only logical explanation!

I did however find a simpler method that works right out of the box:

its all already baked in vanilla.

Choose: NATO>Special Forces>UGV Attack Team.

Its consists of a team leader, a UAV operator and one UGV Stomper, all linked together as a group.

The Stomper follows natively and can be directed like any other AI unit. No scripting needed.

Share this post


Link to post
Share on other sites

It's basically the same as using the join command.

Maybe one of your mods is messing with group creating/management in game.

At least you found a solution ;)

Cheers

Share this post


Link to post
Share on other sites

Another approach with a more intimate solution instead of relying on an AI unit + rough and dirty "squad" work (since that's not how a UGV would work IRL) would be to use the script the guy posted up above in tandem with some magi- extra scripting. In the init field of the UGV in the editor you'd put something like:

REO1 addAction ["UGV Follow", UGVFormate]; //Adds a UGV Follow command to your scroll wheel action menu (REO1 being your object name in the editor)
REO1 addACtion ["UGV Wait", {terminate UGVFormate}]; //Adds a UGV Stop command that terminates the recurring Follow command
this addEventHandler ["killed", {REO1 removeAction 0}]; //Removes the actions from your action menu should the UGV be destroyed
this addEventHandler ["killed", {REO1 removeAction 1}]; //Removes the actions from your action menu should the UGV be destroyed

Then in the mission folder/file you'd add a new script as mentioned above, and in them use the code the guy provided earlier. Be sure to change the script names in the relevant fields if you don't use the examples!

UGVFormate = {while (alive nameofyourUGVineditor) do { 
UGVFollow = ([REO1, 25, [REO1, nameofyourUGVineditor] call BIS_fnc_dirTo] call BIS_fnc_relPos); //Assigns a position 25 meters from you in the direction of the UGV to the variable UGVFollow
nameofyourUGVineditor setCurrentWaypoint UGVFollow;// Instructs the UGV to move to that new position

sleep 20; // 20 seconds to reexecute the script to keep the UGV following
};

UGVFormate; // Reexecutes the script

And finally in the mission init.sqm file you'd add the line:

UGV_Commands = preprocessFile "nameofyourfollowscript.sqf"; // sets up the variables we assigned to the script snippets so that the game understands what we mean when we tell it to execute/terminate UGVFormate

Anyways, I think that should work. No idea, really. I've only been scripting for... 3 days now? Who knows. Someone can doublecheck that if they want but it should work. :P Hope it helps.

---------- Post added at 17:24 ---------- Previous post was at 17:10 ----------

works like a charm :)

---------- Post added at 17:34 ---------- Previous post was at 17:28 ----------

doesn't sound like your doing anything wrong. I'd say strip your modset, and start adding one at a time till you find the culprit.

---------- Post added at 19:31 ---------- Previous post was at 17:34 ----------

Actually not so much.

They don't respond to movement commands. They will pan and scan in a designated direction, watch the horizon, but they wont move. They show a move waypoint beneath their individual icons when its assigned, but it just doesn't happen.

I've gotten one to move of a fireteam of 4, once.

This is because UGVs are handled as 2 person entities: a driver and gunner. The gunner is technically the commander in thusly equipped vehicles, except for vehicles with designated commander seat. Issuing a move order to the commander would normally move the vehicle because he'll pass the command to the driver, except by adding the UGV to the group, you effectively kill the UGV AI driver, so it's like issuing a move order to a Hunter with a gunner but no driver.

Share this post


Link to post
Share on other sites

Autonomous UGV solution using Zeus:

 

Quote

This is because UGVs are handled as 2 person entities: a driver and gunner. The gunner is technically the commander in thusly equipped vehicles, except for vehicles with designated commander seat. Issuing a move order to the commander would normally move the vehicle because he'll pass the command to the driver, except by adding the UGV to the group, you effectively kill the UGV AI driver, so it's like issuing a move order to a Hunter with a gunner but no driver.

 

A bit of a necro here, but here is my solution since I was looking for something similar for apex scenarios:

 

If you cannot open the Zeus interface (pressing Y just pings) then with the MCC 4 Sandbox installed

 

https://steamcommunity.com/sharedfiles/filedetails/?id=338988835

 

use the middle scroller on the mouse to open MCC 4 and press 'login', then press logout.

Press Y and you should now be able to add assets via Zeus.

 

Under the CREATE menu seen in the top right of the screen add a UGV unit:

 

- add a stomper UGCS found under Nato>Drones:

 

Then  in the EDIT menu on the left :

- Select the stomper and left mouse + ctrl-drag from the stomper icon in the 3d view to the player unit. This will add the stomper to the squad.

Repeat the same process for the driver and the gunner.

- Select the driver icon and ctrl-drag from the driver to the player unit

- Select the gunner icon and ctrl-drag from the driver to the player unit

 

OR

 

Alternatively you can assign a variable to each entity:

 

Adding the Stomper using Zeus also adds an (invisible) gunner and an driver. The entities are visible in the left side menu though.

 

Double clicking each entity in the list and assigning variable names to them and then in the init field adding that variable to the player, gives you an autonomous stomper that will follow you around with the 'regroup' order or can be assigned either on the map or on in the 3d view to go places. Probably also with waypoints on the map as well.

 

so for the Stomper in the variable name field copy this :

 

stomper

 

and then in the Init field below add this to it

 

[stomper] join player; 

 

Repeat the same for the Driver and the Gunner by double clicking either in the list and adding them to the player also.

 

so let's call the driver Danny

so for the Driver in the variable name field copy this :

 

danny

and in danny's init field copy this:

 

[danny] join player; 

 

and finally for the gunner called Gunny

 

variable name:

 

gunny

and in his init field:

 

[gunny] join player; 

 

This will work to add an autonomous UGV to help you on certain missions where it would have been nice to have a squad.


Enjoy.

 

 

PS to add a virtual ammo and weapons box to the stomper add this to the same init field:

 

0 = ["AmmoboxInit",[this,true]] spawn BIS_fnc_arsenal;

 

Share this post


Link to post
Share on other sites

Just a note on Grumpy Old Mans code suggestion above -        [stomper] join player;

 

This works with the base stomper - you can direct the stomper to move and it will do so.

However with the Stomper RCWS that code does not work and the stomper will not respond to move commands.

Which seems a bit inconsistent ( to put it mildly) in the way BI has coded these two variants of the Stomper.

 

Share this post


Link to post
Share on other sites
Quote

Just a note on Grumpy Old Mans code suggestion above -        [stomper] join player;

 

This works with the base stomper - you can direct the stomper to move and it will do so.

However with the Stomper RCWS that code does not work and the stomper will not respond to move commands.

Which seems a bit inconsistent ( to put it mildly) in the way BI has coded these two variants of the Stomper.

 

On the contrary, it does work, but using Zeus, NOT in Eden.

 

Like Dreadp1r4te said: the RCWS version has a "driver" and a "gunner". You can see this when you add the unit with Zeus in the left side pane.

 

So all it takes is to add all entities relevant to the Stomper RCWS to your squad, meaning the 'invisible' driver, the 'invisible' gunner and the stomper itself, using the [variablename] join player; line on those entities that are spawned when bringing in the Stomper.

 

It will follow you around, and fire autonomously on enemies. I don't know if setting its combat stance to 'combat' instead of the original 'safe' when you insert it with Zeus does matter, but I set it to combat. I also change all skill sets to max.

 

Also, the Pelter will go after enemies and kill them with its shotgun.

 

 

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

×