Author Topic: Fred problem - infinitely triggering event  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

Fred problem - infinitely triggering event
I want an event so that when you scan a ship, a message is sent, the ship is disabled. The ship being disabled triggers a second event that causes the ship to self destruct (so it self destructs a couple of second after the message has been sent). I want this to happen everytime one of a series of ships is scanned.

I tried this like this:

$Formula: ( every-time-argument
   ( any-of
      "Red 1"
      "Red 2"
      "Red 3"
      "Red 4"
      "Red 5"
      "Red 6"
      "Blue 1"
      "Blue 2"
      "Blue 3"
      "Blue 4"
      "Blue 5"
      "Blue 6"
   )
   ( and
      ( is-cargo-known-delay 1 "<argument>" )
      ( not
         ( is-disabled-delay 0 "<argument>" )
      )
   )
   ( invalidate-argument "<argument>" )
   ( send-random-message
      "<argument>"
      "High"
      "Panic 1"
      "Panic 2"
      "Panic 3"
      "Panic 4"
      "Panic 5"
      "Panic 6"
   )
   ( sabotage-subsystem
      "<argument>"
      "engine"
      101
   )
)
+Name: Raider scanned
+Repeat Count: 1
+Interval: 1
+Team: 0

$Formula: ( every-time-argument
   ( any-of
      "Red 1"
      "Red 2"
      "Red 3"
      "Red 4"
      "Red 5"
      "Red 6"
      "Blue 1"
      "Blue 2"
      "Blue 3"
      "Blue 4"
      "Blue 5"
      "Blue 6"
   )
   ( and
      ( is-cargo-known-delay 3 "<argument>" )
      ( not
         ( is-destroyed-delay 0 "<argument>" )
      )
   )
   ( invalidate-argument "<argument>" )
   ( self-destruct "<argument>" )
)
+Name: Raider Dies
+Repeat Count: 1
+Interval: 1
+Team: 0

The problem I have is that while scanning a ship causes it to first be disabled and then destroyed as I want, the random message is sent over and over again without stopping. I put the not disabled/not destroyed sexps in to the events in an attempt to stop this. This didn't fix the message problem, but did result in the ship self-destructing (which previously it didn't, though it did become untargettable as if it had been destroyed but it never actually exploded).

I tried replacing the message sexp with one that updated a variable to be equal to 1, and having a third event (using the everytime conditional) that checked the value of the variable, sent a message and then reset the variable to 0. The message was never sent.

Can anyone see what I've done wrong?

I'm using the 3.6.5 build of the SCP (the last official release version) with TBP.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Fred problem - infinitely triggering event
First of all I'm impressed to see someone so new to these forums using the new conditionals :)

 Every-time flushes the entire event tree so each event is evaluated as if it was the first time the game has seen it. I'm not certain if that means that it flushes out any invalidated arguments (you'll need Goober to answer that one) but I can see the possibility of the event invalidating the argument, being flushed and the argument reappearing. 

This would also explain your ships not blowing up the first time as they were recieving an order to self-destruct up to 70 times a second (depending on your FPS when playing).  :D

What happens if you go from everytime-argument to a repeating when-argument? When with a high repeat count and a repeat delay of 0 is actually the same as every-time except that it doesn't flush the event tree. A lot of people (myself included at one point) don't know this and misuse every-time as a result.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Fred problem - infinitely triggering event
That didn't help, though the infinite looping messages stopped once all of red and blue were destroyed. However the ship was no longer disabled once it was scanned.

Could you see if it works for you? I can't see the flaw in the logic.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Fred problem - infinitely triggering event
That's odd. I can't see an obvious flaw in what you've described and I'm rather surprised that going over to when-argument didn't solve it for you.

I'll give it a try if I have some spare time but unfortunately I'm very busy until next week so I don't know when I'll have time to actually do so.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Fred problem - infinitely triggering event
For now I'm using many many individual sexps to achieve the same affect (which works). If you have a chance to look at it all let me know, otherwise don't worry.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Fred problem - infinitely triggering event
Do you have a version of the mission with the SEXPs all rigged up still? Cause it will be easier to check if I have the old version of the mission :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Fred problem - infinitely triggering event
I did, but I appear to have accidentally deleted it when cleaning up a couple of files. I can redo without difficulty, though I won't have time till tomorrow. When I do I'll pm it to you.

Dom

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Fred problem - infinitely triggering event
Okay. I tried the mission and the messages worked perfectly. Maybe the problem is down to the version of FS2_Open you're using (I was using a very recent CVS build from the SCP recent builds subforum).

The raiders don't blow up but that's due to a small but fundemental mistake you've made in the second event (which doesn't appear in the code you posted but is present in the version you sent me). You've chained the two events together. Never chain an event to one which uses every-time or every-time-argument. You'll never see them happen (same goes for using is-event-true-delay or is-event-false-delay).
  Every-time flushes the SEXP tree every time that it is called. Events using it will never ever evaluate to true or false as a result. The event is permanently incomplete.

Remove the chain from the event posted above and it should work.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 
Re: Fred problem - infinitely triggering event
I'll give it a go with a new build. Thanks for the help.

*edit* It worked with the new build, but I had some issues with the Drazi Firehwak model (parts of it weren't being generated), and then reran it with the last official release build (3.6.7) and it worked and the model problems were gone. Not sure why it didn't before.
« Last Edit: December 17, 2005, 01:08:34 pm by Megadoomer »

  

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Fred problem - infinitely triggering event
There are some maps on the Firehawk that are non-power-of-2 DDSes.  Newer builds won't render such textures.  I've fixed the textures for the TBP Beta work, but that's only available to team members.
The Trivial Psychic Strikes Again!