dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
4.01k stars 239 forks source link

Add warnings/errors to Dialogic 2.0 #936

Open coppolaemilio opened 2 years ago

coppolaemilio commented 2 years ago

List of errors to display

Send a proper descriptive error when

Jowan-Spooner commented 2 years ago

There is a ton of things that are currently not printing usefull errors. I would suggest that going forward we use the printerr() function for these, as it's clearer that something happened that was not supposed to (even if it doesn't break the game).

coppolaemilio commented 2 years ago

Yes! I was just creating issues as I make this example so we don't forget to add these in particular. We can modify this issue to track warnings/errors

hsandt commented 5 months ago

I would add detection of invalid characters used as speakers in Text node (or Character node in VN).

Currently, invalid characters are only visible in Text Editor. Visual Editor shows "(no one)" (which is a good start to spot unassigned characters but if your script mixed narration and speech, you may miss it). This is visible in game via the bubble backup layout (which tells us to use register_character) but it should say instead of there is no speaker at all (in which case, if intended we should change the bubble backup layout), or that the character is invalid.

To sum up: a. early parsing in Text Editor: highlight invalid character names (unfortunately that means extra parsing work to make it aware of game resources, but that work is done in autocomplete so why not) b. early parsing in Visual Editor: highlight invalid character names, showing the value in Text Editor instead of (No one) c. at runtime, also print error when invalid character tries to speak and must be replaced by no one d. in the bubble backup, distinguish error message if there is no character at all, if character is not registered and if character is registered but invalid (this may need extra script work and I fear that the general backup layout is unaware of context - the error message is currently stored in an embedded packed scene instead of a scene saved as separate resource, so it's a bit hard for me to see what's going on)

c. would help me the most as it would stand out even when I don't check timelines. Then a. and b.