Author Topic: [VCE] Collecting and returning "Pieces" to win  (Read 429 times)

My current minigame has two variables attached to winning: <var:client:piecescarried> and <var:minigame:pieces>. The former is either 1 or 0 to determine whether or not the client is carrying a piece. The latter is how many pieces have been returned to the central win brick, henceforth referred to as "the Stone". When a player brings a piece back to the Stone by clicking on it, the variable "piecescarried" is set to 0 and 1 is added to the variable "pieces". When the value of "pieces" is equal to 6, the game is won and "pieces" is set back to 0.

Only problem is, this last part does not work. Ever. OnMinigameReset does not reset "pieces" to 0, nor does "OnVariableTrue" or "OnVariableFalse".
So what do I need to do to reset "pieces" to 0?


/pagestretch on
Events for the piece brick

Events for the win brick

/pagestretch off

First of all, you aren't using "pieces" as the variable, but "<var:minigame:pieces>" as in <var:minigame:<var:minigame:pieces>>
You only need to use <var:...> when using ifValue or in text, not when using ifVariable or ModVariable

Maybe using that can be the cause, but I don't think it is something game breaking.

Secondly, I may be wrong here but I think in line 10 of your win brick you need to change the number in the sub box from "11" to "11 11"
It needs 2 variable, starting and stopping. Just placing one may not be integrated in VCE.


What I think may fix the problem is adding 1ms delay on line 8 of your win brick.
I think after executing the win event it stops executing other events. Adding that delay will make sure it goes in the right order.

First of all, you aren't using "pieces" as the variable, but "<var:minigame:pieces>" as in <var:minigame:<var:minigame:pieces>>
You only need to use <var:...> when using ifValue or in text, not when using ifVariable or ModVariable

Maybe using that can be the cause, but I don't think it is something game breaking.

Secondly, I may be wrong here but I think in line 10 of your win brick you need to change the number in the sub box from "11" to "11 11"
It needs 2 variable, starting and stopping. Just placing one may not be integrated in VCE.


What I think may fix the problem is adding 1ms delay on line 8 of your win brick.
I think after executing the win event it stops executing other events. Adding that delay will make sure it goes in the right order.
Thanks, that bit about only needing <var:...> in ifValue wasn't stated in the manual. But what do you mean by "in text", exactly?
Also: If I wanted to set piecescarried to 1, all I'd need to define is "piecescarried", not the full variable markup?

But what do you mean by "in text", exactly?
He means for displaying a variable in center print or whatever.
Also: If I wanted to set piecescarried to 1, all I'd need to define is "piecescarried", not the full variable markup?
Yes.

Okay, question answered, locking.