OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: voodzia on 21 May 2005, 18:20:03
-
I wanted to play around with command selectWeapon since I found it that it could be pretty useful in my mission. But I have a problem with its second operand - weapon. How am I to know what weapons e.g Mi24 is equipped with? I tried to use commands primaryWeapon or secondaryWeapon but this ain't working. A short sample of
; hind - name of my Mi24 helicopter
hint format["%1\n%2", primaryWeapon hind, secondaryWeapon hind]
Can someone tell me what wrong is with that?
Thank you in advance for help.
-
HellfireLauncherHind
Rocket57x64
MachineGun30
There all the MI24's weapons so try something like
Hind selectweapon WEAPON_NAME
-
How do you know that these are the right names? And what about some other hinds - made by addon makers? I mean there must be some way to get these names via script commands. Show me the way - but don't walk it with me ;) And one more thing - why this simple command ain't working?
-
weapons vehicle
Operand types:
vehicle: Object
Type of returned value:
Array
Description:
Returns array of names of all vehicle's weapons..
Example:
weapons player
-
The weapon names are just the class names from the games config.
So, if you wanted the class names from 3rd party addons you would need to look in its config.cpp if they weren't listed in the readme.
btw....those names must be enclosed in quotes.
"HellfireLauncherHind"
"Rocket57x64"
"MachineGun30E"
Planck
-
Thank you macguba - that's exactly what I was looking for.
-
Does that always work Macguba?
Planck
-
How do you know that these are the right names
look in the editors depot theres a list with every single weapon and magazine name in it thats where i got it from
-
Does that always work Macguba?
Don't see why not. I used it on a bunch of vehicles the other day when I was making my tank smoke script and wanted to know what machine gun everybody had.
-
I just would like to add that weapons command works not only with vehicles - it works also with soldiers - I've just tested it in my mission. And btw, commands primaryWeapon and secondaryWeapon work fine with soldiers but ain't working with vehicles. Actually I don't know why but that's the way it is.