setCurrentMap and execlink

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
luciferleftwing
Kobold
Posts: 4
Joined: Fri Sep 27, 2013 6:11 pm

setCurrentMap and execlink

Post by luciferleftwing »

hi i'm trying to create some macros to set a spwn point of sort for when my players connect to the server

the idea is to save a mapname zoomlevel and token name (that i will call "center token" from now on) into a library and then using onCampaignLoad
to enforce that as a starting position

the problem being that i need the setCurrentMap to take effect before i set zoom e center the screen around the "center token"

i've tried usig execlink with defer and a wait cycle but to no avail, in fact if i have setcurrentmap the macro in execlink is not executed at all
removing the setcurrentmap will result in the correct execution of the execlink.

is there any way to specify in wich order different oncampaignload macros should be executed or something similar?

thank you in advance and i hope this isn't redundant i've tried the search function to no avail.

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

Re: setCurrentMap and execlink

Post by aliasmask »

Your best bet is to chain the commands. So, your setCurrentMap defer will call the setZoom defer Rather than having the defers created in the original macro.

There are certain things that just can't be done well because of timing and when MT needs to redraw something (token,init panel,map) then you can run in to those kind of problems because those things are saved for last. For example, I can change maps, get a property from a token and change the map back and all you'll see is a flicker because only the last map is redrawn.

MT is also particular about onCampaignLoad and changing things on tokens. Here's what I would do.

Can you share your code so I can get a better idea of the details of what you're trying to do. For example, do you move their token to a spawn location or just have a saved location for their token and go to that map and zoom in?

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: setCurrentMap and execlink

Post by JamzTheMan »

I can't believe I'm beating Wolph42 but....

His BoT has all that built in. :) It'll save you time.

He has a "Start map" that forces clients to this map/coords on start. And if you put a token called CentreOnMe (IIRC) and enable the option, any map will center to that token. (There's a function to 'move' pc tokens from map to map and it moves them to this token).

Anyhoo, ya, get the bot. Love the bot. use the bot. Save your time for coding other non-bot functions! :mrgreen:
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork


luciferleftwing
Kobold
Posts: 4
Joined: Fri Sep 27, 2013 6:11 pm

Re: setCurrentMap and execlink

Post by luciferleftwing »

i'll try the BOT, and a bit of self restraint the last time i used it i got carried away with the cool things and some players with coal powered pc had great performance issues

thats why i started building a minimalistic framework much much smaller than the BOT.

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

Re: setCurrentMap and execlink

Post by wolph42 »

last few times i've rebuild the bot so that it can be used in a minimalistic way, by turning features on and of. But yes, use it in its full glory and you will notice it.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: setCurrentMap and execlink

Post by JamzTheMan »

Yea... self-restraint is going to be needed, unless you want to buy everyone Core-I7's with 32gb ram. :-)
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

taustinoc
Dragon
Posts: 516
Joined: Mon Aug 03, 2015 6:30 pm

Re: setCurrentMap and execlink

Post by taustinoc »

JamzTheMan wrote:Yea... self-restraint is going to be needed, unless you want to buy everyone Core-I7's with 32gb ram. :-)
That's only $1,300, you know. (I just got a quote for work on exactly that from Dell.)

Post Reply

Return to “MapTool”