Restric movement

Hello, how can I make a piece not move (drag and drop) until a condition is met, for example until an turn x arrives, and then it can move as one more.
I have not found how to do it, checking the command “restrict” or in “does not stack” but I do not know how I can do it, and here in the forum I have not found a similar situation either.

I can’t think of any way to prevent the piece from being dragged and dropped before a condition is met, but what you can do is add a “Keystroke to apply when a piece is moved here” to any map board it might be moved to, and then use that keystroke for a Trigger Action that checks the current turn, and triggers a Send to Location back to the original location if it’s too soon.

Option 2: Hide the piece on another board (not easily accessible), then move it to its proper location with a Global Key Command triggered by the turn counter on the appropriate turn.
Option 3: Define most of the piece in a prototype. Have the piece reference the prototype, plus a Does Not Stack trait that makes it immobile, and a Replace With Other trait that replaces it with an identical piece (again, use the prototype) minus the Does Not Stack & Replace With Other traits. Trigger the Replace With Other from a Global Key Command in the turn counter on the appropriate turn.

Thanks for the answer. I wil try to use one of the two solutions.

That’s actually exactly how you prevent pieces from being dragged and dropped. Use a Trigger action with the property match:


that triggers a Send to Location moving the Piece to {OldLocationName}. I’d also trigger an Alert that reads “You cannot move that piece until turn x!”

I use this same method to prevent players from placing pieces in illegal locations.

PS No biggie, but these types of questions belong in the Module Design forum.

Hi, sorry to include this thread in this forum but I didn’t realize that the appropriate one was “Module Design”. If any admin can change it I thank him.

Regarding the problem raised, if I use the option “Key Command to apply to all units ending movement on this map:” to trigger an event to change to the previous location, when I go back to that position again it fires and returns to the position where it moved, and it fires again to return to the initial position and so on in an infinite loop.
And if I only put as a condition to the trigger that {LocationName!=OldLocationName}, without including any keyboard command or waiting for the keyboard, it will never be executed, and I thought that by not putting it I would always be checking it. I have tried to only make a report when it is produced and never give that report by moving the piece.
I think I’ve reached a dead end and I don’t know how to get out
Thanks @jrwatts for your advice.

Of course thanks to @m3tan too !!!

Rather than {LocationName!=OldLocationName && Turn < x}, try {LocationName != “” && Turn < x}, Where is the name of the location you’re moving it back to. That way, it should only trigger when it’s moved away from the original location, not when it’s moved back.

If you’re just moving it to coordinates, rather than a named region, use {(CurrentX != || CurrentY != ) && Turn < x} (again, substituting the correct values) instead. You need the parenthesis because && (logical and) normally has higher priority than || (logical or) in Java.