Author Topic: Evaluating ships destroyed only after a certain event  (Read 6598 times)

0 Members and 1 Guest are viewing this topic.

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Evaluating ships destroyed only after a certain event
It's rather embarrasing that I can't remember how to do this, as it seems so simple, but:

If I want an event to return true when a ship is destroyed, but only after another event, how would this be accomplished?

For example, if I want Event A to return true when Ship A is destroyed, but only after Ship B arrives. So if Ship A is destroyed before Ship B arrives, the event will never return true.

What is the proper way to implement this?

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
when > and > is-destroyed-delay & is-event-true-delay

Or for your specific example...

when > and > is-destroyed-delay & has-arrived-delay
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

  

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
Yes, I considered that, but I thought that would check to see if the ship was destroyed any time in the mission, so if Ship A is destroyed before Ship B arrives, it would return true as soon as Ship B arrives, which I don't want.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Evaluating ships destroyed only after a certain event
You should use and-in-sequence!

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
Oh, of course!  :banghead:

I knew I was missing something simple.

One mor question: How would I check for any ship of a certain team to be destroyed? For example, make an event return true when any hostile or friendly ship is destroyed.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Evaluating ships destroyed only after a certain event
When-argument is one way to do that.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
Derp, sorry I misread your issue, but Battuta gave you a good solution.

As for the next one, I suggest reading this tutorial and using 'Any Of' argment sexps or something like that.

Ninja'd

But my response gets a gold star for including the link to a good tutorial!
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Evaluating ships destroyed only after a certain event
percent-ships-destroyed can also do that (make the percent it check correspond to one, two, or three etc).
That is, if you don't care about which ones at all.
(´・ω・`)
=============================================================

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
Thank you. I think I've got it now.

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
Hmm, I thought it was going to work, but my event is not working correctly. I have taken a screenshot (censored for spoilers), can anyone see what is wrong with it?



Additional information: The 2-5th censored spoilers are wing names. The total amount of ships in all waves of the three wings listed in the percent-ships-destroyed expression is 20.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
From how this looks, this will NOT mark true if any one of those ships (that are in the percent sexp) are destroyed before the other ship has arrived.

In other words, all ships (this would be so much easier to discuss without all those frakking censors.. I'm already sick of trying to explain which ship I'm talking about) must not be destroyed before the arrival sexp is true. If that is the intended purpose then your next step is to debug to make sure that is precisely what is happening.

My other guess is that using wings in the percent-ships-destroyed sexp may not work like you expect, but I'm not 100% sure on this.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
I'm sorry. Is this better?



What I want is for it to return true when any ship in wing 2, 3, or 4 is destroyed after wing 1 arrives, even if any ships in wings 2, 3, or 4 have been destroyed previously.

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Evaluating ships destroyed only after a certain event
oh that won't work.
it will be FALSE FOREVER if any ship in wing 2, 3, or 4 die before wing 1 arrives.
(´・ω・`)
=============================================================

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
So how do I get it to work?

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
So, you have 3 wings of fighters in the mission. Then you have Wing 1 arriving... and you want this event to become true when any ship of Wings 2,3,4 are destroyed after Wing 1 arrives. However, it is possible for Wings 2,3,4 to have ships destroyed before Wing 1 arrives?

Well first up this sounds like a good setup for a broken mission. What happens if the player destroys all the fighters in Wings 2,3,4 before Wing 1 arrives?

But a possible solution might be an any-of argument list. Something like this perhaps...

When-argument
>Any-Of
>>List of ships
>Is-Destroyed-Delay
>>Ship <Argument>
>>Delay
>Invalidate-Argument
>>Ship <Argument>
>When
>>Has-Arrived-Delay
>>>Ship
>>>Delay
>>ACTIONS TO TAKE

This is untested and I just came up with it on the spot. The idea is that when any ship is destroyed it is removed from the list (invalidate argument) of ships that can be destroyed after Wing 1 has arrived. However, if a ship is destroyed and has-arrived-delay tests true, then more actions will take place.

EDIT: You'll need to give this a trigger count equal or greater than the number of possible ships there are to be destroyed.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
So, you have 3 wings of fighters in the mission. Then you have Wing 1 arriving... and you want this event to become true when any ship of Wings 2,3,4 are destroyed after Wing 1 arrives. However, it is possible for Wings 2,3,4 to have ships destroyed before Wing 1 arrives?

Well first up this sounds like a good setup for a broken mission. What happens if the player destroys all the fighters in Wings 2,3,4 before Wing 1 arrives?

This event is not essential to the mission. It just sends an optional message with no critical information. Still I don't want to just remove it.

Quote
But a possible solution might be an any-of argument list. Something like this perhaps...

When-argument
>Any-Of
>>List of ships
>Is-Destroyed-Delay
>>Ship <Argument>
>>Delay
>Invalidate-Argument
>>Ship <Argument>
>When
>>Has-Arrived-Delay
>>>Ship
>>>Delay
>>ACTIONS TO TAKE

This is untested and I just came up with it on the spot. The idea is that when any ship is destroyed it is removed from the list (invalidate argument) of ships that can be destroyed after Wing 1 has arrived. However, if a ship is destroyed and has-arrived-delay tests true, then more actions will take place.

EDIT: You'll need to give this a trigger count equal or greater than the number of possible ships there are to be destroyed.

Okay. It should be mentioned that wings 2, 3, and 4 have multiple waves, so from the way I understand arguments work, I should just type the names of all of the ships in all of the waves (as in, 1 2 3 4 for the first wave, and 5 6 7 8 for the second)?

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
I implemented your suggested sexp and it seemed to work, except that messages 1 and 2 were both sent twice, and immediately afterward they were both sent twice again. I added an invalidate-argument to the end of the sexp, but it only removed one set of double messages - messages 1 and 2 were still both sent twice.

How would I proceed now?

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Evaluating ships destroyed only after a certain event
How about adding a chained event after the first one? Would that work?

:nervous:

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
You mean take everything after this part:

When-argument
>Any-Of
>>List of ships
>Is-Destroyed-Delay
>>Ship <Argument>
>>Delay
>Invalidate-Argument
>>Ship <Argument>

And then add a new (chained) event:

>When
>>Has-Arrived-Delay
>>>Ship
>>>Delay
>>ACTIONS TO TAKE

I will try that, if that is what you mean.

Also I have been making a lot of progress with this mission!

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Evaluating ships destroyed only after a certain event
Well what I meant was have all the conditions in one (repeating) event and then have the messages in a separate (non-repeating) event chained to the first one.


EDIT

Okay I actually hadn't read the thread at all when I posted that

Having read the thread, I don't see why this wouldn't work

+when-argument
++(list of ships)
+and-in-sequence
++has-arrived-delay
+++delay
+++Wing 1
++is-destroyed-delay
+++delay
+++<argument>
++(actions)
++invalidate-argument
+++<argument>

But I am **** at logic and sexps anyway so blergh
« Last Edit: April 24, 2012, 08:27:25 am by Snail »