Page 1 of 1

setCurrentMap and execlink

Posted: Wed Sep 27, 2017 10:28 am
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.

Re: setCurrentMap and execlink

Posted: Wed Sep 27, 2017 11:59 am
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?

Re: setCurrentMap and execlink

Posted: Wed Sep 27, 2017 8:40 pm
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:

Re: setCurrentMap and execlink

Posted: Thu Sep 28, 2017 3:19 am
by wolph42
:) (link in sig)

Re: setCurrentMap and execlink

Posted: Thu Sep 28, 2017 8:04 am
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.

Re: setCurrentMap and execlink

Posted: Thu Sep 28, 2017 10:11 am
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.

Re: setCurrentMap and execlink

Posted: Thu Sep 28, 2017 11:21 am
by JamzTheMan
Yea... self-restraint is going to be needed, unless you want to buy everyone Core-I7's with 32gb ram. :-)

Re: setCurrentMap and execlink

Posted: Thu Sep 28, 2017 12:58 pm
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.)