Locking objects

Talk about whatever topic you'd like, RPG related or not. (But please discuss things related to our software in the Tools section, below.)

Moderators: dorpond, trevor, Azhrei

MystRunner
Kobold
Posts: 2
Joined: Sun Mar 24, 2013 11:53 pm

Locking objects

Post by MystRunner »

So I'm messing around with MapTool for the first time making a couple Pathfinder Maps and I keep running into a problem that has me irked to no end. The fact that I can't lock down objects that I place because of the limited amount of layers the program gives you while building. I'm wondering is there a way to add more layers or to make things sticky so they can't be moved around?"

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Locking objects

Post by aliasmask »

Unfortunately, not. You can have stuff on background, then put your newer stuff on object then move it to the background layer. It doesn't work well for freesize objects because of how it centers the image on object layer, but uses upper left corner on background layer, but if you set the token to a size, then that doesn't happen.

Most of my maps I'll make with a paint program and then add set design on background and object layer. The next incarnation of MapTool I think will have more control over layering, but that won't happen for a very long time.

MystRunner
Kobold
Posts: 2
Joined: Sun Mar 24, 2013 11:53 pm

Re: Locking objects

Post by MystRunner »

Okay I was just getting frustrated with building this encounter map because I kept clicking on one thing and it would chose everything BUT that one thing. I've drawn a good 3/4's of that map in photoshop before hand.

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Locking objects

Post by aliasmask »

Drawing entirely in MapTool can be tricky. The newest things have higher z-orders and appear on top. But you can set those things to the back by right click "send to back".

evilC
Cave Troll
Posts: 49
Joined: Thu Mar 21, 2013 3:29 pm
Location: London, UK

Re: Locking objects

Post by evilC »

If you are talking about the odd item here and there - set dressing etc., then this may work:

Drag the item in as normal, but then right click->chage to->token.


1) create a token called lib:restrictMove in your campaign, and on that token create a new macro. Name it onTokenMove and paste in the following code.

Code: Select all

[h:tokentype=getProperty("is_locked")]
[h,if(tokentype==1),code:{
	[h:tokens.denyMove=1]
}]
Then Edit->Campaign Properties->Token Properties tab.
Select Basic on the left, then in the box on the right, add another row at the end: is_locked
Click Update, then OK. You must click both.

To lock an item, be on the token layer, double click it, edit the properties and in is_locked, set it to 1.

evilC
Cave Troll
Posts: 49
Joined: Thu Mar 21, 2013 3:29 pm
Location: London, UK

Re: Locking objects

Post by evilC »

I dunno who edited my post there, but you caught me mid edit. I realised my mistake, but I think it now got a bit garbled :(

{edit: looks fixed]
Last edited by evilC on Tue Mar 26, 2013 9:52 am, edited 1 time in total.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Locking objects

Post by wolph42 »

evilC wrote:If you are talking about the odd item here and there - set dressing etc., then this may work:

Drag the item in as normal, but then right click->chage to->token.


1) create a token called lib:restrictMove in your campaign, and on that token create a new macro. Name it onTokenMove and paste in the following code.

Code: Select all

[h:tokentype=getProperty("is_locked")]
[h,if(tokentype==1),code:{
	[h:tokens.denyMove=1]
}]
Then Edit->Campaign Properties->Token Properties tab.
Select Basic on the left, then in the box on the right, add another row at the end: is_locked
Click Update, then OK. You must click both.

To lock an item, be on the token layer, double click it, edit the properties and in is_locked, set it to 1.
you mean: create a LIB: lib:restrictMove and on that lib create a MACRO: onTokenMove with the following content...etc.

the name of the lib is not important, the name of the macro is. ANY macro on ANY lib: which is called onTokenMove will be invoked when a token is moved.
Note that there is also onMultipleTokensMove which will only be invoked when... you can guess that one. However onTokenMove will ALSO be invoked in that case!! Once for each token moved! More info here

edit: @evilC my bad, I clicked the wrong button 'edit' instead of 'quote' and then wrote the post. As you noticed I immediately reverted it.

evilC
Cave Troll
Posts: 49
Joined: Thu Mar 21, 2013 3:29 pm
Location: London, UK

Re: Locking objects

Post by evilC »

Heh, oh well we got there in the end :)

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Locking objects

Post by wolph42 »

by the way, ANY variable attached to the token can be used for this trick. Using the property type is pretty invasive, you could also use a state or a property or even a hidden property.

evilC
Cave Troll
Posts: 49
Joined: Thu Mar 21, 2013 3:29 pm
Location: London, UK

Re: Locking objects

Post by evilC »

wolph42 wrote:by the way, ANY variable attached to the token can be used for this trick. Using the property type is pretty invasive, you could also use a state or a property or even a hidden property.
So as not to hijack this thread, could you please clarify that in this thread please wolph? ttp://forums.rptools.net/viewtopic.php?f=6&t=23444

On subject for this thread - surely to make it easy for the user to alter the locked status of the problem item, it is simplest to make it a property that can be edited in the character sheet?

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Locking objects

Post by wolph42 »

I've added lock token movement to the Bag of Tricks in the latest version. Need to update the post though. You can now select a token, click 'lock token' and then the token cannot be moved anymore.

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Locking objects

Post by aliasmask »

Yeah, I use that in my FW all the time. Very useful, but mine is global.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Locking objects

Post by wolph42 »

aliasmask wrote:Yeah, I use that in my FW all the time. Very useful, but mine is global.
i thought you had a 'general' lock movement, which I took from one of your libs. You also have an individual lock token?

User avatar
aliasmask
RPTools Team
Posts: 9029
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Locking objects

Post by aliasmask »

Like I said, global meaning all tokens get locked down. It wouldn't be that hard to lock only selected tokens with that button though, but I haven't found the need to only lock individuals. I generally want all movement to stop so I can type encounter stuff.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Locking objects

Post by wolph42 »

aliasmask wrote:Like I said, global meaning all tokens get locked down. It wouldn't be that hard to lock only selected tokens with that button though, but I haven't found the need to only lock individuals. I generally want all movement to stop so I can type encounter stuff.
indeed... so I fail at reading wiki's AND posts... anyway: I've added both functions to the BoT, if anyone cares.

Post Reply

Return to “General Discussion”