OLD Wolph42's 'Drop-in' Bag of MT Tricks OLD

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

Moderators: Azhrei, dorpond, trevor, giliath, Gamerdude, jay, Mr.Ice

Locked

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Cewl feat: fully auto teleports

Post by jfrazierjr »

Cools stuff! Make more better easier....heh..

Also, perhaps you could create a "trap" builder macro....
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


User avatar
plothos
Great Wyrm
Posts: 1890
Joined: Sat Jun 21, 2008 1:07 am

Re: Cewl feat: fully auto teleports

Post by plothos »

wolph42 wrote:
jfrazierjr wrote:Also, perhaps you could create a "trap" builder macro....

_˅_
. |
¯¯¯
Hey, didn't you know? Doing something only proves you can do more stuff! :)
Drop-In Utilities:
My Spell Manager for D&D3.5 and PFRPG
My Inventory Manager for D&D and PFRPG, but more generally useable than that.
My Message Manager -- My Top-Down D&D Token Images
and my Custom Initiative & Status/Spell-Effect Tracker (work in progress, but functional).

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

plothos wrote:
wolph42 wrote:
jfrazierjr wrote:Also, perhaps you could create a "trap" builder macro....

_˅_
. |
¯¯¯
Hey, didn't you know? Doing something only proves you can do more stuff! :)


<hmpfff>

attached is an update with the option to teleports to other maps as well.
This works exactly the same except that you need to set the OTHER map name in the tokenproperties of the inter teleport token.
It also has the option to create teleports on other maps as well.
...and it now also centres correctly on the new teleport...

This works slightly more complicated as the first version, as every map now has its own UDF, which needs to be created and put in the onCampaignLoad

</hmpfff>

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Cewl feat: fully auto teleports

Post by jfrazierjr »

Soo... I can expect the trap builder by the end of the weekend? :mrgreen:
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Cewl feat: fully auto teleports

Post by jfrazierjr »

I just played with this. Good stuff!! but I can't help but think it could be simpler. For example, select two tokens(assuming they stay on the same map) and run macro that uses getselected to "link" two tokens by setting it's partner into a property together(perhaps with a dialog that asks to select map names for both to "teleport" to(or keep same map). Perhaps keeping the list of teleporters in a json array on the Lib::Token to see if the token ended it's movement on it? Anyway, just a thought.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Cewl feat: fully auto teleports

Post by jfrazierjr »

wolph42 wrote:Admittantly I was hopping on my seat when I figured this out.
Conceived problem:
jfrazierjr created the nice onTokenMovement patch for e.g. traps and teleports


Well heck.. if my patch is a problem, perhaps I should take it out. :P
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

jfrazierjr wrote:I just played with this. Good stuff!! but I can't help but think it could be simpler. For example, select two tokens(assuming they stay on the same map) and run macro that uses getselected to "link" two tokens by setting it's partner into a property together(perhaps with a dialog that asks to select map names for both to "teleport" to(or keep same map). Perhaps keeping the list of teleporters in a json array on the Lib::Token to see if the token ended it's movement on it? Anyway, just a thought.

Maybe. But not Sure. First of the fact that you only need to copy paste is very very simple. And as for the internal teleport. You do need to create separate udf's cause else you'll get errors while mt starts looking for tokens that do not exist.

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

jfrazierjr wrote:
wolph42 wrote:Admittantly I was hopping on my seat when I figured this out.
Conceived problem:
jfrazierjr created the nice onTokenMovement patch for e.g. traps and teleports


Well heck.. if my patch is a problem, perhaps I should take it out. :P

Yes that is a problem... :P o thee twister of words...

User avatar
jfrazierjr
Deity
Posts: 5175
Joined: Tue Sep 11, 2007 7:31 pm

Re: Cewl feat: fully auto teleports

Post by jfrazierjr »

wolph42 wrote:Maybe. But not Sure. First of the fact that you only need to copy paste is very very simple. And as for the internal teleport. You do need to create separate udf's cause else you'll get errors while mt starts looking for tokens that do not exist.


Ok.. Forgive my ignorance since I have mainly let others do macro framework stuff, but why do you need the udfs per map at all? I guess I was thinking about a general macro that onTokenMove() calls passing in the path in the args and that macro does all of the lookups and stuff from a json stored on a lib token. Perhaps I am just way under thinking this all since as I say, I don't really know the macro language super duper well.

As for the copy/paste, yea, that is simple with the proviso that you have to change your token numbering scheme if you do like I do and have random numbers as well as make sure the tokens have a specific name base. Granted, this is less work if it's done right, but I think if the other way can be made to work, it would be easier to document as a set of macros.
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

The big trick is that you can set the teleport pads as (invisible) objects. This has the benefit that you can deform the base e.g. A landingstrip and the name is irrelevant (well it is for the code but not for the map.
2.

Cweord
Great Wyrm
Posts: 1343
Joined: Sun Aug 12, 2007 10:49 am
Location: Midsomer Norton, (Near Bath), UK
Contact:

Re: Cewl feat: fully auto teleports

Post by Cweord »

It would involve some extra work on other maps, but this would work well for buildings and floors.

You wouldn't be able to fight across different levels, but otherwise it should work (till 1.4 if it has multi level support
Cweord

This message has been spell checked by Freudcheck - any mistakes are purley a figment of your imagination.
-------
My Tokens Directory
http://gallery.rptools.net/v/contrib/Cweord/Character_Tokens/

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

Cweord wrote:It would involve some extra work on other maps, but this would work well for buildings and floors.

You wouldn't be able to fight across different levels, but otherwise it should work (till 1.4 if it has multi level support

There is another post here with multimap support. So that's also already done. I'll update the first post later.

User avatar
wolph42
Deity
Posts: 9718
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Cewl feat: fully auto teleports

Post by wolph42 »

I'm in need of some help:

first of I noticed iced that multiple tokens transport does work within a map but not in between maps, though I think I know the solution for that.
What I can't figure out, is the fact that a 'pause' is needed after the transport to another map has taken place, to get the coordinates for the 'arrival' pad. Somehow if I do it directly they're not received. Does anyone know why and better yet, how to solve this pickle?
This is the routine: CurrentX and Y are the coordinates of the token when on the departure pad. newX and Y == offsetCentreX and Y if I don't use te pause (which is wrong).
[h:'<!--Teleports Starts A to B-->']
[h, for(i,1,numInterPads+1), CODE:{
[teleportStartName = "interPad " + i]
[teleporterTriggered = movedOverToken(teleportStartName,lastPath)]
[if(json.contains(teleporterTriggered,currentLocation)), CODE:{
[Token(teleportStartName): newMap = pairedMap]
[teleportEndName = "interPad " + i]

[Token(teleportStartName): offsetCentreX = CurrentX - coordX]
[Token(teleportStartName): offsetCentreY = CurrentY - coordY]

[moveTokenToMap(currentTok, newMap, 0, 0, 0)]
[setCurrentMap(newMap)]

[Token(teleportEndName): endCentreX = coordX]
[Token(teleportEndName): endCentreY = coordY]
[NewX = endCentreX + offsetCentreX]
[NewY = endCentreY + offsetCentreY]

[h:'<!--The pause is necessary, or the new coords wont be set-->']
[Text = "Entering map: "+newMap]
[pause("Text")]

[moveToken(NewX, Newy , 1 )]
[goto(currentTok)]
[abort(0)]
};{}]
}]

Locked

Return to “Drop-In Macro Resources”