Home   Help Search Login Register  

Author Topic: unit hasWeapon "radio"  (Read 1125 times)

0 Members and 1 Guest are viewing this topic.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
unit hasWeapon "radio"
« on: 19 Sep 2005, 07:23:02 »
I want a trigger witch start when player take an R109 radio (RHS addon) (class name: LSR_R109).

I try this:
contition: player hasWeapon "LSR_R109"

But daes happen nothing. If I changed the radio to a real weapon (eg: RHS_AK47) it's working.

How can I detect, the player take a radio?
« Last Edit: 19 Sep 2005, 07:23:14 by bardosy »
Fix bayonet!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:unit hasWeapon "radio"
« Reply #1 on: 19 Sep 2005, 12:51:18 »
try adding parenthases:

Code: [Select]
(player hasWeapon "LSR_R109")

"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:unit hasWeapon "radio"
« Reply #2 on: 20 Sep 2005, 04:27:05 »
or perhaps you have the classname wrong?

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re:unit hasWeapon "radio"
« Reply #3 on: 20 Sep 2005, 10:04:57 »
Tyger: parenthases???? Why? What's the differente? But I'll try...

Triggerhappy: if the class name was not coorect, there may be en error message. But I'm sure, the classname is LSR_R109...

Fix bayonet!

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:unit hasWeapon "radio"
« Reply #4 on: 20 Sep 2005, 13:39:20 »
Sometimes it just needs parenthases to work.

Try using addWeapon "LSR_R109" to see if that is the correct class name.
If it is and parens don't work either, then your version of OFP is *(#$ed up  ;D
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:unit hasWeapon "radio"
« Reply #5 on: 20 Sep 2005, 22:32:11 »
if you want to be sure of the classname, make a radio trigger:
on activation: hint format ["%1",(weapons player)]

then drop everything but the radio and radio away

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:unit hasWeapon "radio"
« Reply #6 on: 20 Sep 2005, 23:28:49 »
Well I am 0 for 1 today but at some point I have got to get something right.

Could it be that a radio is a secondary weapon so you will need to do something like:

Code: [Select]
(player secondaryWeapon)  == "LSR_R109"
Syntax may be wrong but the concept is sound.

Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

Kyle Sarnik

  • Guest
Re:unit hasWeapon "radio"
« Reply #7 on: 20 Sep 2005, 23:52:15 »
Well I am 0 for 1 today but at some point I have got to get something right.

Could it be that a radio is a secondary weapon so you will need to do something like:

Code: [Select]
(player secondaryWeapon)  == "LSR_R109"
Syntax may be wrong but the concept is sound.

Wadmann

That will work, but the point is hasweapon SHOULD work for ANY weapon (I know it works for secondary weapons, I have tried it). And those aren't the only ways either, you can use the weapon command, and there are probably even a few other methods. I mean detecting if a unit has a specific weapon is one of the easiest things to do, I can't believe its not working, unless you have the wrong classname.

Offline Tyger

  • Former Staff
  • ****
  • I was at OFPEC when it still had dirt floors...
    • OFPEC
Re:unit hasWeapon "radio"
« Reply #8 on: 21 Sep 2005, 00:03:48 »
So in the end, are you 110% sure it's the right classname?

(Not meaning to offend you with that ;) )
"People sleep soundly at night only because rough men stand ready to do violence on their behalf." - George Orwell

MSG Mike Everret - We Will Never Forget - '75-'08

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re:unit hasWeapon "radio"
« Reply #9 on: 21 Sep 2005, 07:44:18 »
Master Tyger! You are the hero of the day!!!!
With parenthases it's working! Thanks a lot!

What a madness... with real weapon (like AK) working without parenthases, but
radio works only with parenthases. But finally working.

Thanks a lot again!
Fix bayonet!

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:unit hasWeapon "radio"
« Reply #10 on: 21 Sep 2005, 10:34:11 »
That's OFP for you.  :gunman:
Plenty of reviewed ArmA missions for you to play