How do you make a player's turn counter? (on-line version)

I am using the on-line version of Quest, and I am having trouble making a counter to keep a total of the amount of turns a player takes.

I tried using this tutorial:
But ended up at a dead-end as far as my programming knowledge goes. I got this error and haven't been able to fix it so far:

Error running script: Error compiling expression 'player.turns + 1': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Int32'

If someone could re-explain the tutorial to me I would greatly appreciate it.
If someone has a completely different way of doing this whole thing and could explain that to me step-by-step, that would be fantastic as well.

Also, keep in mind that I am brand new to using Quest so I generally have no idea what I'm doing, so make no assumptions :)

Thanks in advance. :)

This is a duplicate thread:

There is a problem with the dot operator: multiple turns count as one.

So, for example, if I go n.n.e.e.n. to enter a room, the turn script counting game turns runs only once, although it should run 5.

How do we fix that?

Sadly, there is no simple fix. It happens in a function, and function cannot be overridden online.

We were recently discussing a change to the HandleSingleCommand function to make it call a turn count function, but it's still on the table.

If you have the desktop version of Quest, check out this link (you can't do it online):

I was wondering about that; it seems to me that when entering multiple commands with dots between, turnscripts should run for each. But you can't make that the default without possibly breaking existing games.

What I'd do is add a boolean attribute to turnscripts; if true, they're run at the end of HandleSingleCommand rather than by RunTurnScripts. Then users can decide when they want their scripts to run :)

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