Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: bomb3rman on February 26, 2018, 02:09:21 am

Title: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 02:09:21 am
Hey guys, I ran into a problem...

My mission with an escort directive worked a few days ago. But somehow, now it does not anymore. It's becoming true when 4 Transports are disabled, but it's not becoming false anymore when any of the FAIL-events is becoming true...

I just can't find the problem. I'm posting the fs2-file. Maybe someone of you can open it with an editor and tell me what I messed up...

The event I'm talking about is called "Stop Freighters 1".

And one additional question: Is there a maximum of variables I can use? I somehow get the strange problem that some weapons I checked in the Team Loadout don't stay "checked"...

Thanks!



[attachment stolen by Russian hackers]
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 26, 2018, 04:43:18 am
And one additional question: Is there a maximum of variables I can use? I somehow get the strange problem that some weapons I checked in the Team Loadout don't stay "checked"...

Thanks!

You can have:
   - 250 variables in a mission
   - 512 events in a mission

Can't check out the mission until I return from travels, but if no one else does I will give it a shot. If you want you can upload a screenshot of the SEXP tree :)
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 05:57:11 am
Quote
You can have:
   - 250 variables in a mission
   - 512 events in a mission

Ok then I'm far away from the limits :)

There you go if this helps:

https://picload.org/view/daaagdcr/1.png.html (https://picload.org/view/daaagdcr/1.png.html)

There are several fail events, depending on the variables (Freighter jumped out = Jump var +1. freighter destroyed = Destr var +1).

Though I doubt it is just this event...
Title: Re: Escort directive become false not working anymore...
Post by: Nightmare on February 26, 2018, 06:22:25 am
What about using percent-ships-departed, or atleast a single fail-event that uses that a condition?
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 07:03:08 am
As stated in an almost similiar thread (https://www.hard-light.net/forums/index.php?topic=93038.0 (https://www.hard-light.net/forums/index.php?topic=93038.0)), "percent-ships-departed" sadly doesn't work :(

Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 26, 2018, 07:07:39 am
Quote
You can have:
   - 250 variables in a mission
   - 512 events in a mission

Ok then I'm far away from the limits :)

There you go if this helps:

https://picload.org/view/daaagdcr/1.png.html (https://picload.org/view/daaagdcr/1.png.html)

There are several fail events, depending on the variables (Freighter jumped out = Jump var +1. freighter destroyed = Destr var +1).

Though I doubt it is just this event...

Thanks, it could very well not be that event. Are there only four freighters, and the goal is to stop at least one? If that is true and Nightmare's solution does not work then you could also use the "jump var" and "destroy var" as simply a logic test without needing to refer to the others events. Also does this event fire at the start of the mission? I just noticed it wasn't chained.

Also, I might suggest adding in a directive-is-variable sexp to track freighter count if you don't have one in another sexp already. :)
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 07:15:03 am
There are seven freighters, at least four must be stoppped. The Variables Jump and Destroy are counting if one of them gets killed or jumps out.

The fail events are: Jump = 4, Jump 3 and Destr = 1, Jump 2 and Destr = 2, Jump 1 and Destr = 3, Destr = 4. Every time one of the 3 things happens to a ship (disabled, killed, jumped), the corresponding variable gets +1.


Yes the event fires at the start, you find the convoy and have to disable at least 4 of them before they jump.

I'm wondering because the event turns true (blue) once 4 are disabled. So it's not a mistake inside the counting itself... It just doesn't turn red...
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 26, 2018, 07:24:47 am
There are seven freighters, at least four must be stoppped. The Variables Jump and Destroy are counting if one of them gets killed or jumps out.

The fail events are: Jump = 4, Jump 3 and Destr = 1, Jump 2 and Destr = 2, Jump 1 and Destr = 3, Destr = 4. Every time one of the 3 things happens to a ship (disabled, killed, jumped), the corresponding variable gets +1.


Yes the event fires at the start, you find the convoy and have to disable at least 4 of them before they jump.

I'm wondering because the event turns true (blue) once 4 are disabled. So it's not a mistake inside the counting itself... It just doesn't turn red...

Gotcha. Also I tested percent-ships-departed and it works for me with the newest nightly at least. So if it is working then that would be a more concise method to keeping track of the 7 ships.
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 07:30:00 am
Ok I'll try. Now I'm using 3.8. I had the problems with percentage-ship-departed with 3.7.4. Maybe it works now...
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 26, 2018, 07:34:51 am
Ok I'll try. Now I'm using 3.8. I had the problems with percentage-ship-departed with 3.7.4. Maybe it works now...

Cool, let me know how it goes. Hopefully it works for you!
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 08:33:21 am
The percentage-departed/destroyed/disabled feature nightmare and you thought of is working with this build (3.8) for me :) Didn't even think about this feature anymore...

By using different percentages I'm able to cover all eventualities. Thanks a lot :)

I'm just wondering why the other way worked for me in the first place and then suddenly it does not... I still can't see a mistake in the mission I attached...
Title: Re: Escort directive become false not working anymore...
Post by: Nightmare on February 26, 2018, 08:38:31 am
Good to hear that it's working for you now  :)

I think if you make missions and conditions too complex (like the large condition list), there's a growing chance something goes wrong. Just one thing you forget or that the game interpretes in a different way than you is enough...
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 08:59:08 am
Yes I guess, maybe it got too complex somewhere... This is definitely the easier way ;)
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 26, 2018, 09:29:20 am
Yes I guess, maybe it got too complex somewhere... This is definitely the easier way ;)

Also glad you got it working. I have been there many times, with outcomes that I had not tested yet so I thought it was a bug, but really just my lack of total coverage. Easier way is good for many reasons :)
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 11:07:10 am
Easier way is good for many reasons :)

Oh yes  :cool:
Title: Re: Escort directive become false not working anymore...
Post by: karajorma on February 26, 2018, 03:23:08 pm
If you don't know why an event isn't working, use the event log. That's literally what it's for.
Title: Re: Escort directive become false not working anymore...
Post by: bomb3rman on February 26, 2018, 08:10:54 pm
Ok I'll look into it :)
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 27, 2018, 02:27:04 am
If you don't know why an event isn't working, use the event log. That's literally what it's for.

Event logs are great. It took me a hot second to realize that they should all be turned off though unless I was bug checking, as in my more recent missions the default setting of having them on generates a large log file and slows fps way down  :lol:
Title: Re: Escort directive become false not working anymore...
Post by: karajorma on February 27, 2018, 05:07:23 am
Logging true events shouldn't be too bad most of the time. It's when you log false events that you have a problem because that will write to the log every single frame.
Title: Re: Escort directive become false not working anymore...
Post by: wookieejedi on February 27, 2018, 08:04:17 am
Logging true events shouldn't be too bad most of the time. It's when you log false events that you have a problem because that will write to the log every single frame.

Oh that's true. I don't know why I didn't realize that before. That will definitely be useful moving forward, thanks!
Title: Re: Escort directive become false not working anymore...
Post by: karajorma on March 01, 2018, 12:10:54 am
At some point I should probably write a detailed tutorial on how to use the event.log for bug fixing.