Author Topic: SEXPs: Whichever pilot sees it first, shout out!  (Read 1729 times)

0 Members and 1 Guest are viewing this topic.

SEXPs: Whichever pilot sees it first, shout out!

Here's a scenario I'm trying to design: friendly pilots are on guard duty over a wide area...but enemy ships could jump in from ANY random direction.  I want to be able to have ANY of the friendly pilots alert everyone else if they "spot" an enemy craft (distance=2000, within 45 degrees of forward cone).  I could make events for each pilot, should they be the one to first spy the incoming enemy...but there has to be an easier way.  Is there a SEXP that can be applied to whichever friendly meets the criteria for spotting an enemy, and could I get an example of how? 

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
-C

 
Re: SEXPs: Whichever pilot sees it first, shout out!

I have my head ~75% wrapped around this.  But I have to confess I'm confused on how to use "invalidate-argument".

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: SEXPs: Whichever pilot sees it first, shout out!
Looks like you use it when you're sure that you're done with an argument, to make sure that it doesn't get used someplace else. I'm not sure if that means it will carry over to the next level of when-argument SEXPs if you don't use invalidate-argument, though.
-C

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Whichever pilot sees it first, shout out!
I've got some ideas on how to solve this one but it's actually a lot more difficult to do than it first appears. I'll take a look at it tonight. :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXPs: Whichever pilot sees it first, shout out!
Okay, still not tested it but this is my suggestion.

1) First limit your wing to single waves as it greatly simplifies everything if you do that.
2) Use something like this

When-argument <-------------- Lots of repeats and a repeat delay of 1
-any-of
--Cancer
--Libra
--etc...
- <
--distance                      <------------------We need this check so that we can invalidate each wing as soon as a wingman detects them
---<any friendly>
---<argument>
--2000
--Modify-Variable           <------------------We need to pass the wing who triggered this down to the lower level. Only a variable can do this
---WaveName[Alpha]
---<argument>           
--when-argument
---number-of
----1
----Beta 1
----Beta 2
----etc
-- <
---distance
----WaveName[Alpha]
----<argument>
-----2000
---send-message
----<argument>
----High
----Enemy Detected
-invalidate-argument
--<argument>    <-----------------This will invalidate the wing name so it's on the top level not part of the inner when-argument
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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