Home   Help Search Login Register  

Author Topic: Varialbe names for Ammo Crates  (Read 870 times)

0 Members and 1 Guest are viewing this topic.

Nasty Buttler

  • Guest
Varialbe names for Ammo Crates
« on: 21 Feb 2003, 06:38:00 »
Hi,
   Alot of people think that when they put a name into the Ammo Crate field they will be assigning the crate that variable name. This isnt so.....here is a little test

name your crate "AMMO1"

now make a trigger with a radio channel trigger...
in the Onactiv part write this

hint ["The name of this crate is \n::> %1", AMMO1]

now what will happen is that you will get a NOID for it
BUT if you type this

hint ["The name of this crate is \n::> %1", typeof AMMO1]
it will return the type of ammo crate

now what i want to know is how i can get an ammo crate to never be destroyed, ie i want to actually have it so i can detect when the crate has been destroyed so i can either repair it or create a new one.....


So recap, how do u assign a crate a variable name you can send to a script or an event
Please only post if you know what you are talking about as miss information will help no-one....

« Last Edit: 21 Feb 2003, 06:39:10 by Nasty Buttler »

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Varialbe names for Ammo Crates
« Reply #1 on: 21 Feb 2003, 09:14:25 »
Hey there, Nasty Buttler

  Alot of people think that when they put a name into the Ammo Crate field they will be assigning the crate that variable name. This isnt so.....here is a little test

Afraid you've got it a bit wrong there old boy ;)

The name field of an object is where you assign it it's variable name. The test you did there:

hint ["The name of this crate is \n::> %1", AMMO1]

Will not return the variable name... try it on a Soldier. You won't get it's name back, you'll get a callsign "Alpha Black 1, Kilo Red 4 etc."

So, you can still use the name field of an ammo crate to assign it a variable name. If you couldn't, then placing weapons in using the init.sqs (which I do successfully in almost every mission I make ;)) would not work.

You should still be able to detect when an ammo crate is destroyed by:

not (alive ammocrate)

or get the damage value by:

getdammage ammocrate

Anyway, hope that's shed some light on the problem ;)
« Last Edit: 21 Feb 2003, 09:17:30 by Sui »

DELTA Turkinator

  • Guest
Re:Varialbe names for Ammo Crates
« Reply #2 on: 21 Feb 2003, 12:24:43 »
So, any of you guys have an idea of how to do this -

I wanna make the ammo crate fill up with my own weaponry and when sum1 takes a bit out, it prints their name and what they are taking out.
Well, you don't need bother about what they are taking out, just the printing name bit.

Any ideas? :hmm: