Home   Help Search Login Register  

Author Topic: Create ammo crates the easy way!!!  (Read 1873 times)

0 Members and 1 Guest are viewing this topic.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Create ammo crates the easy way!!!
« on: 16 Mar 2005, 22:27:21 »
hello,

I hope this is not already know but I thought of and tested a very easy way to fill an ammo crate.

If you dont want to learn to and go through the hassel of making a script for your ammo crate to be filled, then this is for you.

its extremly simple but very effective,


ok, lets say you wanted the BAS "M4 e holotech" that comes with the BAS pilot, to go in an ammo crate,

now there is no ammo crate that automaticly has this in it, and u either dont know how, or are dont want to make a script.

all you do is place a BAS pilot, on the ground where you want the ammo crate to be, either slide his health bar to zero, or type  "this setdammage 1"     (no quotes) in his init field,

then place the ammo crate on top of him(you may need to overlap 2 crates to cover his body completely,

when the player runs out of ammo, and goes to restock at the ammo crate, he will think that the "M4 e holotech" is in the crate but it is really in the hands of a dead BAS pilot under the crate. if you want more mags for it in the crate then just, place another BAS pilot on top of the old one and put the ammo crate over both of them,

i hope that nobody already posted a topic like this but i thought I needed  to tell everybody this,

I hope you find use for it

thanks
penguin

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Create ammo crates the easy way!!!
« Reply #1 on: 16 Mar 2005, 22:44:11 »
Sounds good. Would it work if you setpos-ed the pilot just underground a bit first, so he can't be seen at all?  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Create ammo crates the easy way!!!
« Reply #2 on: 16 Mar 2005, 22:47:26 »
3 things. :)

1. i dont think so, id be like using the action hide body

2. u already cant see him at all, ive tried it.

3. im tring to keep this simple for the beginers

thanks

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Create ammo crates the easy way!!!
« Reply #3 on: 16 Mar 2005, 22:59:44 »
Ah, OK. I'll leave now before I make even more a prat of myself  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Create ammo crates the easy way!!!
« Reply #4 on: 16 Mar 2005, 23:03:01 »
Quote
1. i dont think so, id be like using the action hide body
I don't think it is the same.  If you put a body underground then that is where it stays.  If you hide a body, after a whike it is mived a very long way away

Dubieman

  • Guest
Re:Create ammo crates the easy way!!!
« Reply #5 on: 16 Mar 2005, 23:56:20 »
There may be a small bit of lag with more units and crates. I find it easier to just get the ammo listing. But I like the idea. ;)

Hide body, makes all equipment unaccesible. I tried something with the action, found that units can hide body themselves ;D.

Hmm, jsut tested it quickly, setpos doesn't work with bodies. Oh well... ::) :)


Kyle Sarnik

  • Guest
Re:Create ammo crates the easy way!!!
« Reply #6 on: 17 Mar 2005, 00:20:16 »
Well, it sounds like more of a hassel to do this then to fill the ammo crate myself with what I want. Anyways there are some flaws in your idea (sorry but its my job to poin them out):

1. If any explosions go off near the crates, the body will be moved.

2. If the ammo crate is destroyed, being able to pick up weapons would still be possible

3. Since the soldier has only 10 (or less in some cases) ammo slots, when you swaped a weapon it would cause problems with storage, etc...

4. BlackOps or Spetznaz (or any soldier with the hide body ability) can hide the body, causing the weapons and ammo to be no more.

5. Its kinda a bad idea, I mean it defeats the whole purpose of an ammo crate, and it really really is simple as hell to create a script to fill the ammo crates.

6. MP, this would never work right in MP, especialy with delete dead body scripts, etc...

7. If one soldier can't fill it up to your standards, and you use multiple soldiers, thats where it really gets buggy, and could result in some actions causing bad lag

8. If anyone is having trouble filling ammo crates, ill make them a script myself just for them, since it really should be a requirement before you start any mission. And there have to be tons of scripts allready made that do this

Code: [Select]
_magazines = _this select 0
_weapons = _this select 1
_box = _this select 2

clearmagazinescargo _box
clearweaponscargo _box

{_box addmagazinecargo [_X,1]} foreach _magazines
{_box addweaponcargo [_X,1]} foreach _weapons
exit

Simple, see? Just make the parameter something like this:
[["M16","M16","M16","M16","HandGrenade","HandGrenade","BerettaMag"],["M16","Beretta"],this] exec "ammofill.sqs"

Using that in the init of the ammo box would fill it with 4 M16 mags, 2 hand grenades, 1 M9 mag, 2 M16s and 1 M9.

[MagArray,WeapArray,boxname]

MagArray = ["classname","classname","classname"]
WeapArray = ["classname","classname","classname"]
boxname = ammo box name (or this for init box)

Incase you don't all know what arrays are.

Also, if you don't know any classnames, name your BAS pilot AmmoGuy and add this to the ammo box init:

[magazines AmmoGuy,weapons AmmoGuy,this] exec "ammofill.sqs"
« Last Edit: 17 Mar 2005, 00:21:47 by Kyle Sarnik »

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Create ammo crates the easy way!!!
« Reply #7 on: 17 Mar 2005, 02:26:36 »
hmm, actualy,


1. no the body stays where it is in the case of an explosion, its traped inside the ammo crate. only if like 20 grenades wentt of at the same time would it come out, and thats not to likely.

2.I dont think thats somthing sombody would notice.

3.no storage problems are created, ive been using the system for a long time, and ive never got any kind of "storage problems"

4.  The only person gona be doing that is the player, not somthing sombody would notice.

5. an ammo crate is eye candy kind of. the only reason its there is so the player knows where to get ammo and so that its more realistic then taking ammo out of the ground.

it dosent defeat the purpose of it. (im pretty sure that making you write a script is not the purpose of an ammo crate.)

6. dead body scripts are called on certain units, the mission maker would be smart enough not to call the delete body script on the ammo crate corpse.

7. no, not really, 1 or 2 bodys wont cause lag.

8. ya but i made this for beginers, who dont know how to make scripts. and for lazy people, I hate making ammo scripts, even when u know how to make scripts, its a pain.
esspecialy when u have more than one crate.

ya and on top of that if your using addons its even more of a pain, you have to go locate the name of each weapon and magazine because somtimes its not in the readme(actualy a lot of the time.

yes i know how to make an ammo script. but thanks anyways.
 

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Create ammo crates the easy way!!!
« Reply #8 on: 17 Mar 2005, 03:40:03 »
Even easier way is to downlaod Chris' OFP Script Editor in which it has a Crate Builder Wizzard. It empties the crate for ya and then you get to select Weapons, Ammo, Equipment. Nice and Tidy. Well expalined. Very easy to Use.

 Well  there's my 2 cents. :D
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Create ammo crates the easy way!!!
« Reply #9 on: 17 Mar 2005, 04:05:29 »
well, i dont know about easier, but probably alot more effective,

look guys, i dont want to get in a discussion about this, it was just ment to be like if u just started making a mission and u dint know if u were gona trash it or not, then why would u write a script.

i just thought people shud know about it.

and

Quote
If anyone is having trouble filling ammo crates, ill make them a script myself just for them

everybody, i urge u to take him up on that, when are u gona get another chance like this ;)

Kyle Sarnik

  • Guest
Re:Create ammo crates the easy way!!!
« Reply #10 on: 18 Mar 2005, 04:56:48 »
Fine, but instead of using "setdammage 1" on the unit, do this:

Code: [Select]
_unit = _this select 0
_box = _this select 1

_mags = magazines _unit
_weapons - weapons _unit

_weapons = _weapons - ["Throw","Put"]

deletevehicle _unit

{_box addmagazinecargo [_X,1]} foreach _mags
{_box addweaponcargo [_X,1]} foreach _weapons

A much betterr solution to applying weapons to ammo crates off of a units body. Call [this,ammocrate] exec "ammofill.sqs" in the units init box, and you don't have to worry about any rotting dead bodies stinking up your ammo crates.

Offline Roni

  • Members
  • *
  • Play the Game !
Re:Create ammo crates the easy way!!!
« Reply #11 on: 18 Mar 2005, 09:30:59 »
I think that the whole point is that here is an easy way to do something that normally takes a script to do.  If you're creating the entire D-Day campaign as an OFP mission then forget it, but if you're just making a quick mission then it looks liema very useful little trick to know.

Thanks for the tip penguindude - nice creative thinking !   :thumbsup:



roni

Kyle Sarnik

  • Guest
Re:Create ammo crates the easy way!!!
« Reply #12 on: 18 Mar 2005, 22:14:03 »
Eh, but its not really usefull, and I think its a little dumb. If you don't want to make a script, then simply use the init feild, or create a new ammo crate addon that contains the weapons and ammo be default.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Create ammo crates the easy way!!!
« Reply #13 on: 19 Mar 2005, 04:53:38 »
 kyle, u dont get it.


making an addon takes even longer then a script

u probably havent even tried it, your just arguing for the sake of arguing, and your wasting my time.

now please just let it go.

thanks
« Last Edit: 19 Mar 2005, 04:54:01 by penguinman »