Author Topic: I'm still failing at obviously simple SEXP :(  (Read 3027 times)

0 Members and 1 Guest are viewing this topic.

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
I'm still failing at obviously simple SEXP :(
Hey there,

once again I need some help. I have this SEXP here :



The wanted effect is simple. I'm arriving at a navpoint with a enemy force. After destroying a fighterwing this goal appears in the directive box (so far so good). Now the player is supposed to fly to nav 5, if he reaches it the goal becomes true (works also)

On the other hand, if the player refuses to fly to nav 5 and fly closer than 5000 meters to "unknown contact A" the goals is supposed to become red and another line of events appear (which also works fine, at least the next line of events).

But why is the goal not becoming red/false, the Not-Condition is met, long before Nav5 can be even reached :(

Any suggestions ?

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: I'm still failing at obviously simple SEXP :(
You're making a fundemental error about how SEXPs work.

This event will only become true is Alpha 1 reaches the waypoint and Alpha 2 isn't near to the unknown contact. (You've seen this already). The important part however is that it won't ever become false.

The reason is this. When alpha 2 reaches the unknown before Alpha 1 gets to the way point the SEXP doesn't become false. It remains incomplete. Yes Alpha 2 is closer to the unknown than 5000m but at some point later in the game it may not be. So no matter what you do the SEXP will continue to sit there as incomplete until you actually have the conditions to make it come true happen.

For this reason Directives should be based on events which become permanently true or false.

For instance is-ship-destroyed-delay is a good example of this kind of SEXP. If the ship is destroyed the game knows that this SEXP will always be true. That means that any events based on it will evaluate to true. Any event using not-is-ship-destroyed-delay will therefore always evaluate to false which means that the game can mark them red if the ship was supposed to survive. The SEXP can also tell if a ship has departed which means the same things.

If you remember the problem with the first mission of WCP I solved that by using event-incomplete. Again that is a SEXP that evaluates to false and then stays that way.
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: I'm still failing at obviously simple SEXP :(
Man, I'm a big idiot, how the **** get's alpha 1 in there ?  :rolleyes:

Actually this is supposed to be triggered both for Alpha 2 (the player actually). Will it work then ? It should become false, anytime Alpha2 get's near "unknown contact A". When he doesn't get near and flys to the waypoint it's true (somehow I had it working before, but I'm not getting there again).
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 Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: I'm still failing at obviously simple SEXP :(
So, how about this (when I did understand you correctly).

1) I'm creating a simple event that triggers if Alpha2 get's closer than 5000 meters

Code: [Select]
<
   distance
    Alpha2
    unknown contact A
    5000

2) I change the Goal-Sexpression that way that instead of the second distance trigger I make a "not- is event true - trigger point 1 above)

Code: [Select]
and
     <
       distance
         Alpha2
         Navpoint 5
         1050
not
    is event true
   trigger-event from 1)

Is that what you mean , and is the "and" the right operator for this stuff ?
« Last Edit: March 28, 2006, 01:25:28 pm by Starman01 »
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: I'm still failing at obviously simple SEXP :(
The problem with using is-event-true is that you trigger that whole bug with Directives not showing up until they are true or false.

You only should need one definatively false SEXP in there to make things work. A single is-event-incomplete that is still true when the directive completes correctly but false when the directive fails should be enough to make this work.
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: I'm still failing at obviously simple SEXP :(
The problem with using is-event-true is that you trigger that whole bug with Directives not showing up until they are true or false.

I just figured that out by myself :) To hell this bug  :hopping:   I'll try to figure out how you did that in the mission you fixed for me. Keep your fingers crossed for me.
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 Shade

  • 211
Re: I'm still failing at obviously simple SEXP :(
One way to hack it would be to have a second event that does something completely arbitrary and unnoticable (like warping in some random invisible ship 200.000 km away. Actually, in this particular case use an arrival cue instead of an event) when Alpha 2 gets within 5000m of the unknown contact. And then evaluate against that (not has-arrived-delay some_faraway_invisible_ship, in my example) instead.

In fact, you can make it even simpler if you keep in mind that you're never going to let the player get to the nav point. So you don't need to check for that at all, and the directive text doesn't care what the underlying conditions are (except for stuff like is-destroyed-delay which add a count).

What you need is that far away ship from before, with arrival set to happen after the fighter wing you mentioned destroying dies, and departure set to when the player gets within 5000m of the contact. Then all you need to do in this event is check against the far away ship being disabled, and it should work as you want it to. Just make sure to disable warp effects on the ship to avoid delays.
« Last Edit: March 28, 2006, 02:53:16 pm by Shade »
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.