Home   Help Search Login Register  

Author Topic: weaponholder addon.  (Read 1268 times)

0 Members and 1 Guest are viewing this topic.

Offline MattyDienhoff

  • Members
  • *
weaponholder addon.
« on: 14 Nov 2004, 11:27:13 »
This is... (hopefully) a solution to a problem i've had for a long time - How to have guns just lying around on the ground. (Like when you drop them in RES but without having to drop guns everywhere) Recently, I downloaded Dan AK47's pack. And in the pack all of the guns also had "object" counterparts which were just the guns lying on the ground like someone had dropped them. I emailed him asking how he did it, and his reply is as such.

Quote
You can do it by creating a vehicle called
WeaponHolder and doing "this addweaponcargo
["M16",1]". You can also add magazines to it with
"this addmagazinecargo ["M16",(number)]" (don't want
an empty gun laying there do you?).

WeaponHolder is not visible in the editor, but you can
create it by renaming the classnames in notepad (same
way you make houses..) or making a gamelogic and
putting "somenamehere = "WeaponHolder" createVehicle
getpos this" in the init field.

I tried the last method there. (Its the only one i even have the slightest idea of) but i can't get it working. Could someone simply make an editor selectable "weaponholder" so i can just simply place one wherever i choose and put weapons in them? I searched Google, the OFPEC forum, the BIS forum and the knowledge base here at OFPEC. But i can't find anything about it. Will someone help me?

Offline Platoon Patton

  • Members
  • *
  • "Barbecue" CreateVehicle getpos LLama
Re:weaponholder addon.
« Reply #1 on: 14 Nov 2004, 14:43:25 »
First idea is:
Code: [Select]
somenamehere  addweaponcargo ["M16",(number)] in your init .sqs instead of this...?

http://www.platoon-clan.com/ We always wellcome dedicated OFP players :)

http://www.european-combat-league.com/index.php To play with us in the best OFP league ;)

Offline MattyDienhoff

  • Members
  • *
Re:weaponholder addon.
« Reply #2 on: 15 Nov 2004, 08:05:57 »
I would prefer if someone who knows how would make an addon of this "weaponholder". Note what DanAK47 said
Quote
WeaponHolder is not visible in the editor, but you can
create it by renaming the classnames in notepad (same
way you make houses..)
I don't know how to do that. But i was hoping someone here did. I don't want to have to fool around in an init.sqs every single time i want to place a loose weapon somewhere.

Offline KTottE

  • Former Staff
  • ****
Re:weaponholder addon.
« Reply #3 on: 15 Nov 2004, 10:00:01 »
Here's a test version of an addon that does the job.
New objects located under Empty - Objects in the editor, they're named Weaponholder - Primary and Weaponholder - Secondary, respectively.

Use addWeaponCargo and addMagazineCargo to add weapons to them, other than being in the editor these work exactly the same as the other weaponholders.
"Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming 'WOW What a Ride!'"

Offline MattyDienhoff

  • Members
  • *
Re:weaponholder addon.
« Reply #4 on: 15 Nov 2004, 10:34:55 »
Great! Thanks a lot!! Primary works for pistols as well as rifles etc...
 ;D Thanks again! :cheers:

:EDIT: I got a little creative with the weaponholder and did this  :P

and this...
« Last Edit: 15 Nov 2004, 11:19:22 by MattyDienhoff »