Jump to content
Sign in to follow this  
blank1

Starting units with custom weapons?

Recommended Posts

Is there any way that i can start my units off in a mission with weapons other then the default class weapon? For example; start a sniper unit (ghillie suit) with a assault riffle? that possible. Thanks for any help on this subject.

Share this post


Link to post
Share on other sites

sorry to steal a thread but i have been trying to use this on vehicles and have not been able to get the syntax and all that corrent, either that or it isnt possible how i am trying to...

here is the "initialization" section of the vehicle..

veh = [this, 600, 600] execVM "vehicle.sqf"; addmagazine = "2Rnd_Maverick_A10";

would that add the extra 2 mav's in it ( tried it but it didnt add them, was thinking ihad to remove all the other ammo or something and then place the ammo i want) or am i just doin' it wrong? ( assuming the latter, never did any scripting like this and just trying to learn lol)

Share this post


Link to post
Share on other sites

I have very little experience in this but everything I've read so far when it comes to loadouts is to run removeAllWeapons first. Take a look at page 71 in Mr Murrays editing guide that I linked to above.

Share this post


Link to post
Share on other sites
I have very little experience in this but everything I've read so far when it comes to loadouts is to run removeAllWeapons first. Take a look at page 71 in Mr Murrays editing guide that I linked to above.

That just removes everything. If you only want to change weapon, you can just do removeweapon + addweapon (and obviously switch magazines as well if they dont use the same type).

Share this post


Link to post
Share on other sites

i was thinking that i had to remove all ammo and weapons then re-place them but i didn't try it, was just trying to ad an extra 2 mavs to the A10, i will try to remove ALL weapons and ammo then add what i want.

anyone want to throw up a script that will drop all A10 standard ammo and weapons and have W+ for weapon name and A+ for the ammo?, would take me a whole day just to figure that out haha ( test syntax, test syntax, test syntax, ETC, ETC)

if you dont want to then just let me know if my syntax was correct above and ill figure it out from there ( if that is the right way then all i got to do is keep goin')

thanks in advance

Share this post


Link to post
Share on other sites

addmagazine "2Rnd_Maverick_A10";

No =

and it doesn't add 2 extra rounds, it adds a magazine of 2 rounds, so you'll fire 2 rounds, reload, and can fire 2 more. so you'll have 2x2 not 4. get it?

Here

Weapon Class(1) = GAU8

Weapon Class(2) = MaverickLauncher

Weapon Class(3) = SidewinderLaucher_AH1Z

Weapon Class(4) = BombLauncherA10

Weapon Class(5) = FFARLauncher_14

Magazine Class(1) = 1350Rnd_30mmAP_A10

Magazine Class(2) = 2Rnd_Maverick_A10

Magazine Class(3) = 2Rnd_Sidewinder_AH1Z

Magazine Class(4) = 4Rnd_GBU12

Magazine Class(5) = 14Rnd_FFAR

removeweapon "GAU8"

removemagazine "1350Rnd_30mmAP_A10"

addmagazine "1350Rnd_30mmAP_A10"

addweapon "GAU8"

Allways add magazine before weapon, so you don't have to "reload" the magazine when you switch to that weapon.

Edited by Big_Daddy

Share this post


Link to post
Share on other sites

ah thanks.. i think i tried it without the "=" ( veh = [this, 600, 600] execVM "vehicle.sqf"; addmagazine "2Rnd_Maverick_A10"; ) but it said "missing ; "

hmm....

ill play with it a bit and get it workin'. thanks again

Edited by H3NRY

Share this post


Link to post
Share on other sites

hmm.. well thats the part i was just about to ask, will it happen every time it respawns.

it wouldnt be somethign as simple as adding the line to the vehicle.sqf, it would have to be defined what vehicle it is for and when to exec ( after the if (_dead) then statement i assume.. i could even make a whole new one with the added " load" script to it and use it only on the a10's)

code is gonna fry my brain :)

Share this post


Link to post
Share on other sites

You could have the initialization script name (aka "tankinit.sqf") be another parameter that the vehicle.sqf script receives, and executes that script with the vehicle as a parameter every time it respawns the vehicle (or do nothing if that parameter does not exist).

For example, if you currently use 3 parameters, call the script with an extra parameter such as "tankinit.sqf" which should have the same command that you run in the init (aka this addMagazine whatever).

In vehicle.sqf add:

_veh = _this select 0;
.....
_vehicleInitScript="";
if (count _this > 3) then
{
  _vehicleInitScript = _this select 3;
};

.....
veh = createVehicle ...
if (_vehicleInitScript != "") then
{
  _veh execVM _vehicleInitScript;
};
.....

Share this post


Link to post
Share on other sites

Is it possible to change your enemies particular weapon in a mission? I'm currently using the FFAA_terrorista's in a mission and most of them use that AKM popgun thing and the sound of it is driving me nuts'o'rama! I can barely play my own mission. *sniff*

Share this post


Link to post
Share on other sites

Yes it is. Same remove/add weapon and magazine commands.

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  

×