Create account / Log in

Locking a Layer

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Locking a Layer

Postby zhavier » January 19th, 2012, 8:07 pm

I am trying to make it so that the pieces in a certain layer can't be moved. it seems like there are a lot of options, but I could use some pointers.

The idea is that I have a set of game pieces that get placed at the beginning of the game and then should not be moved or affected for the rest of the game.

I was thinking that a keystroke could lock or unlock the layer, but I dont know how to implement that.
zhavier
 
Posts: 14
Joined: January 10th, 2012, 3:17 pm

Re: Locking a Layer

Postby DrNostromo » January 20th, 2012, 5:57 am

Give each of those pieces a Does Not Stack trait and set the settings for both Move and Select to Never.
User avatar
DrNostromo
 
Posts: 1036
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA

Re: Locking a Layer

Postby irishwulf » January 20th, 2012, 4:10 pm

Zhavier,
If the pieces need to be positioned at the beginning of the game, you can make two copies of the pieces - one as described by Dr. Nostromo, and the other movable. Give the movable pieces a 'Replace With Other' trait to substitute the unmovable pieces after they've been positioned; this can then be triggered either via right-clicking individual pieces, or via a global key command to all pieces in the layer simultaneously. If you want to be able to unlock the layer as well, just give the unmovable pieces a Replace With Other pointing back to the movable pieces.
irishwulf
 
Posts: 243
Joined: December 17th, 2011, 4:29 am

Re: Locking a Layer

Postby zhavier » January 24th, 2012, 7:20 pm

That solved the problem, much appreciated!
zhavier
 
Posts: 14
Joined: January 10th, 2012, 3:17 pm


Return to Module Design

Who is online

Users browsing this forum: No registered users and 1 guest