Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE  (Read 3278 times)

0 Members and 1 Guest are viewing this topic.

Offline Djinn aka KingMobz

  • Dj!NN? ÄĶΆ ҝїиĢмФß
  • Members
  • *
  • EGOtistical megaloMANIAC
    • SECRET COMBINED FORCES
ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE
« on: 24 Oct 2010, 15:34:32 »
Hi, my name is Dj!NN? and this is my first post at OFPEC!  :D

Quite confused why I have never bothered to sign up before [in that I have been using this resource for YEARS!]. Anyways! Just got back to editing so I am a bit rusty. Lately, having found some like-minded ACE 1.09 players, I have been working on converting one of my missions to ACE multiplayer. So here is my question:

Can anyone tell me the best way to place all the WEST ACE rucksack, weapon, ammo and medical items in the chopper my players start in??? I want the players to be able to CHOOSE and sort out their loadout in the locked chopper in the couple of minutes they have to parachute into combat. I know the usual "this addWeapon 'xxx' " etc but I really do not want to go through the complete weapon/magazine xml list included in ACE mod just to do this. Any help would be just dandy :P

Even if you want to send me a wee example that would be great! Thanks in advance!  :good:


----

P.S  :scratch: Shameless plug... anyone looking to play with me and my mates in Europe on good aul ACE1.09, ARMA 1.14 join my Steam Community 'Secret Combined Forces'. My name is djinn08 on steam and we are looking for good team players with TS3! Over and Out!

----Probably the most egotistical megalomaniac this side of Jupiter. Want to mess with this guy? You best be proper packing heat my son.----

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE
« Reply #1 on: 26 Oct 2010, 09:13:30 »
Well, since the weapons are in an XML file, this means you should be able to extract JUST their names from the file easily enough, right? Once you've done that, you can simply put them all inside an array, and then use something like forEach to add all of them to the chopper. Example:

Code: [Select]
_allweaponsarray =
[
"weapon1",
"weapon2",
"weapon3",
"lastweaponinlist"
];

{_heli1 addweaponcargo [_x, 10]} foreach _allweaponsarray;

Basically :)

Now, there's probably some clever way of just extracting this kind of array directly from the config as well, but I'm not too clear on how to do this. Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Djinn aka KingMobz

  • Dj!NN? ÄĶΆ ҝїиĢмФß
  • Members
  • *
  • EGOtistical megaloMANIAC
    • SECRET COMBINED FORCES
Re: ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE
« Reply #2 on: 27 Oct 2010, 13:24:07 »
Thanks for the input. This is the confusing thing I have though. Even when adding ACE weapons to infantry I have some trouble. The XML included with ACE gives me all the details such as the classname, weapon/ammo type etc... but anytime I try and use 'this addWeapon "whateverACEweapon" '  it comes up that the weapon is not included... I don't know if the weapon names are somehow different than what is listed in the XML file. All rather confusing... The other option I'm feeling of resorting to is a weapon choice at briefing... which I'm sure I'll be able to get something online for. Your idea is VERY good, and it will be my first real attempt at a proper script for ARMA. I just need to make sure that the weapon names I use are correct. Adding vanilla weapons should not be an issue, just the ACE ones. Thanks again!

----
EDIT: Just did a little test, and it turns out that the XML that ACE 1.09 gives me must be slightly out of date as some ACE weapons can be added when I use their inheritance tag WHILE others give me an error message as the weapon name is incorrect. Grrr :P Just have to do a lengthy trial and error!

EDIT2: Okay... turns out the weapon_config xml I was using WAS incorrect... and i should really have been using ACE_Class_List in C:\...\ArmA\@ACE\Docs\Dev Docs... will keep you updated on how your script works. Thanks again!



-------------------------

Ok... last edit as I seem to have got a bit further: I have placed a trigger set off by my players presence stating: On Act -- [] exec "cargo_allweapons.sqs" .  The vehicle is called _truckcargo. Then I have the .sqs with this in it so far to test:

Code: [Select]
_allweaponsarray =
[
"ACE_Rucksack_MOLLE_Green",
"ACE_Rucksack_MOLLE_ACU",
"ACE_Rucksack_MOLLE_WMARPAT",
"ACE_Rucksack_MOLLE_DMARPAT",
"ACE_Rucksack_MOLLE_Wood",
"ACE_Rucksack_MOLLE_Green_Medic"
];

{_truckcargo addweaponcargo [_x, 10]} foreach _allweaponsarray;

Upon load I get a 'generic error' as script attempts to load... and of coarse none of the rucksacks in the vehicle. Any ideas what I have done wrong in the .sqs???  ???
« Last Edit: 27 Oct 2010, 14:36:11 by Djinn aka KingMobz »
----Probably the most egotistical megalomaniac this side of Jupiter. Want to mess with this guy? You best be proper packing heat my son.----

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE
« Reply #3 on: 27 Oct 2010, 15:59:08 »
.sqs doesn't support any kind of formatting so change the _allweaponsarray into one line instead of multiple lines.
Code: [Select]
_allweaponsarray = ["ACE_Rucksack_MOLLE_Green","ACE_Rucksack_MOLLE_ACU","ACE_Rucksack_MOLLE_WMARPAT","ACE_Rucksack_MOLLE_DMARPAT","ACE_Rucksack_MOLLE_Wood","ACE_Rucksack_MOLLE_Green_Medic"];
Also, you can't name your truck as _truckcargo. Well you can but it is unusable in any script because an underscore means a variable is local so the variable _truckcargo in the script will not point to the truck named _truckcargo, it points to a null variable and the script will never work.

Change both the truck name and the variable in the script to truckcargo and it should work.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Djinn aka KingMobz

  • Dj!NN? ÄĶΆ ҝїиĢмФß
  • Members
  • *
  • EGOtistical megaloMANIAC
    • SECRET COMBINED FORCES
Re: ALL ARMA ACE WEAPONS AVAILABLE IN VEHICLE
« Reply #4 on: 27 Oct 2010, 19:13:21 »
 :clap: Thank you VERY much both of you! Think we can mark this as resolved! Working perfectly now. Going to copy this over to my main mission now with my UH-60. Just in case anyone needs a rundown of it all:

- Use ACE_Class_list.pdf in C:\...\ArmA\@ACE\Docs\Dev Docs... for classnames for weapons/mags/ammo etc.

- After creating your vehicle [in this case named 'truckcargo'] make a switch activated in-game by players presence with initiation of:
Code: [Select]
exec "cargo_allweapons.sqs"
- In cargo_allweapons.sqs use the following code with no punctuation:

Code: [Select]
_allweaponsarray=["ACE_Rucksack_MOLLE_Green","ACE_Rucksack_MOLLE_ACU","ACE_Rucksack_MOLLE_WMARPAT","ACE_Rucksack_MOLLE_DMARPAT","ACE_Rucksack_MOLLE_Wood","ACE_Rucksack_MOLLE_Green_Medic"];{truckcargo addweaponcargo [_x, 10]} foreach _allweaponsarray;
Load the game and it WORKS. Takes some time to input the weapons but works a charm! And again thanks! Surprised I've got this far in my mission design without using scripts lol. Will probably have MORE questions!  :scratch:
« Last Edit: 27 Oct 2010, 19:15:12 by Djinn aka KingMobz »
----Probably the most egotistical megalomaniac this side of Jupiter. Want to mess with this guy? You best be proper packing heat my son.----