thats quite some vital info: problem solved!! (I delete the doors and it worked fine)!
Note I did that in the 'BoT' version. Valid question remains: why! I'll post this with the devs.
Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice
thats quite some vital info: problem solved!! (I delete the doors and it worked fine)!
Well I was going to do that...not fast enough ^^
I can imagine, note that that should not happen, unless the door tokens are massive in size and slorping up all memory, did you check?
Code: Select all
_______
| |
| ====|
|_______|
Code: Select all
[h:comPad = "centreOnMePad " + newLoc]
Code: Select all
[h:comPad = "centreOnMePad" + newLoc]
Code: Select all
[newResult = json.append(newResult, json.set("{}", "map", map, "spot", spot))]
Code: Select all
[newResult = json.append(newResult, json.set("{}", "map", map, "spot", " " + spot))]
Code: Select all
[h,FOREACH(tok, selected),if(oldMap != newMap): moveTokenFromMap(tok, oldMap, X+roll.count, Y)]
[h:setCurrentMap(oldMap)]
Code: Select all
[h, if(selCount == 1), CODE: {
[h,FOREACH(tok, selected),if(oldMap != newMap): moveTokenFromMap(tok, oldMap, X+roll.count, Y)]
[h,FOREACH(tok, selected),if(oldMap == newMap): moveToken(X+roll.count, Y, 0, tok)]
[h:setCurrentMap(oldMap)]
};{
}]
Code: Select all
[h:'<!------------------------------------- switchMap ([mapName[, players]]) ------------------------------------------------>']
<!-- The argument players must be either a list of player names or 1 to select ALL players -->
<!-- <html> Forces ALL clients to chosen map AND centres view on the token <i>centreOnMePad</i> <br><br>If you select tokens before you use this macro, then the option will be added to move<br>the selected tokens to the new map as well. These tokens will be placed near the <i>centreOnMePad</i><br><br>If there is no <i>centreOnMePad</i> then the coords (X,Y) 0,0 will be used instead.
-->
[h:assert(isGM(),"This macro can only be run by the GM",0)]
[h:mapList = listSort(getAllMapNames(),"N+")]
[h:comLocations = getLibProperty("centreOnMePads", "lib:EventMacros")] <!-- centre on me pad locations -->
[h:locationList = ""]
[h,foreach(location, comLocations,"<br>"), CODE:{
[map = json.get(location, "map")]
[spot = json.get(location, "spot")]
[locationList = listAppend(locationList, if(spot != "", map + " - " + spot,map))]
}]
[h:oldMap = getCurrentMapName()]
[h:allPlayers = getAllPlayerNames()]
[h,if(argCount() > 0): newMap = arg(0) ; newMap = oldMap]
[h:assert(listFind(mapList, newMap) != -1, "The map "+arg(0)+" does not exist",0)]
[h,if(argCount() > 1), CODE:{
<!-- in case both arguments have been given, the input can be omitted and the players can be switched to the map -->
[userList = arg(1)]
[if(userList == 1): userList = getAllPlayerNames()]
<!-- move players -->
[playerList = ""]
[FOREACH(player, userList), if(listContains(allPlayers, player)): playerList = listAppend(playerList, player) ; broadcast("The player: "+player+" does not exist!")]
[selCount = 0]
''
};{
<!-- in case one or no arguments have been given, show the input and ask for map and players to switch map for -->
<!-- make sure that at least the current map is part of the comLocation, if not rescan -->
[if(listFind(locationList, oldMap) == -1), CODE:{
[bot_CoMScan()]
[comLocations = getLibProperty("centreOnMePads", "lib:EventMacros")] <!-- centre on me pad locations -->
[locationList = ""]
[foreach(location, comLocations,"<br>"), CODE:{
[map = json.get(location, "map")]
[spot = json.get(location, "spot")]
[locationList = listAppend(locationList, if(spot != "", map + " - " + spot,map))]
''
}]
''
};{}]
[newMap = listFind(locationList, newMap)]
[userList = allPlayers]
[selected = getSelectedNames()]
[selCount = listCount(selected)]
<!-- input string -->
[ inputStr = "junk|<html><b>Force Selected Players to Map<br></html>|-|LABEL|SPAN=TRUE"]
[ inputStr = listAppend(inputStr, "newMap|"+locationList+"|Select map|RADIO| SELECT="+newMap,"@")]
[if(selCount): inputStr = listAppend(inputStr, "selCount|1|<html><b>Move selected token(s)?</b></html>|CHECK","@")]
[if(selCount): inputStr = listAppend(inputStr, "junk|<html>("+selected+")<br> </html>|-|LABEL|SPAN=TRUE","@")]
[ inputStr = listAppend(inputStr, "junk|<html><b>Select Players<br></html>|-|LABEL|SPAN=TRUE","@")]
[FOREACH(player, userList): inputStr = listAppend(inputStr, "player"+roll.count+"|1|"+player+"|CHECK","@")]
[ inputStr = listAppend(inputStr, "junk|<html><b>Res-scan all maps for new locations<br></html>|<html>When checked this macro will scan ALL maps looking for<br>tokens that are called <i>centrOnMePad Some Location Name</i><br>and adds <i>Some Location Name</i> to the above list of locations<br>when you choose that location the map will be centred around<br><i>that</i> pad. Obviously <i>Some Location Name</i> can be any<br>alphanumerical string you like!<br></html>|LABEL|SPAN=TRUE","@")]
[ inputStr = listAppend(inputStr, "rescan|0|Re-scan|CHECK","@")]
<!-- ask for input-->
[abort(eval(listFormat(inputStr, "input( %list )", " ' %item ' ", ",", "@")))]
<!-- move players -->
[playerList = ""]
[FOREACH(player, userList), CODE:{
[if(eval("player"+roll.count)): playerList = listAppend(playerList, player)]
''
}]
''
}]
<!-- get new map and location -->
[h:newLocation = json.get(comLocations, newMap)]
[h:newMap = json.get(newLocation, "map")]
[h:newLoc = json.get(newLocation, "spot")]
[h:comPad = "centreOnMePad" + newLoc]
<!-- move tokens (if any) -->
[h:setCurrentMap(newMap)]
[h,if(findToken(comPad)!=""), CODE:{
[X = getTokenX(0, comPad)]
[Y = getTokenY(0, comPad)]
};{
[X = 0]
[Y = 0]
}]
[h,if(rescan): bot_CoMScan()]
[h, if(selCount == 1), CODE: {
[h,FOREACH(tok, selected),if(oldMap != newMap): moveTokenFromMap(tok, oldMap, X+roll.count, Y)]
[h,FOREACH(tok, selected),if(oldMap == newMap): moveToken(X+roll.count, Y, 0, tok)]
[h:setCurrentMap(oldMap)]
};{
}]
[h:bot_execAllPlayers("gotoMap@lib:OnTokenMove",json.append("[]",newMap,newLoc), playerList)]
Code: Select all
<!-- scan all maps looking for centreOnMePads -->
[h:result = replace(json.indent(bot_seekToken(1,"centreOnMePad",'["TOKEN", "HIDDEN", "OBJECT", "BACKGROUND"]', getAllMapNames(),0,1),2),"centreOnMePad", "")]
<!-- initiate end result json array -->
[h:newResult = "[]"]
<!-- build json array with each map and map-location build up -->
[h,foreach(map, result), CODE:{
[locations = json.get(result, map)]
[newResult = json.append(newResult, json.set("{}", "map", map, "spot", ""))]
[foreach(spot, locations),if(spot != ""), CODE:{
[newResult = json.append(newResult, json.set("{}", "map", map, "spot", " " + spot))]
}]
}]
<!-- store end result in lib:eventmacros -->
[h:setLibProperty("centreOnMepads", json.sort(newResult,"spot", "map"), "lib:EventMacros")]
VBL on tokens isn't laggier than the regular VBL. Auto-generated VBL on tokens can be because it ends up with a huge number of points defining the polygon.RicoTheBold wrote: ↑Sat Nov 30, 2019 12:32 amAlso, thanks for the heads-up in this thread that on-token VBL is laggier than other VBL. I don't seen any open issues about that on github, so I would never have known that was specifically an thing to be aware of.
Oh, cool. That makes sense; thanks for the clarification. Most of my token VBL is hand-drawn anyway. I mostly have been drawing VBL onto maps from a Pathfinder Adventure Path and then transferring it to the background tokens in case I screw up and accidentally move them, so it's good to know that's not any worse than leaving it on the map by itself. It does sound like I should revisit my door tokens like the other poster, but that's easy enough.