Forum Discussion

JuergenFennes-7's avatar
JuergenFennes-7
Community Member
2 months ago

Storyline 360 - Board Game issue

Hi!

I am doing a board game in Storyline where the user choses a classic board-game piece which moves through the board on a number of fields after rolling the dice. This works well with motion paths and some variables.

Now the issue: I want to mark certain fields on the board as "move forward two fields", so that when the piece lands on that field (square), it moves two additional fields further. I manage that with a variable that basically makes the piece move forward when the piece intersects with the field (square). The problem is that lets say the piece is 1 field before the field that says "move two forward" and you dice a 6, the piece starts to move 6 fields further but stops after moving 1 field when it intersect with the "move two forward" field. Then it basically cancels the movement of the remaining 5 fields of the die and starts to move only 2 fields further, because it intersects with the "move two forward" field.

I would need something like an equation that says: move the piece foward by two fields when it intersects the "move two forward" field, only if the piece has already finished the diced movements (and not cancel the remaining diced movements). That last if seems impossible to manage, at least for me so far...

Anybody any idea how to overcome/solve that problem in any way?  

1 Reply

  • Hi,

    The issue is reacting to an intersection while movement is still in progress. Intersections fire during motion, which is why your dice movement gets cancelled.

    Instead, track the current board position with variables. Let the piece visually move only after the math is complete. Apply “move forward 2” after dice movement is finished, not while it’s moving

    Create these number variables vCurrentPos, vDiceRoll, vTargetPos, vExtraMove and 1 True/False variable vIsMoving. Each square should have a number, not logic tied to its shape. For exampl: Square 5: Move forward 2, etc. You’ll check this after dice movement ends. When user clicks Roll Dice, Set the trigger order as: Set vIsMoving = True, Set vExtraMove = 0, Set vTargetPos = vCurrentPos + vDiceRoll. Now move the piece step-by-step or via a motion-path system based on vTargetPos. After dice movement finishes, check for special square and move if found a special square.