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

0 Members and 1 Guest are viewing this topic.

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
If I understand your issue correctly, then you really only need this event to actually become true once.. which is a derp on me. Add an invalidate-all-arguments sexp like this.

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
>>Invalidate-all-arguments

Be sure it is nested in the second 'when' or it will stop the whole sexp before it can be marked true. If you still have a few repeats, then consider raising your trigger delay by a second or two.
« Last Edit: April 24, 2012, 08:46:54 am by mjn.mixael »
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 will try that, thank you

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
This version seems to be working correctly, thank you!

With that, the FREDding of my demo mission is all but complete. Still need to do some other work, though, before I can release it.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
I'd strongly recommend reading this before you release it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Evaluating ships destroyed only after a certain event
Well now that it's all sorted, could someone just give me a heads up as to what was wrong with this one?
+when-argument
++(list of ships)
+and-in-sequence
++has-arrived-delay
+++delay
+++Wing 1
++is-destroyed-delay
+++delay
+++<argument>
++(actions)
++invalidate-argument
+++<argument>
Just to know what I've done wrong... At this point it's like I've been fredding for ages but I still suck arse. Makes me sad.

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
Probably because you didn't use invalidate all arguments

 

Offline Legate Damar

  • Keeping up with the Cardassians
  • 29
  • Hail Cardassia!
Re: Evaluating ships destroyed only after a certain event
I'd strongly recommend reading this before you release it.

My spelling and grammar in the mission is good, I do not always pay attention to that when I am writing stuff online but writing the mission I tried to make it done well.

I have not made a background yet, I am planning to do that later.

I put ships on the Y axis.

My directives and mission objectives work, I have tested them.

I put a ship on the escort list. The mission really only needs one ship on it.

I named my events and messages logically.

The return to base thing works in all the situations I tested (I think I tested them all).

I don't think there is a way to break the mission but I might be wrong, I cannot think of everything.

I have done and tested all of the debriefings.

I named the ships correctly.

I have delays between waves and randomization of delay.

It is a scramble mission so loadouts are preselected.

I was having some trouble getting my warp out too early debriefing to work but it is working now.

Of the stuff I still have to do, I think about 50% is things I know how to do myself... otherwise I will ask. Mostly modding stuff.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
Well now that it's all sorted, could someone just give me a heads up as to what was wrong with this one?

I lost track of what you all were trying to achieve about 10 posts ago. If you summarise what it was supposed to do, I'll tell you why it didn't.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Evaluating ships destroyed only after a certain event
It was supposed to send a message when any one of some ships was destroyed but only after another ship had arrived. Or something.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
In that case I can't see any reason why it wouldn't work.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
looks like it should work. and-in-sequence has just been unreliable for me in the past, so I tend to forget about it.
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
looks like it should work. and-in-sequence has just been unreliable for me in the past, so I tend to forget about it.

That's the exact kind of superstition I keep trying to stamp out. As far as I know there are no bugs in the and-in-sequence SEXP. It's just people misunderstanding how to use it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Re: Evaluating ships destroyed only after a certain event
Snail: please don't be offended if I ask the obvious, but you are using "any-of," right? And you have double-checked that all arguments are spelled correctly? Also I think an actual screenshot of the event in FRED would be more useful.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
looks like it should work. and-in-sequence has just been unreliable for me in the past, so I tend to forget about it.

That's the exact kind of superstition I keep trying to stamp out. As far as I know there are no bugs in the and-in-sequence SEXP. It's just people misunderstanding how to use it.

Then care to explain it? Because I'm pretty sure I understand it. I mean, it's not a very hard concept... Perhaps it's because I just got up and I'm a bit touchy, but I don't like you calling me "superstitious". I've had the SEXP fail on me for whatever reason in the past so I simply choose another way to do the same thing. There's no "right" way to FRED....

Snail: please don't be offended if I ask the obvious, but you are using "any-of," right? And you have double-checked that all arguments are spelled correctly? Also I think an actual screenshot of the event in FRED would be more useful.

Snail never actually wrote the SEXP in FRED. He was just trying to understand why his proposed solution would or wouldn't work and thus has no screenshot for you...
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 TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Re: Evaluating ships destroyed only after a certain event
looks like it should work. and-in-sequence has just been unreliable for me in the past, so I tend to forget about it.

That's the exact kind of superstition I keep trying to stamp out. As far as I know there are no bugs in the and-in-sequence SEXP. It's just people misunderstanding how to use it.

Then care to explain it? Because I'm pretty sure I understand it. I mean, it's not a very hard concept... Perhaps it's because I just got up and I'm a bit touchy, but I don't like you calling me "superstitious". I've had the SEXP fail on me for whatever reason in the past so I simply choose another way to do the same thing. There's no "right" way to FRED....

I'm gonna ninja this.

And-in-sequence turns FALSE if the events in it turn true in the wrong order.
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
Well apparently my understanding of that simple concept, but distaste for the sexp itself is "superstition".

Clearly the fact that so many people 'misunderstand' that SEXP means there is more to it than the order in which arguments test true, and I would like Karajorma to explain them rather than simply saying "nope, you've got it wrong and don't understand".
« Last Edit: April 25, 2012, 10:25:22 am by mjn.mixael »
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 karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
Then care to explain it? Because I'm pretty sure I understand it. I mean, it's not a very hard concept... Perhaps it's because I just got up and I'm a bit touchy, but I don't like you calling me "superstitious". I've had the SEXP fail on me for whatever reason in the past so I simply choose another way to do the same thing. There's no "right" way to FRED....

I explained the term superstition in the FRED Quiz thread but I'll repost it here (reminds me, I must post more questions at some point!).

Quote
The purpose of these tests is for users to exercise their debugging skills.

[ SNIP ]

I'm sure each one of us can name an occasion where an event we thought would work hasn't and we've simply tinkered with it a little until it did, never understanding why it failed the first time but works now. A coding book I once read referred to this practice as superstition and in many ways that's especially apt when it comes to FRED. When a problem occurs with a mission in FRED, it's better to figure out why the mission isn't working than to simply change SEXPs and test until it starts working again. You may either prevent similar mistakes in the future, or discover how to better use a feature and get great ideas how to use it.


Now do you see why I use the word? It's not that I'm calling you superstitious, I'm saying that SEXPs can quickly build up superstitions around them. and-in-sequence is actually the number 1 contender for this. There are many FREDders like you who choose not to use a perfectly good SEXP which does exactly what it says it does because it has failed for reasons they don't understand.

In my opinion, this is the point where you can tell the excellent FREDders from the merely good ones. The best FREDders want to know why the SEXP failed. Everyone else simply solves the problem a different way and moves on. When I say I'm trying to stamp out superstitions, I mean I'm trying to move more FREDders into the excellent FREDder category. I want people to look at failures in a particular event as a chance to learn, not just an obstacle to go round. Too many FREDders simply fix the problem and then are equally clueless next time a similar event breaks.

Clearly the fact that so many people 'misunderstand' that SEXP means there is more to it than the order in which arguments test true, and I would like Karajorma to explain them rather than simply saying "nope, you've got it wrong and don't understand".

I can't tell you why your events didn't work without an example. But have a look at this question in the first FRED Quiz I ran and see if you can figure out why it's not working. Mistakes like the one in this question are the biggest cause of failure for the and-in-sequence SEXP.
« Last Edit: April 25, 2012, 11:33:09 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Evaluating ships destroyed only after a certain event
Thank you. That's just straight up belittling...

You talk like and-in-sequence is this mystifying SEXP that stumps all but the bestest of the best FREDers and point me to your 'easy' question to see if I have the know-how to figure it out. I was really trying not to let this get under my skin, but I'm kinda done with your high horse attitude about this particular SEXP.

It makes sense when you go off on these tangents about everytime SEXPs because most people do use them incorrectly. This one, though, is very straightforward.. please stop talking to me like I'm some sort of idiot that can't figure out when SEXPs turn true and in which order...
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 TopAce

  • Stalwart contributor
  • 212
  • FREDder, FSWiki editor, and tester
Re: Evaluating ships destroyed only after a certain event
Quote
The best FREDders want to know why the SEXP failed. Everyone else simply solves the problem a different way and moves on.

Only the FREDders who happen to be coders as well can look at the SEXP's code and see for themselves how exactly it works. The lesser ones have two options: a) ask, b) experiment and try to figure it out for himself. If you choose a) you risk receiving the conclusions of those who chose b). Since b)'s conclusions are possibly flawed and inaccurate, and a) has no choice but to listen to b), superstitions start spreading.
« Last Edit: April 25, 2012, 11:14:08 am by TopAce »
My community contributions - Get my campaigns from here.

I already announced my retirement twice, yet here I am. If I bring up that topic again, don't believe a word.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Evaluating ships destroyed only after a certain event
Oh I know why these superstitions get started. That's why when someone posts something like mjn.mixael did, I point out the other side of the argument. The quality of FREDding has improved over the years, but I've been around long enough to remember when people flat out told people not to use and-in-sequence because it never worked properly.

Thank you. That's just straight up belittling...

You talk like and-in-sequence is this mystifying SEXP that stumps all but the bestest of the best FREDers and point me to your 'easy' question to see if I have the know-how to figure it out. I was really trying not to let this get under my skin, but I'm kinda done with your high horse attitude about this particular SEXP.

No, I'm not attempting to belittle you. Quite frankly I'm not sure what you're getting so annoyed about. You're claiming that you understand perfectly well how and-in-sequence works AND claiming that in the past it has failed for some unknown reason you feel is a big enough issue that it prevents you using the SEXP now. Surely you can see that those two statements don't fit together?
 If in the past it failed because you were still a beginning FREDder then there is no reason not to use it now. Otherwise it suggests you don't feel confident that if you use it this time, it won't work again for some reason you don't understand. If you do understand why it didn't work in the past, and do feel confident it will work next time you try to use it, why you wouldn't use the simplest solution to a problem?

And I never said that and-in-sequence is hard to use. I consider it to be exceedingly simple. I'm constantly surprised people have any trouble with it because it is exceedingly simple once you get past a couple of minor gotchas. So again, I'm confused about why someone would say they don't use the SEXP. Especially when the alternative is to create a new event. Close the event editor window. Open it again. And then make an event referencing the first one. Seriously, if you can tell me why you'd do that, I'm all ears. Cause I can't see a sensible reason for doing it.  :confused:

When I was talking about the difference between the best FREDders and the rest, I wasn't saying that only the best FREDders use and-in-sequence or some nonsense like that. I was talking in general about an attitude of always trying to figure out why a SEXP didn't work. As I keep saying, there is a tendency to forget about that and simply fix the problem in another way. It's not a good habit to develop.

Quote
It makes sense when you go off on these tangents about everytime SEXPs because most people do use them incorrectly. This one, though, is very straightforward.. please stop talking to me like I'm some sort of idiot that can't figure out when SEXPs turn true and in which order...

I linked to the easiest example of why and-in-sequence can fail. You probably encountered a more complex version but in the end the root cause is the same, you've misunderstood how to use the SEXP. Now that's probably justifiable and understandable. But that doesn't mean that it's a state of affairs you should willingly continue. If the SEXP is as simple as you claim, why not use it?
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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