Author Topic: SEXP order within When  (Read 1906 times)

0 Members and 1 Guest are viewing this topic.

Offline ARSPR

  • Preys On Mantis
  • 29
SEXP order within When
I'm starting using FRED, and basically to fix some minor bugs in missions rather than building new ones.

So here is my question.

Within a When op you can put a lot of commands. I suppose that these commands are ALWAYS executed from the top one to the bottom one (in Events editor), not in a random order neither from bottom to top.

Can anyone confirm this, please?

I'm asking this because I've used it to fix a little issue in Derelict "Playing Possum" (DL4-05.fs2). In this mission there's an event (Play Dead!) where your mates get add-goal->ai-play-dead because all the ships are supposed to stay quiet to fool the shivans. The problem happens when you have given them for example a previous Escort command within game which has higher priority. In this situation the do not play dead.

I have fixed it changing add-goal->ai-play-dead to clear-goals and adding add-goal->ai-play-dead at the end of the same When. It works but I would like to be sure.
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: SEXP order within When
To be honest, when I used to many when - operators, especially goal operators, then the chance that one isn't executed raise with the amount of used when-op's. Therefore, I make seperat SEXP for all vital things I want to have.

Problem is, I can't really reproduce that and it isn't equal in each builds. What isn't working in most cases (maybe it is even meant that way)
I can't make a "clear goal" and "add new goal" to the same ship in the same SEXP. Sometimes it works, but often not.

I suggest make vital goals in seperat SEXP. Since the SEXP-Nodes have been bumped, there should be no danger reaching the limit anymore.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP order within When
I've never seen any evidence that things aren't executed in a top to bottom order. The senario described would certainly result in the goals being cleared and then a new one added. I've done the exact same thing many times.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: SEXP order within When
I too, and I noticed so many time that the fighter didn't go after their new goal (mostly waypoint or formation stuff), they just sit there.
When I make the clear goals and the new goal in seperate SEXP it always work. I don't have much experience with the new builds yet,
but it certainly was that way in 3.6.7 and the december 05 builds I used for quite some time.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: SEXP order within When
Never had that problem. If it is happening it's a bug and you should post a mission where it occurs to Mantis so that it can be fixed.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: SEXP order within When
It's seems to be random, and technically I have now seperated each offending SEXP. If I will stumple over it again, I post a bug.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline ARSPR

  • Preys On Mantis
  • 29
Re: SEXP order within When
Thank you for the info.

I've finally splitted it in two chained SEXPs but I'm going to retest it altogether again (and it's going to be the largest when ever made because a lot of extra additions).
IF YOU HAVE TROUBLES WITH FS2:
  • Please, please, please, READ and UNDERSTAND the sticky threads in FreeSpace & FreeSpace Open Support board.
    A lot of people are willing to help you, but, as anyone can understand, seeing the very same "issues" repeated again and again can become quite depressing. Please, spend a bit of time trying to solve the issue by yourself.
    (Lobo deserves a monument).
  • Then, if you aren't still able to solve your issue, feel free to ask for help in that same board.
    FYI, most of the troubles are caused by wrong mod installations which lead to either missing data or undesired cross-effects between them. Always follow the mod installation instructions and keep a clean FS2 installation as explained in the sticky threads. Two additional links about how the game handles game data:
  • If you think that you've discovered a bug, mantis it.
    Provide as much info as you can, and try to narrow it down. A lonely "FS2 doesn't work" is not a good report.

Whoever Hanlon was: Never attribute to malice that which can be adequately explained by stupidity.
Albert Einstein: Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe.

Dell Dimension 9200 - Vista 32-bit Ultimate
Core 2 Quad Q6600 @2.4GHz - RAM 2 GB DDR2
nvidia 8800 GTX - Integrated Sigmatel Audio

  

Offline IPAndrews

  • Disgruntled Customer
  • 212
  • This site stole my work
Re: SEXP order within When
Operations inside a when are executed top to bottom but events may not be executred top of list to bottom of list. It occasionally skips a few. So you have to assume events may be executed in any order.
Be warned: This site's admins stole 100s of hours of my work. They will do it to you.