Author Topic: Way to check if a player has a weapon?  (Read 2162 times)

0 Members and 1 Guest are viewing this topic.

Offline Solatar

  • 211
Way to check if a player has a weapon?
I see it's straightforward to check if a player has bank 1 or 2 selected.  However, in a single mission I'm trying to make, there will be several ways to accomplish the objectives.  If the player has armed himself with TAG missiles, I'd like to have a training message show up to tell him what ships will respond.  If he doesn't have any armed, then I don't want the training message to appear.  Is there any way to do this? 

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Way to check if a player has a weapon?
Like has-primary-weapon or has-secondary-weapon?
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Solatar

  • 211
Re: Way to check if a player has a weapon?
Yes.  To my knowledge neither exists, right?  :nervous:

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Way to check if a player has a weapon?
Then your knowledge be lacking.  :P

No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline ssmit132

  • 210
  • Also known as "Typhlomence"
    • Steam
    • Twitter
Re: Way to check if a player has a weapon?
Yep, that's the sexp to use. I've used it for something very similar to what Solatar wants to do (I was replicating the Mjonlir system that was in Vassago's Dirge, but only wanted the Mjonlirs to respond to tagged ships if the player had TAG-A or TAG-B missiles).

  

Offline Solatar

  • 211
Re: Way to check if a player has a weapon?
I've been using a FRED executable from August.  Whoops.  :nervous:

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Way to check if a player has a weapon?
Which year? I coded that SEXP in over a year ago IIRC. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Way to check if a player has a weapon?
wait really? i remember spoon and i begging for it like a month ago.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Way to check if a player has a weapon?
Maybe I'm confusing it with one I coded then. Probably the ammo rather than weapon one.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Solatar

  • 211
Re: Way to check if a player has a weapon?
Doesn't show up in a FRED build from August of this year, but it's plain-as-day-I'm-a-dumbass in a recent build.  Seems to suggest it's kind of recent. And that I'm an idiot for not noticing. :P

EDIT: btw, works perfectly.  It even fires if I have another weapon mounted and use debug codes to switch to the one referenced in the SEXP.  At that point the message fires.  :yes:

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Way to check if a player has a weapon?
yes it is recent, kara only coded it up a little while back for mr. spoon