OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: laggy on 29 Apr 2009, 23:12:20

Title: Checking AMMO class through eventhandler/hint
Post by: laggy on 29 Apr 2009, 23:12:20
EDIT: _this select 4
does return the ammo class, sorry
:-[

Hello,

I'm building a mission with ACEmod.
What I need to know is the name of certain ammo classes so that I can createVehicle those when desired.
I could of course just use BIS regular, but the immersion effects (ears ringing etc.) does only work for ACE classes.
Unfortunately ACEmod's class list does NOT include ammo, just weapons and magazines.
Is there a way to check what the ammo class fired is called through an eventhandler with a hint?

What I don't know is how to check for the ammo class fired and get that string/class name, I know enough about hints and eventhandlers.

_ammo = _this select (1-3) in an eventhandler "fired" doesn't seem to work, while "_this select 0" does return the "shooter".

Do I need to use near(est)Object(s) or something?
Is it possible at all?

Thanks in advance,

Laggy
Title: Re: Checking AMMO class through eventhandler/hint
Post by: Deadfast on 29 Apr 2009, 23:16:24
Quote
Passed array: [unit, weapon, muzzle, mode, ammo]

So _this select 4 is what you're looking for.
Title: Re: Checking AMMO class through eventhandler/hint
Post by: laggy on 29 Apr 2009, 23:20:37
Just found that out at the wiki, I'm an idiot, thanks a lot anyway  :-[
Title: Re: Checking AMMO class through eventhandler/hint
Post by: i0n0s on 30 Apr 2009, 00:42:42
And you can't createVehicle ammo, you can create a weaponholder and add the ammo in its cargo.
Title: Re: Checking AMMO class through eventhandler/hint
Post by: Luke on 30 Apr 2009, 01:40:32
@ i0n0s,

You could do "ammotype" createvehicle pos, but you would just create the bullet rather than the magazine.

Luke
Title: Re: Checking AMMO class through eventhandler/hint
Post by: i0n0s on 30 Apr 2009, 01:59:03
I thought of the magazine, maybe because I'm currently reworking that part of the RTE  :-[
You can create bullets via createVehicle and you can crash ArmA by adding the ammotype in the mission.sqm :whistle: