Home   Help Search Login Register  

Author Topic: Objective complete when weapon in hand  (Read 1667 times)

0 Members and 1 Guest are viewing this topic.

Offline prodetar2

  • Members
  • *
Objective complete when weapon in hand
« 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?
BOOM!

"You are dead"

Offline ModestNovice

  • Members
  • *
Re: Objective complete when weapon in hand
« Reply #1 on: 10 Jul 2008, 21:21:25 »
Well nvr mind all that fancy stuff.

Put a trigger.
Condition:
Code: [Select]
count weapons player != 0On Activation:
Code: [Select]
"1" objStates "DONE"; hint "Objective 1 Complete."

« Last Edit: 11 Jul 2008, 06:23:03 by DaChevs »
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Objective complete when weapon in hand
« Reply #2 on: 11 Jul 2008, 09:06:46 »
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>. 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.
"When 900 years YOU reach, look as good you will not!"


Offline prodetar2

  • Members
  • *
Re: Objective complete when weapon in hand
« Reply #4 on: 11 Jul 2008, 18:07:22 »
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 :)
« Last Edit: 11 Jul 2008, 19:55:00 by prodetar2 »
BOOM!

"You are dead"

Offline ModestNovice

  • Members
  • *
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline prodetar2

  • Members
  • *
Re: Objective complete when weapon in hand
« Reply #6 on: 11 Jul 2008, 20:22:34 »
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
BOOM!

"You are dead"