Error every time I try to add a new line of code

Hey all,

Version 5.8.0. Every time I try to add a new line of code with the big + button, I get this error:

System.Exception: Error compiling expression 'game.showmoney': RootExpressionElement: Cannot convert type 'Object' to expression result of 'Boolean' ---> Ciloci.Flee.ExpressionCompileException: RootExpressionElement: Cannot convert type 'Object' to expression result of 'Boolean'
at Ciloci.Flee.ExpressionElement.ThrowCompileException(String messageKey, CompileExceptionReason reason, Object[] arguments)
at Ciloci.Flee.RootExpressionElement.Validate()

I can add manually through the code view but that is pretty annoying.

Game file is below (warning, it's NSFW):
https://puu.sh/Et11M/bcd6675c9c.quest


It's most likely that you haven't given that variable game.showmoney a default Boolean value, without one Quest will treat it like an Object, hence the Object not Bool error.


showmoney is a default attribute, initially set to false, and changed by a tickbox on the editor's "features" tab.

When you click the '+' button to add a new script, it uses the attribute game.showmoney to decide whether it's going to include the "Increase money" and "Decrease money" functions on the list you're choosing from.

This means that if you delete the showmoney attribute from the game element, or if you set it to a type other than boolean, you'll get an error in the editor every time you try to use the GUI script editor.

Solution:
Click on the 'game' element → "Features" tab → tick "Money"
Save, and check if that fixes your problem
If the issue is fixed, you should be able to untick the box again.

(And if you want to share a game file for people to help you, it's easier to share the ASLX file)


I think the error is occurred by using of boolean data types. Can't you use double instead of boolean? You can rewrite the code without using boolean and see if the error will show or not. You may take advice from quora and facebook.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums