Locking objects
Moderators: dorpond, trevor, Azhrei
-
- Kobold
- Posts: 2
- Joined: Sun Mar 24, 2013 11:53 pm
Locking objects
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?"
Re: Locking objects
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.
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.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 2
- Joined: Sun Mar 24, 2013 11:53 pm
Re: Locking objects
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.
Re: Locking objects
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".
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Locking objects
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.
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.
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]
}]
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.
Re: Locking objects
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]
{edit: looks fixed]
Last edited by evilC on Tue Mar 26, 2013 9:52 am, edited 1 time in total.
Re: Locking objects
you mean: create a LIB: lib:restrictMove and on that lib create a MACRO: onTokenMove with the following content...etc.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.
Then Edit->Campaign Properties->Token Properties tab.Code: Select all
[h:tokentype=getProperty("is_locked")] [h,if(tokentype==1),code:{ [h:tokens.denyMove=1] }]
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.
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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Locking objects
Heh, oh well we got there in the end
Re: Locking objects
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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Locking objects
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=23444wolph42 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.
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?
Re: Locking objects
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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Locking objects
Yeah, I use that in my FW all the time. Very useful, but mine is global.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Locking objects
i thought you had a 'general' lock movement, which I took from one of your libs. You also have an individual lock token?aliasmask wrote:Yeah, I use that in my FW all the time. Very useful, but mine is global.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Locking objects
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.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Locking objects
indeed... so I fail at reading wiki's AND posts... anyway: I've added both functions to the BoT, if anyone cares.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.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS