Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Blitzen

Weapon Pack program? Plus trigger question

Recommended Posts

Is there anysort of program that allows me to select weapons and ammo load outs from a weapon pack? For example, something that allows me to quickly configure and load custom load outs (from addon weapon packs) and apply them to soldiers in game? Reason I'm asking is because, though I made a stone age version of such a program, I was wondering if there was anything better out there.

Furthermore, I was wondering if there was a way to reveal all targets within a trigger to a specific unit?

Thanks,

Blitz

Share this post


Link to post
Share on other sites

I've written a simple script that allows me to get a different random weapon from Sanctuary's WW4 pack each time I start a mission. I've also made it possible to be able to select a specific weapon from the script's list and naturally it works with any addon weapons, not just WW4. If this is what you are looking for, let me know and I'll post it here...

as for your other question,

"myUnitsName reveal _x" forEach list TriggerName

Share this post


Link to post
Share on other sites

Oh, well i dont know about the random weapon loadout but the rest sounded good :) what im looking for is a program that will allow me to select weapon classes from different weapon packs. therefore, i can quickly customize weaponloadouts without having to type removeweapon, addweapon, etc. as i said, i already have created an excel sheet that can do this but i was wondering if there was a better way to do this. my apologies for this post as it was written from my phone :)

Share this post


Link to post
Share on other sites

well as I said you can select which weapon you want to get from the list, so here's how it works

_sol = _this select 0
removeAllWeapons _sol
_rnd = (_this select 1)
? (_rnd == 0) : _rnd = random 33
#randomWeapon
_rnd=(_rnd / 1) - (_rnd % 1)
? _rnd ==0 or _rnd > 32 : _rnd = random 33 ; goto "randomWeapon"
_wpn= format ["%1",_rnd]
goto _wpn

;WW4_M16
#1
_sol addmagazine "WW4_W556_30Bmag"
_sol addweapon "WW4_M16"
goto "W556B"

;WW4_AK74M
#2
_sol addmagazine "WW4_E545_30mag"
_sol addweapon "WW4_AK74M"
goto "E545"

;WW4_AK47
#3
_sol addmagazine "WW4_E762_30mag"
_sol addweapon "WW4_AK47"
goto "E762"

.................... script goes on to #32 .......................

#W556B
_sol addmagazine "WW4_W556_30Bmag" ; _sol addmagazine "WW4_W556_30Bmag" ; _sol addmagazine "WW4_W556_30Bmag"
_sol addmagazine "WW4_W556_30Bmag" ; _sol addmagazine "WW4_W556_30Bmag"
goto "equipment"

#E545
_sol addmagazine "WW4_E545_30mag" ; _sol addmagazine "WW4_E545_30mag" ; _sol addmagazine "WW4_E545_30mag"
_sol addmagazine "WW4_E545_30mag" ; _sol addmagazine "WW4_E545_30mag"
goto "equipment"

#E762
_sol addmagazine "WW4_E762_30mag" ; _sol addmagazine "WW4_E762_30mag" ; _sol addmagazine "WW4_E762_30mag"
_sol addmagazine "WW4_E762_30mag" ; _sol addmagazine "WW4_E762_30mag"
goto "equipment

.................... script goes on to cover all mag types .......................

#equipment
_sol addweapon "NVGoggles" ; _sol addweapon "Binocular"
_sol addmagazine "HandGrenade" ; _sol addmagazine "HandGrenade"
exit

now, the script is called like this

[soldiersName,number] exec "script.sqs"

if number is 0 then it chooses a random number between 1 and 33. I have 32 weapons in my script, from three different addons, so you will need to adjust the number to correspond to the number of weapons you will add +1. You can however enter the number corresponding to the specific weapon you want to use and the script will skip over the random selection and give it to you.

[unit66,5] exec "script.sqs"

all you need to do to convert the script is add #1,#2,#3...#999, add the magazine and then add the weapon. since most WW4 or JAM weapons use the same magazines, I only add 1 magazine and then skip to another part of the script that adds the rest, to avoid typing the same line 100 times and keep the script size smaller.

after it adds magazines, the script jumps to the equipment part where you can tell it to add grenades, binocs, satchels etc...

now, since most troops don't have the same loadouts regarding gear, I use 8 scripts with different weapon configurations. For example I use one script for machinegungers that carry 4 mags and 2 grenades, another for saboteurs that have 4 mags and 3 satchels, another for AT etc. In effect what changes is usually just the equipment part.

I hope this is what you were looking for...

Share this post


Link to post
Share on other sites

I hope this is what you were looking for...

Sort of yes, sort of no :o

What I did in excel is allow myself to select different guns and magazines from drop down lists. I broke down the guns and magazines further into both primary (rifles, etc.) and secondary (pistols) so that you can select different rifles, pistols, and magazines. Futhermore, I added different soldier configurations and the ability to select launchers. I was hoping that someone had made something like this but in a more "official" program/style. I wish there was a way I could upload the file to show you but I'm unable to attach documents. :confused:

However, I would like to thank you for your help! The operation flashpoint community really is something special :bounce3:

Share this post


Link to post
Share on other sites

If you have it all organized in a file, you can quickly copy-paste it into the script and make it work.

if what you need is a program to change the weapon and equipment loadouts inside a pbo file, I don't know of any that exist. I however do use this scripts inside a custom pbo I made by adding new units, giving them grenades, binocs, AT launchers etc, but no primary and secondary weapons. I then just have them execute the script from the eventHandlers class

class EventHandlers
{
init ="[_this select 0,0] exec {\troops\scr\rearmRifleman.sqs}; [_this select 0,0] exec {\troops\scr\rearmPistol.sqs}";
};

I do seem to remember another script that allowed you to change loadouts through a dialog screen, but it was buggy and only worked with BIS weapons, meaning that you would have to go through a lot of trouble to add custom addons and make it work. I can't remember who released it or what it was called but I'm sure someone out there has it in their hard drive somewhere.

Share this post


Link to post
Share on other sites

hi,

It will maybe help you.

This script is SP/MP friendly and can be used for a lot of units if needed.

_m16m  = "JAM_W556_30BHDmag"
_m4m   = "JAM_W556_30HDmag"
_mgm   = "JAM_W762M_200HDmag"
_mgmsd = "JAM_W556M_200SDHDmag"
_m4msd = "JAM_W556_30SDHDmag"
_dmrm  = "JAM_W762_20HDmag"
_sgm   = "JAM_12Gauge_Shotgun_Mag" 
_law   = "SUCHSMAWHE"
_law2  = "SUCHSMAWAT"
_gren  = "JAM_M433Vest"
_m21m  = "M21"
_he    = "HandGrenade"
_smoke = "SmokeShell"

_unit = _this select 0
_mags = magazines _unit
_weap = weapons _unit
? !(local _unit): exit
{_unit removeMagazine _x} foreach _mags
{_unit removeWeapon _x} foreach _weap
_typeof = typeof _unit
goto _typeof

#SUCHpatrol
_mags = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he,_he,_smoke]
_weapons = ["LSR_m16a4_acog","Binocular","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHusmcrifle
_mags = [_m16m,_m16m,_m16m,_m16m,_m16m,_m16m,_he,_he,_he,_he]
_weapons = ["LSR_m16a4_acog","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHusmcgren
_mags = [_m16m,_m16m,_m16m,_m16m,_m16m,_gren]
_weapons = ["LSR_m16a4_acog_m203","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHusmcauto
_mags = [_mgm,_mgm,_mgm,_mgm,_mgm]
_weapons = ["LSR_m240_m145","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHusmcsmaw
_mags = [_m16m,_m16m,_m16m,_m16m,_law,_law,_law,_law2]
_weapons = ["LSR_m16a4_acog","SUCHSMAWLAUNCHER","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHusmcmedic
_mags = [_m4m,_m4m,_m4m,_m4m,_m4m,_m4m,_he,_he,_he,_he]
_weapons = ["LSR_m4_acog","NVGoggles","TACTObjCarry"]
goto "REARM"

#SoldierWCrew
_mags = [_m4m,_m4m,_m4m,_m4m,_he,_he,_he,_he,_he,_he]
_weapons = ["LSR_m4_acog","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHrecon
_mags = [_mgmsd,_mgmsd,_mgmsd,_mgmsd,_mgmsd]
_weapons = ["LSR_m249spw_acog_sd","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHrecon1
_mags = [_m4msd,_m4msd,_m4msd,_m4msd,_m4msd,_gren]
_weapons = ["LSR_m4_m203_acog_sd","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHrecon2
_mags = [_m4msd,_m4msd,_m4msd,_m4msd,_m4msd,_m4msd,_he,_he,_he,_he]
_weapons = ["LSR_m4_acog_sd","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHrecon3
_mags = [_sgm,_sgm,_sgm,_sgm,_sgm,_sgm,_sgm,_sgm,_he,_he]
_weapons = ["LSR_m1014_aim","NVGoggles","TACTObjCarry"]
goto "REARM"

#SoldierWsniper
_mags = [_m21m,_m21m,_m21m,_m21m]
_weapons = ["LSR_m21","NVGoggles","TACTObjCarry"]
goto "REARM"

#SUCHftldr
_mags = [_dmrm,_dmrm,_dmrm,_dmrm,_dmrm,_dmrm,_dmrm,_dmrm,_he,_he]
_weapons = ["LSR_m14_dmr","NVGoggles","TACTObjCarry"]
goto "REARM"

#REARM
{_unit addMagazine _x} forEach _mags
{_unit addWeapon _x} forEach _weapons
exit

cya.

Nikiller.

Share this post


Link to post
Share on other sites

I know this is digging up an old thread, but I was wondering if people would be interested in what I've made....:rolleyes:

Its a 2003 Microsoft Excel document that contains lists of common weapon pack class names and allows you to select individual weapons from these packs. Say you want a weapon from SJB's pack: you simply select his pack and then select your weapon. The final selections are spit out into the code box at the bottom. This is great for changing a unit's weapon via the init line.

Download here

pack.jpg

pack2.jpg

pack3.jpg

This is my first "release" of anything on this site. I did not make this to full-fill any sort of conditions (professionalism, no bugs, etc.). I merely found it useful and thought others would as well.

**NOTE: To get this to work, copy the code box into a word document, and then copy the contents of the box to Operation Flashpoint. For some reason or another OFP has a problem with excel's quotation marks. :confused:

***EDIT: I forgot to mention that I also made one of these to work for adding weapons via the description.ext. Same principal different use (one for the init of a unit, another for a description.ext).

Edited by Blitzen

Share this post


Link to post
Share on other sites

@Blitzen - good job dude. May I suggest putting this spreadsheet up on google docs or somewhere similar to make it more available & allow potential users without MS Office/OpenOffice.org to be able to read it in a browser.

The benefit of this is that there is probably some way either using a text mode browser like wget, elinks or curl (or maybe an open Google API) to pull the classnames from the online spreadsheet & somehow make it available to the user inside the mission editor.

I was thinking about this very issue the other day - how to make weapon classnames available inside the editor to you don't need to Alt+Tab between a readme file.

I looked into the Briefing.html (notes, mission description etc) & realized that you can't copy & paste from it.

I wondered about the Tab-completion in the Init string box but that seems to only contain a history of the previous init values (maybe there's an easy way to write to this history buffer?)

The easiest way to copy & paste classnames is by using the "Initialization:" & "Name:" boxes.

So...

...what I came up with was another template mission that contains a set of "WeaponHolder" units for a sampling of the WW4 Weapon classnames.

Each WeaponHolder has the following properties:

Initialization: hintCadet "Weapon Classname"

eg. hintCadet "WW4 M16 Weapon Classname"

(Basically a comment to remind the misson builder what weapon this unit holds, uses hintCadet so advanced users won't see it in game)

Name: THIS LINE HOLDS THE WEAPON/AMMO CLASSNAME(S)

eg. WW4_M16__WW4_W556_30Bmag__WW4_W556_30BHDmag

NOTES:

*Unit name must be unique

*Units copied from another unit will be auto-named (see soldiers on the right hand side of the formation in the demo mission for examples of this)

*Unit names can only use limited characters/no spaces etc. To get around this I used triple underscores: ___ as classname separators as single underscores are usually parts of existing classnames

Now you can copy the weapon & ammo classnames from the WeaponHolder Name Fields & paste them into the init fields of the new units you are editing.

I'm sure this could be automated by scripting the creation of the WeaponHolder units via "SetIdentity" or similar method.

WeaponHolder Demo Mission download link:

http://bit.ly/dL1mre

Addons required:

None

Share this post


Link to post
Share on other sites
May I suggest putting this spreadsheet up on google docs or somewhere similar to make it more available & allow potential users without MS Office/OpenOffice.org to be able to read it in a browser.

I dont really know what this entails, and if it would work, but I will try to look into it.

I was wondering if someone could take a look at another file of mine. It is similar to the one above but is used in the description.ext instead of a unit's init line. Something is wrong with the file as it dosent work at the moment. I believe its a simple syntax issue.

Download Here

Descrip1.jpg

descrip2.jpg

Descrip3.jpg

descrip4.jpg

If anyone is a master with excel, another problem is that the amounts for the higher number weapons are slow to change/refresh. I assume that this stems from the fact that the code box is a copy of a copy and it takes time to load up.

Anyways, if someone could tell me whats wrong with it that would rock. Hopefully after that I can merge the two documents.

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  

×