Home   Help Search Login Register  

Author Topic: Creating custom ammo crates  (Read 928 times)

0 Members and 1 Guest are viewing this topic.

Amarak

  • Guest
Creating custom ammo crates
« on: 17 Oct 2002, 20:37:46 »
I was looking for some information on making some custom crates for weapons packs to use on some MP missions.  I am creating crates for sniping, heavy weapon(anti tank), AA, and assualt weapons.  I am looking for a way to write the script so I can reuse it in various boxes without having to write every crate name in a lot of scripts.  Hope this is making sense.    ;D
In other words, does this addweaponcargo ["", ] work for making 5 different crates, or do I have to make a script for each and every ammo box I create?  Thanks for the assistance.

Amarak   :cheers:

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Creating custom ammo crates
« Reply #1 on: 18 Oct 2002, 02:28:49 »
Welcome to the forums, Amarak

I would suggest one of two things:
  • Separate Scripts
    Have a separate script for every 'class' of ammo crate. Then execute it in the init field of each crate, depending on what class you are after. eg.

    this exec "Snipercrate.sqs"
    this exec "HeavyATcrate.sqs"

  • Fill from the init.sqs
    You could also fill up the crates in the init.sqs. For instance, it might look something like this:

    "_x addweaponcargo [""LAWLauncher"",5]" foreach [ crate1,crate2 etc...]

    "_x addweaponcargo [""SVDDragunov"",5]" foreach [ crate5,crate6 etc...]

    So there [ crate1,crate2 etc...] would be all the crates you want to make AT crates, while [ crate5,crate6 etc...] would be all the crates you want to have as 'sniper' class. ;)

Amarak

  • Guest
Re:Creating custom ammo crates
« Reply #2 on: 23 Oct 2002, 08:17:53 »
Please excuse my tardiness on replying.  That idea works great.  In essence, exactly what I wanted to do, but unfortunately, I was thinking of doing just that, but in a different way.  Thanks for replying.  I am off to do some more editing :D