Author Topic: preventing arrival  (Read 1895 times)

0 Members and 1 Guest are viewing this topic.

Offline --Steve-O--

  • 28
  • I might be the last man on earth to use TS3.2
here's what i want to happen. the player has to destroy an awacs radar subsystem to prevent the arrival of a destroyer. i cant figure out the SEXPs to make this work though. i need some pointers.
"And so they dwelled in filth, on worlds made of dirt and feces, and there they lay until they stumbled into the skies." --the Mad Prophet

 
Maybe something like:

Events Editor:
Code: [Select]
Radar destroyed
       when
             is-subsystem-destroyed-delay      <------- That is an actual SEXP right?
                  AWACS
                     0
             true

Ships Editor:
Arrival Cue
Code: [Select]
is-event-false-delay
      radar destroyed
        0


That way, the destroyer will only arrive if the destruction of the radar is false (ie, the player failed to destroy the radar)
you'd probably want to put the "is-event-false-delay" into an "and" operator so that there's another trigger for the destroyer's arrival: like has-time-elapsed 60, so that the player has some time to blow up the subsystem before the computer immediately calls it "false" and sends in the destroyer.
"You need to believe in things that aren't true. How else can they become?" -DEATH, Discworld

"You can fight like a krogan, run like a leopard, but you'll never be better than Commander Shepard!"

 

Offline Shade

  • 211
Actually you can just include the check for the non-destruction of the relevant subsystem in the destroyer's arrival cue instead of messing about with events. Something like this:

-op and
   -op not
      -op is-subsystem-destroyed-delay
         #Awacs
         #Radar
         #0
   -op Other conditions
Report FS_Open bugs with Mantis  |  Find the latest FS_Open builds Here  |  Interested in FRED? Check out the Wiki's FRED Portal | Diaspora: Website / Forums
"Oooooooooooooooooooooooooooooooooooooooh ****ing great. 2200 references to entry->index and no idea which is the one that ****ed up" - Karajorma
"We are all agreed that your theory is crazy. The question that divides us is whether it is crazy enough to have a chance of being correct." - Niels Bohr
<Cobra|> You play this mission too intelligently.

 

Offline --Steve-O--

  • 28
  • I might be the last man on earth to use TS3.2
dear god you guys make it look easy. you should have seen this mess i had involving events arrival cues and objectives and a hodge of SEXPs. i'll give that a try!
thanks!
"And so they dwelled in filth, on worlds made of dirt and feces, and there they lay until they stumbled into the skies." --the Mad Prophet

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
That way, the destroyer will only arrive if the destruction of the radar is false (ie, the player failed to destroy the radar)

Although Shade posted the better solution you've pointed out a common misconception in the way the is-event-false-delay SEXP works so I really ought to cover this.

In the situation described your solution wouldn't work. is-event-false-delay would evaluate to false so the destroyer would never appear. The mistaken assumption is that is-event-false-delay is the exact opposite of is-event-true-delay. It isn't. There are times when both is-event-true and is-event-false will both return false.

Basically the game works like this. At t=0 every event is in the state event-incomplete. They will stay in that state the entire mission unless they come true or reach a state where they can never become true. It is only at this time that is-event-false will trigger.

In the example you given the event would remain incomplete until the AWACS jumped out or was destroyed (or the subsystem was destroyed of course :D ). Once the destroyer has gone the game will realise that the event can never trigger and will mark it false.

When the mission ends every single SEXP that hasn't triggered is marked false. So these rules don't apply to SEXPs in debriefings.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
In other words (to make it easier for you) when using a NOT statement, ALLWAYS have a another AND condition wiht it..

EXAMPLE:

When
-AND
---has-arrived-delay
---- Alpha1
----300
---not
----is-subsystem-destroyed-delay
-----target ship
-----AWACS
-----0


What will happen is that after 300 seconds (when the destroyer is supposed to arrive) the game will check THEN if the AWACS is still in one peice. If both arguments return true, the destroyer will jump in.

If you just put in:
---not
----is-subsystem-destroyed-delay

It will return true immediately, since one the game starts the subsystems isn't destroyed yet, no? ;7
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Yep. That's another common mistake.

You don't always need to use AND but you should always check that the condition won't evaluate to true at the start of the mission because quite often it will.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Heh. My initial reaction was "Use a variable!". I've gone full circle. I used to hate them with a passion, now I can't make missions without them :D.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline --Steve-O--

  • 28
  • I might be the last man on earth to use TS3.2
thanks for the know how guys...now that i have a little time, im going to tinker with all of this.
"And so they dwelled in filth, on worlds made of dirt and feces, and there they lay until they stumbled into the skies." --the Mad Prophet