Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Starman01 on March 28, 2006, 12:24:10 pm
-
Hey there,
once again I need some help. I have this SEXP here :
(http://www.scifi-3d.de/wcsaga/Starman/pics/fred9.jpg)
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 ?
-
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.
-
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).
-
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
<
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)
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 ?
-
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.
-
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.
-
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.