Questions: Custom Gear/Platoons, General Scripting

Workshop for all Mission Engineer Comrades. Home of the FA Mission Making Template.
Post Reply
ScratchtasticZ
Posts: 2
Joined: Sun Jul 17, 2016 8:16 am

Questions: Custom Gear/Platoons, General Scripting

Post by ScratchtasticZ »

Hi all. Recently, I got serious about editing and mission creation. I decided to take it beyond plopping units down... got F3 and have had my nose in it since. Have done the adversarial tutorial and am in the process of working on my first full multiplayer adversarial scenario. Only been scripting in general for a little less than a week. I've learned a great deal in a short amount of time but my lack of programming experience is beginning to catch up with me. So, I've got some F3 and general scripting questions.


F3-specific:

I've seen some bits and pieces pertaining to custom gear scripts for use with the AssignGear function. However, I haven't seen anything about how to straight-up set up new classes / loadouts. I understand that we can define specific classnames as more readily-remembered names and that we can then use that to build loadouts, but I'm not sure how all the individual bits and pieces fit together. The wiki page for AssignGear seems to be more about what it does and how the function call is formatted than how the backend is built up... or perhaps I should have searched something different?

For context, I'm looking to create scripted Gendarmerie loadouts. I've got some uses in mind for that faction and would like to expand the number of classes before using them in more scenarios. For the time-being, I've created loadouts in the Virtual Arsenal, loaded them on to some seed units, and then copy/pasted those units in to the group compositions that I wanted for my scenario. Not an ideal solution; I've had to go back and replace units several times to fix loadout problems already.

Follow up question -- how can I create custom platoons? Would it be easiest to just make a model platoon complete with custom gear scripts and then save it as a composition through the built-in editor functionality? I'm sure there's a way to script it and it might be useful to know about that for some other use down the line.


General scripting / execution:

I'm trying to set up a bunch of locations (say, 30+) on the map that a script can randomly select three of at mission start. These three locations would be marked on map and reported to a specific set of players (but not everyone else). I saw darkChozo post about a weighted randomization script for a different application... is there some way I could create something similar to accomplish what I am trying to do?

Of course, there would be some beefy quality of life considerations... I don't want the same location multiple times, it would be nice if it didn't pick three locations that happen to be nearby each other, and I'd like this information reported only to a select list of players. This is fairly complex (at least to me)... beyond my ability to script.

:psyboom:

I apologize in advance if some of this is already out there and I neglected to find it.

Totally willing to gobble up any material that I may have missed on the wiki/forums.

Onward! :hist101:

User avatar
wolfenswan
Posts: 1209
Joined: Wed May 25, 2011 4:59 pm

Re: Questions: Custom Gear/Platoons, General Scripting

Post by wolfenswan »

For context, I'm looking to create scripted Gendarmerie loadouts. I've got some uses in mind for that faction and would like to expand the number of classes before using them in more scenarios. For the time-being, I've created loadouts in the Virtual Arsenal, loaded them on to some seed units, and then copy/pasted those units in to the group compositions that I wanted for my scenario. Not an ideal solution; I've had to go back and replace units several times to fix loadout problems already.
In short what you'd want to do would be:
fn_assignGear
Add a line such as:

Code: Select all

if (_faction in ["foo"]) then {
	#include "f_assignGear_gendarm.sqf"
};
Where "foo" is the faction-name of the gendarms.

f_assignGear_gendarm.sqf (New file)
You can create it from scratch use another gear file as template (which I'd recommend). It only needs to contain the weapon classes you intend to use. For example this is a "cops" one i made for myself.

I only changed the uniforms and basic rifles, as I probably won't use mmg, mat etc.

Note I refer it to the syndikat_light & _standard loadout. Saved me the time of having to do a custom one for the cops. But depending on how much tweaking you intend to do, you might have create custom copies of those files as well.
Follow up question -- how can I create custom platoons? Would it be easiest to just make a model platoon complete with custom gear scripts and then save it as a composition through the built-in editor functionality? I'm sure there's a way to script it and it might be useful to know about that for some other use down the line.
The straightforward way is to do it yourself in the editor, i.e. placing the groups, modifying the variables etc. You can use search & replace with an advanced text-editor (knowing RegEx helps too) to change an existing platoon into a new one by modifying the unit classes, but that's something I wouldn't recommend for a beginner. Especially the non-major factions such as gendarmes are a bit "special" in that way.

Keep in mind that you'll also need to update the briefing, group ID and group markers component to recognize your new platoon, if their faction is not included yet.


Regarding your general scripting question:
Don't have the time to reply in detail right now, but I can recommend reddit.com/r/armadev, the BI forums and the ARMA3 discord channel (#mission_makers group) for asking questions such as this.

User avatar
fer
Posts: 1586
Joined: Fri Jun 04, 2010 8:16 am
Location: Emotional wreck

Re: Questions: Custom Gear/Platoons, General Scripting

Post by fer »

ScratchtasticZ wrote:For context, I'm looking to create scripted Gendarmerie loadouts. I've got some uses in mind for that faction and would like to expand the number of classes before using them in more scenarios. For the time-being, I've created loadouts in the Virtual Arsenal, loaded them on to some seed units, and then copy/pasted those units in to the group compositions that I wanted for my scenario. Not an ideal solution; I've had to go back and replace units several times to fix loadout problems already.
Hi ScratchtasticZ - sorry for not responding earlier. We have a new Gendarmerie component coming in v3-4-1 of F3. If you want to grab an early copy of this, download a copy of our Dev repo. I'm afraid the documentation isn't ready, but it works along the same lines as the other platoons. Hope that helps!

ScratchtasticZ
Posts: 2
Joined: Sun Jul 17, 2016 8:16 am

Re: Questions: Custom Gear/Platoons, General Scripting

Post by ScratchtasticZ »

@wolfenswan:

Thanks! I've successfully set up Gendarmerie as a faction (in a scripting sense) and have everything but the loadout tweaks done. Was a good learning experience. Since I only need 5 or 6 different loadouts, it should be easy to just redefine some of the Syndikat loadouts, similar to what you did with your example "cops" file.

I will put my general questions out on some of those other groups you mentioned. I should probably more clearly define what exactly I'm trying to accomplish, too. Bulleted list might be the way to go.


@fer:

Cool! I will check that out. I would need to do some custom loadout changes anyways but that would save me having to create the new/clean briefing/loadout/etc files themselves for the Gendarmerie faction in future projects.

:hist101:

Post Reply