Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: SF-Junky on February 07, 2021, 02:42:25 pm

Title: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on February 07, 2021, 02:42:25 pm
Not sure if it's the correct forums.

See title. This box switches itself on arbitrarily. I've encountered this in numerous missions now on different builds - currently using the latest nightly. Can anyone confirm this?
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: General Battuta on February 07, 2021, 02:46:19 pm
Lol nice. I wonder if this is behind a bunch of mission stuff randomly breaking? You'd have to actually open the mission for the box to get switched on, right?
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: 0rph3u5 on February 07, 2021, 06:11:47 pm
I can confirm for build 20.1.0-20210101, see here (https://www.hard-light.net/forums/index.php?topic=95764.msg1906965#msg1906965) (MoGW-Omni 1.0.0 was set to 20210101 or newer; last changes before re-release of the mission in question were done using 20210101).
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on February 08, 2021, 12:24:25 pm
You'd have to actually open the mission for the box to get switched on, right?
If you want it to be switched on, then yes. I guess. The question is what causes this automatic activation. The feature is also non-accessible if you open the mission file in text editor.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: 0rph3u5 on February 08, 2021, 02:06:22 pm
The feature is also non-accessible if you open the mission file in text editor.

That's wrong. Adding/removing this line to end of an event enables/disables it in Editor:

Code: [Select]
+Event Flags: ( "interval & delay use msecs" )
So it can be assumed that it is something that FRED does when saving.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on February 08, 2021, 06:35:59 pm
This is a strange bug.  Does it only happen in FRED, or does it happen when playing a mission in FSO?
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: 0rph3u5 on February 09, 2021, 03:15:35 am
I sadly cannot offer any information more than "it happened some time during the making of that version" - I did work on several missions in paralell in multiple open FRED windows and after one another in the same FRED window at the time. It happened while I was doing a lot of small edits (e.g. adding contextual messages regarding the new SD Demon missile armament; none of those are using the flag). That's also why I can't 100 percent rule out human error, I am just up 90 percent.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on February 10, 2021, 07:05:24 pm
Hmm.  Well I went back and scrutinized the code, but that flag should work just as well as the chained flag works.

However, if you can find a way to reproduce this, I'll be happy to take another look.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Mobius on February 11, 2021, 03:48:45 pm
I experienced something similar, but I came to the conclusion that it was no bug. I simply clicked on the tiny box by mistake due to an overly sensitive mouse button. Working on the mouse a little bit effectively prevented the issue from occurring again.

My suggestion, providing it's doable, is to mark events chained in milliseconds with a different "chain" symbol in FRED, so that they would become easily noticeable. I'm no coder so I don't know whether implementing this is going to break something or not.  :nervous:
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on February 11, 2021, 04:28:39 pm
It's possible.  The problem is that the chain symbol is so small it would be hard to fit much additional detail there.  What would you suggest?
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Mobius on February 11, 2021, 05:00:58 pm
A triangle, maybe? Or a different color, like green?

The color would be much easier to notice compared to a different symbol, IMO, but we have many directives chained in milliseconds. That would result in a direct conflict with red.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: karajorma on February 12, 2021, 01:18:49 am
Having a different coloured image would be pretty easy actually.

I think one thing that might be causing problems is that the use milliseconds option doesn't appear to be looked at when FRED checks if an event has changed. So if you accidentally ticked the box, noticed it, changed the SEXP and then just moved on, it might not save the change.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on February 12, 2021, 01:20:48 pm
The feature is also non-accessible if you open the mission file in text editor.

That's wrong. Adding/removing this line to end of an event enables/disables it in Editor:
No, at least in those cases where it switched itself on it doesn't show up, at least not with me.
Yes, the flag ist there in txt editor. Why haven't I seen this before?

And I'm 100% sure that this was not my mistake. It happened with SEXPs were I would never ever use this feature.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on March 06, 2021, 05:05:41 am
Has there been a solution to this problem yet? Because it really gets annoying. I use a lot of chained events in my missions and this keeps showing and totally messing up mission design.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on March 06, 2021, 07:53:44 am
Supplemental.

As I just see this: It does not seem to appear when saving the mission in FRED. Check out the following mission file. When you open it in the text editor you'll see that "Interval & Chain in Milliseconds" is flagged nowhere. When I hopen it in FRED, however, it's on at least in the following events: Msg 1.3, Msg 1.4, Msg 1.6, Msg 2.1, Msg 2.3, Msg 2.5, Msg 2.6.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on March 06, 2021, 09:30:02 am
I haven't been able to reproduce it, and I haven't seen any problems in the code, so no, there hasn't been further progress on it.

But if the bug reliably appears when loading that mission, then that sounds promising in terms of tracking it down.  I'll take a look.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on March 06, 2021, 07:28:16 pm
Well, I just tested that mission.  I opened it in both Debug FRED and Release FRED, and in neither version did I see that checkbox flagged in the events you mentioned.

However, I had to make a lot of edits to that mission to get it to load properly.  There were numerous errors including missing AI classes, missing ship classes, missing weapon classes, missing turret subsystems, and incorrect initial orders.  It is possible that a different error caused a memory leak which interfered with the chain flag.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: SF-Junky on March 07, 2021, 04:46:29 am
However, I had to make a lot of edits to that mission to get it to load properly.  There were numerous errors including missing AI classes, missing ship classes, missing weapon classes, missing turret subsystems, and incorrect initial orders.  It is possible that a different error caused a memory leak which interfered with the chain flag.
That's not surprising as that mission is from my mod which comes with a lot of changes to assets, weapons, AI, etc. When I open the mission in debug fred, there are zero problems.

However, since I'm not the only one experiencing this problem, I'm rather confident the error is not caused by something specific to my mod.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Cyborg17 on March 07, 2021, 01:24:31 pm
Best thing you can do is to come up with a test mission that works on retail data that has the bug appear 100% of the time.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: Goober5000 on March 09, 2021, 08:25:16 pm
Best thing you can do is to come up with a test mission that works on retail data that has the bug appear 100% of the time.

This... but if my memory leak hypothesis is correct, this will be tricky to do.

Another option is to gradually remove things from the mission until the bug stops occurring.  Then look carefully at the most recent thing that was removed and see if you can get it to trigger the bug by itself.
Title: Re: "Interval & Chain in Milliseconds" switches itself on
Post by: mjn.mixael on April 02, 2021, 12:16:17 pm
This just happened to one of my missions.