Author Topic: Dogflight Mission SEXPs Events  (Read 1822 times)

0 Members and 1 Guest are viewing this topic.

Offline sausage

  • 24
    • waynejohnson.net
Dogflight Mission SEXPs Events
Hi Guys, I think I coded myself into a corner.

I have a few fancy SEXPs:

1. Checks the distance of the player's ship and disable subsystems if out of range of the play area
2. Checks the distance of the player's ship and enable subsystems if back in range of the play area
3. Power player's energy if the player flies into a special power up object.

So it took a while to get right and I was rather pleased with myself. Then I added a couple of other players for the dogfight mission. I realise to my horror that the player "Alpha 1" referenced in my SEXPs will only work with the player named Alpha 1. Not the others in the wing.

I went back in to the event editor hoping that I can change Alpha 1 to just Alpha (the wing). Yes you can but the resulting operators only work on individual ships.

So in summary, does this mean I have to create one SEXP for every scenario times by every multiplayer ship?

For example the current SEXPs:

1) Alpha 1 out of range
2) Alpha 1 in range
3) Alpha 1 hits powerup A
4) Alpha 1 hits powerup B
5) Alpha 1 hits powerup C

will have to become:

1) Alpha 1 out of range
2) Alpha 1 in range
3) Alpha 1 hits powerup A
4) Alpha 1 hits powerup B
5) Alpha 1 hits powerup C
6) Alpha 2 out of range
7) Alpha 2 in range
8) Alpha 2 hits powerup A
9) Alpha 2 hits powerup B
10) Alpha 2 hits powerup C
11) Alpha 3 out of range
12) Alpha 3 in range
13) Alpha 3 hits powerup A
14) Alpha 3 hits powerup B
15) Alpha 3 hits powerup C
16) Alpha 4 out of range
17) Alpha 4 in range
18) Alpha 4 hits powerup A
19) Alpha 4 hits powerup B
20) Alpha 4 hits powerup C

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Dogflight Mission SEXPs Events
Check out when-argument any-of. 
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 sausage

  • 24
    • waynejohnson.net
Re: Dogflight Mission SEXPs Events
I was looking at this the other day but thought that the passed arguments could not be used as far as object names. But I really don't know what I'm talking about. :)

I'll go now for a better look. Thank you.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline sausage

  • 24
    • waynejohnson.net
Re: Dogflight Mission SEXPs Events
It works! I'm stoked! After weeks of modeling, UVing and playing around, I can get back to it. Thanks, Fubar, very much appreciated.

Here is what I used as a simple test for others experiencing the same confusion. In this example, I placed three ships down and placed them into the Alpha wing. I added a large ship which I'll just call "Large Ship":

Code: [Select]
when-argument
    any-of
      "Alpha 1"
      "Alpha 2"
      "Alpha 3"
 
 >

 distance "Large Ship" "<argument>"
     500
   
 lock-afterburner "<argument>"


Thanks, Karajorma. I did have those pages bookmarked but forgot to look there. I mainly used the wiki and forum as my sources. Though your example would have cracked it for me. Is there a chance that those pages will eventually move to the wiki so that the info is consolidated in one place?

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Dogflight Mission SEXPs Events
If someone else moves them, sure. :)

I don't have the time to do it myself but I've said in the past that I have no issue with people cutting up, moving or expanding on my examples in order to get them on the wiki.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline sausage

  • 24
    • waynejohnson.net
Re: Dogflight Mission SEXPs Events
Righto well I am yet to finish my beginners tutorial which will go on the wiki once the game is done. I'll probably do both.