Turn script error message.

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)

Try disabling the turn script on move 46. See if that helps?


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!!)


K.V.

player.turns is an integer, not a turn script. Correct?


@darklizerd

it's called icemelt


@K.V.
That's correct!
(I liked your easter game too!!!)


K.V.

DL is on the right track. What is the name of the turnscript? That's what goes in DisableTurnScript().


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 :)


K.V.

You know what it means when you're messing something up in my world?

It only means you're doing something!


I liked your easter game too

Thanks!


The only person that does not learn anything, is the one not making mistakes...


@K.V. & DL

Wise words :)


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

Support

Forums