Hard Light Productions Forums
Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: Starman01 on October 31, 2006, 01:27:42 pm
-
Hey there,
I really don't understand why FRED has to be so complicated when it comes to simple mission objectives. I have a
problem again, so any help would be appreciated.
Once again I'm trying to make a mission objective "hold formation" which checks the players distance to a certain ship over a certain time.
I already have a similar one in another mission and Karajorma help me creating it, which works fine now. I copied it into the other mission,
but here it refuses to work (goal shows up and can be completed, but it wont get FALSE).
Here is the situation :
30 Seconds after the event "M_List Sandmann11 bis Major15" has been executed, the goal "hold formation" should show up (which it does)
Now the player must stay within 500 meters to the ship alpha 1 until 55 seconds after event "M_List Pirate 1 to Ninja b" has been executed.
(that just a certain dialogue going on in that time, and the player is not allowed to break formation until he gets his order. If the time is up, he is allowed to attack and the goal becomes true (which also works).
But, any time as long the goal is incomplete the player shouldn't be more than 500 meters away from Alpha 1, if he is, then the goal is false (and the mission will end). And it's that FALSE, that isn't working :(
Theoretically it's the same like in the working mission, I just had to change a trigger. Here is what I have :
(http://www.wcsaga.com/~team/Starman/pics/fred10.jpg)
-
Try this, which should be easier:
Change "goal keep formation" to "goal failed". The event should become true if the player is more than 500 meters away from Alpha 1. If the event becomes true, the mission fails. If 55 seconds have passed since "lock weapons on attacker", and the event hasn't become true, then the player is allowed to attack.
-
The Greater than and Less than sexps have been spotty for months now. Try swapping it over to a less than (and swapping your data around of course) and seeing if that helps.
-
The Greater than and Less than sexps have been spotty for months now.
:wtf:
Is this in Mantis?
-
The Greater than and Less than sexps have been spotty for months now. Try swapping it over to a less than (and swapping your data around of course) and seeing if that helps.
I've said before that if you can find a single provable case of that happening I'm happy to take a look at it.
-
The Greater than and Less than sexps have been spotty for months now. Try swapping it over to a less than (and swapping your data around of course) and seeing if that helps.
I've said before that if you can find a single provable case of that happening I'm happy to take a look at it.
That's the problem - if they were broken I would. As it is they're.... spotty. (and I'm more afraid I'm doing it wrong and am going to look like an idiot :p)
OK. Example (I can attach the mission if need be) - the attached triggers at the very beginning of a mission when it shouldn;t (the caleb is 4200m away. Other times though it's the opposite - the sexp wont trigger at all no matter how close two objects get. It's weird. The only thing that convinces me I'm sane and not imagining the whole thing is the fact that VA has encountered it as well.
[attachment deleted by admin]
-
When
is-event-incomplete
goal trigger 1
and
not
is-event-incomplete
goal trigger 2
That anything to do with it, I cant make out how any thing would call an ending on this :confused:
-
Don't ask me, I have to admit that I really don't understand the deeper sense of this 3 SEXP. Kara made them for me, and they work fine in the other mission.
Only difference there, the time the goal should be false or complete is when the leading ship reaches a waypoint, and in this new example when an event is true a certain time.
I also have to admit to my shame, that I'm not totally sure how to build Goobers suggestion into an event. Could you please post me the code/synthax ?
As for the "greater than" or "less than" sexp, I use them alot in my missions, and at least with them I never had any problems.
-
The Greater than and Less than sexps have been spotty for months now. Try swapping it over to a less than (and swapping your data around of course) and seeing if that helps.
I've said before that if you can find a single provable case of that happening I'm happy to take a look at it.
That's the problem - if they were broken I would. As it is they're.... spotty. (and I'm more afraid I'm doing it wrong and am going to look like an idiot :p)
OK. Example (I can attach the mission if need be) - the attached triggers at the very beginning of a mission when it shouldn;t (the caleb is 4200m away. Other times though it's the opposite - the sexp wont trigger at all no matter how close two objects get. It's weird. The only thing that convinces me I'm sane and not imagining the whole thing is the fact that VA has encountered it as well.
I've made events exactly like that countless times with no problems. Maybe it's only an issue with specific models? (if their center points are messed up or something; that's about the only explanation I can think of)
-
Actually after looking at the issue quickly I can't see any good reason why you shouldn't expect the Greater Than event to go off at missions start.
The event triggers when the two are 2.5 km away and at mission start they are 4.2km away.
I'm happy to look at the whole mission though if need be.
-
I also have to admit to my shame, that I'm not totally sure how to build Goobers suggestion into an event. Could you please post me the code/synthax ?
Okay, see attached. This is much cleaner, IMHO.
[attachment deleted by admin]
-
Much more efficient :nod:
-
Not really. Which event is responsible for displaying the objective text ? Even more important, while the third event works more or less,
the second one will become always true as soon as I increase the distance to the other ship. So, even if I stay in formation until the one
event has been executed 55 seconds and I theoretically completed the goal "keep formation", the other will still become false once I start into battle (which leads into a selfdestruction in my mission).
I need a goal, that checks the status at a certain time. If the player is at this time in formation, it's completed. If he breaks formation anytime between the start of the goal and before it's finished (the trigger time is up, in this case the 55 seconds of that particular event) it's FALSE.
After the goal has been completed, the player is allowed to break formation. Any other suggestions ?
-
It's efficient. But it's not an improvement on Starman's design. In fact it's going to have the exact same effect as Starman's with the added bonus that it won't even show up until it's completed.
The game uses is-event-true-delay as a pointer as to when to display the directive in addition to when the directive is completed or not. It's a completely retarded way of doing things and it completely runs counter to the way people would expect directives to work as no other SEXP has this effect. It might not be a bug but it's still a ****ing stupid use of an undocumented side effect.
As a result Goobers event simply won't work. It won't even be displayed until 55 seconds after it should have been regardless of whether it's completed or not. Even worse that directive is always going to be true anyway because as soon as the 55 seconds are up the directive will check if the player left formation the second that he was told to get into formation because not (is-event-true-delay) with a delay of 55 can only read as false 55 seconds after the player left formation.
Now for the promblem itself. The events you've displayed don't check if the player has ever broken formation, merely if he is in it at the end of the time limit. Is that the cause of the problem? Are you breaking formation then rejoining it and still having it evaluate to true? Cause that's exactly what it should do. If you want the event to fail if the player ever breaks formation that can easily be done but first lets see if I'm right about the cause of your problem.
-
How about I send you the mission file I have ? Could you take a look into it ? It should work with the old beta-build you have, since I didn't change any ship models. Like I said, the goal itself works as it should, it just never get false.
Theoretically it should be more or less the same what you build for in the other formation goal. Only this time, there is no waypoint-distance trigger, but an "is-event-true-trigger".
Again, as long as the goal is incomplete (white letters in the objective box) the player is not allowed to break formation. After the objective is completed, he is allowed to do so.
-
Before you do that run a test for me. Run the mission and break formation immediately. Then don't ever go back into formation. If when you do that the event doesn't mark itself as false I'll take a look at it. If it does mark itself as false then I'll tell you how to get the effect you actually want. :)
My solution to your problem involves adding something to your current directive event and it's pointless doing that if it's not working cause as far as I can see it should become false if the player is not 500m from Alpha 2 when the formation flying display ends.
-
It's efficient. But it's not an improvement on Starman's design. In fact it's going to have the exact same effect as Starman's with the added bonus that it won't even show up until it's completed.
:wtf: I didn't even put the directive event in there. Are you sure you're not color-blind? :p
My intent wasn't to minimize the number of sexps needed, it was to make the sexps be as clear as possible. In my approach I would need to put an extra two events for a directive trigger + directive.
I suppose I would need to create an actual mission for you to see the whole example.
-
I assumed you must have missed the directive cause couldn't see what help your event was. :p
Starman knows how to build an event that comes true under the conditions he wants but what he wants is a directive that does the same. Seeing as you can't use is-event-true-delay with the events you've posted he's still going to have to rely on some mishmash of is-event-incomplete SEXPs to make that directive work.
Unless you're suggesting he completely gives up on the idea of having a directive at all.
Besides Starman is correct that as soon as the player does attack the enemy he'll still get the you have failed message :p
-
Are you sure you're not color-blind? :p
If that was related to me, believe it or not, I am colour blind :D Having red and black letter in the same text is very difficult for me to distinguish. Life sucks. :)
Regarding my SEXP's above, the following happens :
I was wrong in one point, the Goal get's false, just not to the correct time (though I could swear it didn't worked the first time).
Now, when I brake formation before or after the goal is started, it becomes true or false only when "M_List pirate1 to ninjab" has executed 55 seconds. So like I said, this time is only meant for the true-value, the false-value should be initiated anytime I break formation (after the goal has been executed, or better, a few seconds later to give the player the chance to get into formation) . Can one of you guys help me ? :)
(edit) BTW, since the first time you help me Kara, there was no "is event true" possible in a directive, but it is now :) . Maybe it can be done easier now.
-
You still can't use is-event-true-delay in a directive the way you'd think you could. It's ****ing idiotic but Taylor looked up the code and realised it wasn't a bug. That said if it's possible (i.e not used in the retail FS2 campaign and easy to fix) we should change it anyway and backwards compatability with anything else be damned.
Having read your description of the problem its pretty obvious that it's working exactly the way I designed it to. The way to make it work the way you want is simple. Add this event to the mission.
When
-and
--is-event-true-delay
---M_List Pirate 1 to Ninja b
---0
--not
---is-event-true-delay
----M_List Pirate 1 to Ninja b
----55
-- >
---distance
----Alpha 1
----Alpha 2
---499
-self-destruct
--Some unimportant ship
Now simply add a not-is-destroyed SEXP to the directive. As soon as the ship blows the directive will turn red. Same goes for if you make something warp out instead.
-
So, I'm back :)
I tried that, but it didn't work. Goal becomes now true instantly, no matter if I'm in formation or not. Here is my event(s)
(http://www.wcsaga.com/~team/Starman/pics/fred11.jpg)
-
Ummm. I said ADD the is-destroyed check SEXP to your existing directive. Not REPLACE it :D
I suppose I could have been clearer :)
-
Uhm,.... o.K :P
Shall it be within the "and" part or simply at the end of the event. And I assume when I have to keep my goal-event, I also have to keep my two goal-trigger events then, right ?
Back to the subject, it's really damn complicated making a simple "hold formation" goal :shaking:
-
Ugh. I was hoping I wouldn't have to do this, but here. Take a look at the attached mission and see how easy it is. :p
[attachment deleted by admin]
-
Easy :ha:.
The fact that you had to swap to using a mission goal despite never having mentioned this step before makes me suspect that it was a little more challenging than you thought it would be :p
Still it's a better solution than mine. I'll give you that :) I never thought of using a mission goal (and then invalidating it which I presume you would suggest Starman also does)
Back to the subject, it's really damn complicated making a simple "hold formation" goal :shaking:
Only due to the way is-event-true-delay works. I can see the code reason why it's there but it simply doesn't make any kind of intuative sense to a FREDder.
-
The fact that you had to swap to using a mission goal despite never having mentioned this step before makes me suspect that it was a little more challenging than you thought it would be :p
No, it was not. :p Take a look at the first three sexps in the mission; they're almost exactly the same except that I took the messages out and fixed one bug (putting 55 where I should have put 0 in one sexp).
The only reason the goal is needed is for the directive. I didn't put the directive in the first example and I even said I didn't put the directive in the first example. :) I only wanted to demonstrate the bare minimum of sexp logic to get my point across.
Also, the goal trick can be done away with entirely if one uses taylor's extension to is-event-true-delay to "fix" the directive behavior. :)
Still it's a better solution than mine. I'll give you that :) I never thought of using a mission goal (and then invalidating it which I presume you would suggest Starman also does)
Thanks. :)
That depends on what Starman does. If he uses taylor's is-event-true extension he won't need the goals. On the other hand I had been under the impression that Starman was actually connecting this mission objective to a "goal", but perhaps that was a language mixup.
Back to the subject, it's really damn complicated making a simple "hold formation" goal :shaking:
Only due to the way is-event-true-delay works. I can see the code reason why it's there but it simply doesn't make any kind of intuative sense to a FREDder.
That depends on your definition of intuitive. :p
-
And here's the version of the mission with the directives independent of the goals.
[attachment deleted by admin]
-
The only reason the goal is needed is for the directive.
I didn't put the directive in the first example and I even said I didn't put the directive in the first example. :) I only wanted to demonstrate the bare minimum of sexp logic to get my point across.
Given that a working directive was the whole purpose of Starman's post though you couldn't really anwer the question without actually providing a working directive though. And that wouldn't work until you suggested this workaround of using a goal. So until you posted the mission you would have just had Starman return scratching his head wondering why it didn't work :p
Also, the goal trick can be done away with entirely if one uses taylor's extension to is-event-true-delay to "fix" the directive behavior. :)
I forgot that was his solution to the problem. I did look for the thread where he explained it but I'll be buggered if I could find it using the search function. Either it was in the mantis entry or SMF is being annoying about turning up responses.
That depends on what Starman does. If he uses taylor's is-event-true extension he won't need the goals. On the other hand I had been under the impression that Starman was actually connecting this mission objective to a "goal", but perhaps that was a language mixup.
Based on the previous mission I'd say mixup. Having remaining in formation as a mission goal seems somewhat underwhelming. They'd probably have to give you a medal for managing to autopilot back to the base to keep the reward levels scale even. :)
That depends on your definition of intuitive. :p
It's a side effect. And side effects inherently hurt code readability. You can get away with a ++ or two but anything beyond that can start to really cause problems. Having to remember that is-event-true-delay has a seperate effect in directives from the one that it would be expected to have (especially one that wasn't actually documented anywhere) isn't exactly what most people would expect.
-
The formation-scp works fine, I try addapting this to my mission now :)
Just one thing :
I'm getting an error message with your event where it complains about the additional true value in the "is-event-true" when being used in the directive. Has there been a change recently to the synthax ? I'm still working with a recent build from 08.10., and there I have to put in a number, 1 for true, 0 for false (though the SEXP-Description talks about something else). Or do you have created that mission using notepad ? :D
After I changed that, it works fine.
-
Actually, that event is supposed to accept true/false. Accepting 0/1 is a bug. :)
I don't think the bugfix is in any new builds yet. The good news is that both true/false and 0/1 should work.