OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: prodetar2 on 10 Jul 2008, 20:58:10
-
Hi, this is the idea:
you pick up a weapon and then you should have "objective complete" how do i make arma see that i have the weapon so i can complete the objective?
-
Well nvr mind all that fancy stuff.
Put a trigger.
Condition:count weapons player != 0On Activation:"1" objStates "DONE"; hint "Objective 1 Complete."
-
It depends on if you're talking about a primaryWeapon (i.e. a rifle, machine gun etc) or a pistol, and if it's to be that particular (type) of weapon or any weapon at all. The easiest method for finding out if the unit has a gun in hand (not a pistol) is to use:
condition: primaryWeapon Player !=""
Basically the primaryWeapon command always returns an empty string ("") while the unit is unarmed, so once it returns something else = unit is armed.
If you have a specific weapon in mind (pistol, rifle, launcher..) then the easiest might be to do something like:
condition: "M16A4" in (weapons Player)
You'll find the weapon classnames over in our comref : <link> (http://www.ofpec.com/COMREF/armaweapons.php). This one basically works using the "in array" command, which checks the string "M16A4" (or whatever your weapon name is) against the array created by the command "weapons unit" (in this case the weapons of the player).
DaChev's method also works, but then the player can't be carrying any other "weapons", i.e. binoculars or night vision goggles. :)
:good: Good luck.
Wolfrug out.
-
http://www.ofpec.com/ed_depot/index.php?action=details&id=435&page=0&cat=xyz (http://www.ofpec.com/ed_depot/index.php?action=details&id=435&page=0&cat=xyz)
-
hey all, thnx for your replies :)
ill check it out soon. 3 different ways, one must work right?
and yes it's a primary weapon
called "Shotgun" if im not mistaken...
EDIT: Tested it, works great :) thnx
new question:
Does the Camera script tutorial from ofp work the same for arma? i dont see any special one for arma, correct me if im wrong :)
-
http://www.armaholic.com/page.php?id=3172 ;)
-
thnx! :)
i kinda was trying out the OFP scripts and they were actually working so ill continue with that untill i get stuck, thnx again :D