Page 1 of 1
Add prototype descriptor to error function
Posted: Wed Oct 30, 2024 1:44 pm
by PennyJim
I think it would be useful to be able to tap into the prototype changes tracking and blame other mods, by blaming the prototype when intentionally calling error
It would be an additional function signature akin to defining the level. Instead of blaming a function calls n levels up, it can blame error("that prototype right there, officer.", "type", "name")
It may be a little niche, but I can see it being very useful in places where people keep blaming one mod for the problems of another (ala Quality)
Re: Add prototype descriptor to error function
Posted: Mon May 12, 2025 6:23 pm
by PennyJim
To bump this and add more information
I want to be able to declare a specific prototype as the cause of an issue, like this:
Code: Select all
error("This prototype is in an invalid state for applying this affect to", type, name)
So when the error appears to the User, it taps into the prototype tracking and shows the error like a prototype error:

- LuaPrototypeError.png (83.34 KiB) Viewed 663 times
Re: Add prototype descriptor to error function
Posted: Mon May 12, 2025 6:31 pm
by protocol_1903
+1. Would also greatly help for dynamic/automatic mods that create/modify entities ad nauseum.
Re: Add prototype descriptor to error function
Posted: Fri May 23, 2025 7:48 am
by Rseding91
Hmm, but the actual error is not with *the other* mod, but your mod, no? Because if the player removes *your mod* the error goes away and the game continues to function.
Re: Add prototype descriptor to error function
Posted: Fri May 23, 2025 12:39 pm
by PennyJim
That's why your mod will be listed as one of the ones at fault even if you're not on the history for that prototype.
I can concede that maybe the error should be specially formatted to provide emphasis on which mod threw it. Meaning this is less of a drop in idea like I was initially thinking.
Re: Add prototype descriptor to error function
Posted: Fri May 23, 2025 6:43 pm
by protocol_1903
I thought i knew whet was being requested but know i dont... can you explain the proposed error message again?
Re: Add prototype descriptor to error function
Posted: Fri May 23, 2025 7:26 pm
by PennyJim
protocol_1903 wrote: Fri May 23, 2025 6:43 pm
can you explain the proposed error message again?
A way to error with prototype history (like prototype errors) if you're aborting because of a specific prototype.
Like so the Quality mod can also blame other mods, instead of just everyone thinking it's the Quality mod's fault some how. The Quality mod would still be listed in the blamed mods because it threw the error, even if it wasn't listed in the prototype history.
Re: Add prototype descriptor to error function
Posted: Fri May 23, 2025 8:34 pm
by protocol_1903
Ah yes, i see. Yes, that would be awesome
Re: Add prototype descriptor to error function
Posted: Sun May 25, 2025 10:30 am
by MrSmoothieHuman
+1, having more "verbose" errors would be massively helpful for debugging in general and working on mod compatability