Jump to content
Sign in to follow this  
Inkompetent

Quick magazine-adding in init lines

Recommended Posts

Here we go again!

Was pondering what methods do people use to quickly add a whole bunch of identical magazines to a unit's init-line?

I myself have settled with the below because it's easy to read with the numbers showing how many magazines I actually do add:

{this addMagazine "magazineName"} forEach [1,2,3,4,...];

What other methods to people use to make it shorter and easier to read? Curious for information, intending to add the 'winner advice' to the wiki.

Edited by Inkompetent

Share this post


Link to post
Share on other sites

I just do it once, then copy and paste it as many times as I want. :D

Share this post


Link to post
Share on other sites
I just do it once, then copy and paste it as many times as I want. :D

Sure is quick! Until I want to see if I actually added six or seven rifle magazines. Then it starts getting troublesome! :p

Share this post


Link to post
Share on other sites

ForEach method is nice for quick tests, but I would rely on scripts for actual mission design which may be subject to heavy changes along the way.

Share this post


Link to post
Share on other sites

This saves ya some typing especially when you have a lot of mags, like 50:

for "_i" from 1 to 50 do {this addMagazine "magazineName"};

Share this post


Link to post
Share on other sites

Good one, Sickboy. Hadn't even occured to me to use ordinary loops in the init-lines >.<

And as for scripts... Well, personally I'm not too fond of them. Depends on mission, but it can be nice to see during the briefing what the unit is equipped with, rather than to have to wait until one is 'in-game'.

Share this post


Link to post
Share on other sites

Added both mine and Sickboy's suggestions to the wiki since they were about equal in useability, depending on preference and situation. Thanks all.

Share this post


Link to post
Share on other sites

If you really want to have custom stuff, you should probably use a loadout script, so that you call the script with the unit's name and pre-defined loadout and the unit will be equipped with that loadout. That way if you have multiple units using the same loadout it'll be much easier to change that loadout. For multiplayer compatibility, make sure to call the script using hNil = [this, "loadoutname"] call compile preprocessFile "scriptname.sqf" and only run it on the server, that way all units will get their gear before any players even finish loading the mission and thus you will be able to see weapons in briefing and you will not have locality issues.

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  

×