I have this turn script, it's a simple one. It switches off at turn 45 and everything seems to work except I get this error message:
(to clarify: I get the error message at turn 45. Never sooner, never later.)
"Error running script: Error compiling expression 'turnscript': RootExpressionElement: Cannot convert type 'Int32' to expression result of 'Element'"
Everything seems to work just fine... it's just annoying with that error message popping up.
This is the code for the turn script:
player.turns = player.turns +1
if (player.turns = 30) {
msg ("<font color=blue><sub><b>The block of ice in your pocket is starting to melt.</b></sub></font>")
}
else if (player.turns = 45) {
msg ("<font color=blue><sub><b>The block of ice has melted, leaving you with a huge stain in the crotch area.</b></sub></font>")
DisableTurnScript (player.turns)
SetObjectFlagOn (player, "haspee")
MoveObject (ice, VOID)
}
else {
}
Any ideas what I've fudged up this time?
get DisableTurnScript (player.turns)
Why the 'get'?
Should be
DisableTurnScript (player.turns)
or try disabling the script on turn 5 so you don't have to wait so long...
But it does sound like the disable command is the problem.
BTW, what is the name of your turn script?
@forgewright
That 'get' is not in the code... don't really know how it ended up here when I copy/paste it.
I tried to update it here on the forum but it wouldn't let me.
@xanmag
It helps in the sense that the error message pops up one turn later. It's an improvement for sure... I'm hoping to get rid of it all together though :)
(I liked your easter game!!)
Oh dear.
Can every kind soul who replied to (and read) this thread please forget about this ever happening?
Please?
Thanks guys. It's working now :)
The only person that does not learn anything, is the one not making mistakes...