Comrades in Arms Discussion Board
Doing custom loadouts, the easy way with @fhq_debug - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: Doing custom loadouts, the easy way with @fhq_debug (/showthread.php?tid=2487)

Pages: 1 2 3


Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-15-2013

As promised, here is an easy way of doing custom loadouts via the FHQ debug console.

To use the debug console, unpack the appropriate version into your mods directory, and load it along with cba.

You will need to define a custom key for the console to pop up. Open the control config, and set "User Key 20" and "User Key 19" to some key (I use numpad 1 and 2).

Enter the editor, and place a single unit, then press  "preview".

To open the debug console, press the "User Key 20". The console will open (it will look similar to the one in the editor. Click on "More" to open the tools selection.

Here, you have different options: You can spawn ammo boxes and backpacks, and in the Arma 3 version, you can also spawn weapons and other items (including weapon optics and similar). Load up your soldier with all the gear you want him to have. Then, in the "More" tools, select "Save current loadout". This will create a script in clipboard that will restore the exact loadout that you currently have on your soldier.

To get the script, open a text editor, press ctrl+v, and save the script file as, say, loadout1.sqf.

In the init field of the unit you want that gear to have, call the script, like

Code:
this call compile preprocessFileLineNumbers "loadout1.sqf";

That's it. The loadout is MP compatible (the effect will be visible on all machines).

Edit: New version with forceAddUniform support


Re: Doing custom loadouts, the easy way with @fhq_debug - ck-claw - 11-17-2013

Thanks for this, will check it out tomorrow morning (=sober)
But how will it work running the code in the units init field when i already have a line in there for the paradrop units?
Or can i use this to add parachute backpacks + other weapons/goodies? i'm assuming i just answered my own question lol  Wink

Edit:-
I can't test yet as Cerys is on my pc and i'm on laptop-so quick question, does it also limit what can be added, as in you can't over load the unit with too much stuff?


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-17-2013

(11-17-2013, 12:09 AM)ck-claw link Wrote: Thanks for this, will check it out tomorrow morning (=sober)
But how will it work running the code in the units init field when i already have a line in there for the paradrop units?
Or can i use this to add parachute backpacks + other weapons/goodies? i'm assuming i just answered my own question lol  Wink

Parachutes replace the backpacks, so you can't really use backpacks on those units. If there already is code in the init field, just add what I wrote above behind it...

(11-17-2013, 12:09 AM)ck-claw link Wrote: Edit:-
I can't test yet as Cerys is on my pc and i'm on laptop-so quick question, does it also limit what can be added, as in you can't over load the unit with too much stuff?

Since you need to outfit a soldier with stuff and then save their loadout, you can never overload them...

Remember, you play "my little dressup soldier" with a unit you placed in the editor, and then save it's loadout into a script.


Re: Doing custom loadouts, the easy way with @fhq_debug - Outlawz7 - 11-17-2013

Had much fun spawning the loadouts, though I do wish the interface was bigger, most item names get cut before they're fully displayed, for example you have to guess which sound suppressor is which as you can't see the caliber at the end of the name.

Also missing goggles section (can't spawn glasses or NVGs, binos).


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-17-2013

(11-17-2013, 03:46 PM)Outlawz7 link Wrote: Had much fun spawning the loadouts, though I do wish the interface was bigger, most item names get cut before they're fully displayed, for example you have to guess which sound suppressor is which as you can't see the caliber at the end of the name.

Yeah, the interface is within the safezone boundaries, that's why it's so small... had the actual console like that before, but it was even worse that way, so I extended that beyond the save zone...

I might change the interface to one similar to the thing dyslexi published...

(11-17-2013, 03:46 PM)Outlawz7 link Wrote: Also missing goggles section (can't spawn glasses or NVGs, binos).

Right, that's mission... gonna add that in the next version.


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-19-2013

Ok, since I can't easily resize the interface, I've added tooltips for the items, so you will always see the full name in the tooltip.


Re: Doing custom loadouts, the easy way with @fhq_debug - Outlawz7 - 11-19-2013

If I put a rifle with custom attachments into a backpack, will the attachments get saved?

edit: checked myself, nope.


edit: I think NVs use the wrong command to get added, it says:
Quote:    _unit addItem "NVGoggles"; _unit assignItem "NVGoggles";
in the saved script, but the unit doesnt have them.

Quote:this addWeapon "nvgoggles";
does add them.


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-19-2013

Thanks, I'll revisit that


Re: Doing custom loadouts, the easy way with @fhq_debug - ck-claw - 11-20-2013

Are we missing medikits too?


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-20-2013

(11-20-2013, 01:16 AM)ck-claw link Wrote: Are we missing medikits too?

Yes. Will add them

Currently, I am working on an integrated 3d editor for the console Big Grin


Re: Doing custom loadouts, the easy way with @fhq_debug - Outlawz7 - 11-29-2013

Something broke with the latest updates, machineguns are now listed under Rifles section for me.

Also can you add an alternate way to save loadouts as a series of commands, usable in the INIT fields instead of a script? ie. "removestuff this; this addstuff XYZ;"


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 11-30-2013

I'll see what I can do.

In the meantime, here's the new version. New features: Built-in 3d editor (object positioning system). Have fun Wink


Re: Doing custom loadouts, the easy way with @fhq_debug - Phantom - 12-13-2013

I wanted to point out a little spelling mistake on the condition/orientation option for the debugger.

Code:
this setPosASL [2771.44,3753.15,96.4871]; this setDir 167.926; if (this == leader group thi) then {this setFormDir 167.926;};

this is missing an "s"

Check on if (this == leader group thi)


Re: Doing custom loadouts, the easy way with @fhq_debug - Varanon - 12-13-2013

(12-13-2013, 09:24 AM)Phantom link Wrote: this is missing an "s"

Crap. Thanks for the pointer


Re: Doing custom loadouts, the easy way with @fhq_debug - Outlawz7 - 12-15-2013

3D editor is awesome, of course a free-floating camera would make it perfect.

Laser designator is added as item, need to be addWeapon (like NVGs).

I noticed that when I save a PCML with a loaded rocket, the loaded rocket is ignored and the next extra rocket is autoloaded on game start, resulting in 1 loaded+1 extra instead of 1 loaded+2 extra when saved. Similar issue for laser designator+batteries, perhaps all weapons?