OLD Wolph42's 'Drop-in' Bag of MT Tricks OLD
Posted: Fri Sep 10, 2010 10:31 am
Discussion and Support
https://forums.rptools.net/
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!wolph42 wrote:jfrazierjr wrote:Also, perhaps you could create a "trap" builder macro....
_˅_
. |
¯¯¯
<hmpfff>plothos wrote:Hey, didn't you know? Doing something only proves you can do more stuff!wolph42 wrote:jfrazierjr wrote:Also, perhaps you could create a "trap" builder macro....
_˅_
. |
¯¯¯
Well heck.. if my patch is a problem, perhaps I should take it out.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
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.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.
Yes that is a problem... o thee twister of words...jfrazierjr wrote:Well heck.. if my patch is a problem, perhaps I should take it out.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
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.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.
There is another post here with multimap support. So that's also already done. I'll update the first post later.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
[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)]
};{}]
}]