Author Topic: [REQUEST] has-respawned-delay  (Read 2058 times)

0 Members and 1 Guest are viewing this topic.

Offline Lester

  • 27
[REQUEST] has-respawned-delay
Simply put, it'd be the best sexp for multi ever. There's so much stuff that can be done with it, and it would greatly decrease performance hits caused by many every-time-arguments that are currently used as work-arounds.

Currently, it is needed for modular spawnpoints, beam-freeing and turret-freeing in missions involving capships, and lots of other cool stuff.

I don't really have an idea how hard it'd be to implement it, but if it's possible, I'm sure many people would find it extremely useful.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: [REQUEST] has-respawned-delay
You can already count the number of respawns left per ship, what would this do that you can't do with that?
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: [REQUEST] has-respawned-delay
When has-respawned-delay [Alpha 2, a frigate], turret-free-all beam-free all Alpha 2

Can you already do this with respawns left? (I've never actually worked with it.)

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: [REQUEST] has-respawned-delay
I think you're failing to notice the problem with the SEXP you're asking for. If you're asking for a SEXP that magically triggers the second a ship respawns then you're basically asking for the impossible. The SEXP system doesn't work that way, it can only check the status of the ship at a given time and report back if a ship has or hasn't respawned previously.

But there you hit the problem. Suppose you have 3 respawns. How can you make the SEXP trigger only after each respawn without somehow keeping track of how many respawns have been used? Just sticking it in a repeating event will make it trigger every single frame.

But if instead you are keeping track of the number of respawns used then you don't need a has-respawned SEXP anyway. You just set up a variable for each player ship, set the number of respawns left at the start of the mission and then you know a respawn has occured each time the number goes down.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline headdie

  • i don't use punctuation lol
  • 212
  • Lawful Neutral with a Chaotic outook
    • Skype
    • Twitter
    • Headdie on Deviant Art
Re: [REQUEST] has-respawned-delay
The way I can see respawns left is that it requires 1 sexp and a variable.  If you store the number of respawns in the variable you can then use less than to check against respawns left against the variable.  You then trigger the event in the sexp with a set variabel to respawns left.

this is taken from a test mission file I have created for purpose

Code: [Select]
#Events ;! 1 total

$Formula: ( when
   ( <
      @test[4]
      ( respawns-left "alpha 1" )
   )
   ( add-goal
      "alpha 1"
      ( ai-chase "SSG Belial 2" 89 )
   )
   ( modify-variable
      @test[4]
      ( +
         @test[4]
         ( respawns-left "alpha 1" )
      )
   )
)
+Name: Event name
+Repeat Count: 1
+Interval: 1

The mission is attached below

[attachment deleted by ninja]
Minister of Interstellar Affairs Sol Union - Retired
quote General Battuta - "FRED is canon!"
Contact me at [email protected]
My Release Thread, Old Release Thread, Celestial Objects Thread, My rubbish attempts at art

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: [REQUEST] has-respawned-delay
Yep, I was posting from my mobile phone but that's basically what I meant.

You should set the initial value of the variable at mission start though so that you can limit the number of respawns to whatever you want easily.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Lester

  • 27
Re: [REQUEST] has-respawned-delay
Ah, cool. I guess it didn't hurt to ask. I'll try out your system, headdie, it sounds like a good work-around.

While we're at it, I managed to reproduce this bug using retail assets. Should I mantis it?

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: [REQUEST] has-respawned-delay
Replied on the other thread.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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