Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unhandled Operation" Error during script compile is only logged but not thrown otherwise signalled #132

Open
drojf opened this issue Sep 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@drojf
Copy link
Contributor

drojf commented Sep 7, 2024

I was testing hou+ using the standalone compiler, and noticed two errors were output while compiling &opening.txt.

void OpeningLaunch()
{
	if (GetGlobalFlag(GVideoOpening) >= 3) {
		PlayOriginMovie();
	}
}

void OpeningStory()
{
	if (GetGlobalFlag(GVideoOpening) >= 2) {
		SetGlobalFlag(GVideoOpening, 3);
		PlayOriginMovie();
	}
}

void PlayOriginMovie()
{
	if (GetGlobalFlag(GArtStyle) == 2) {
		// Play OG video if using OG artstyle
		PlayVideo("video/mv13-pc.mp4", 1920, 1080);
	} else {
		// Otherwise play console art style
		PlayVideo("video/mv13-cs.mp4", 1920, 1080);
	}
}

The error is that PlayOriginMovie(); should actually be CallSection("PlayOriginMovie");

I'm not sure if this works anyway, even without the CallSection, as the movie does seem to play.

But I was wondering how we've been running CI/building the scripts without noticing this error. I then checked where the error was raised:

		public void ParseOperation(ITree tree)
		{
			name = tree.GetChild(0).Text;
			line = tree.Line;
			BGIParameters param = (tree.ChildCount <= 1) ? new BGIParameters() : new BGIParameters(tree.GetChild(1));
			if (paramLookup.ContainsKey(name))
			{
				OutputCmd(name, param);
				return;
			}
			Debug.LogError("Unhandled Operation " + name);
			CmdOpNull();
		}

It looks like the error is just printed out, but there is no signalling during compile that an error occurred, so the compiler thinks everything is OK.


Will need to check whether this was done deliberately (as the script seems to work anyway under this condition).

But personally, since this only happens if there is a genuine error, I would want to throw an exception and tell the developer to fix the script (since it should usually be an easy fix).


Also check if this applies to previous chapters (apply this fix to the mod branch)

@drojf drojf added the bug Something isn't working label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant