How to make a macro execute another macro?
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.
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.
Re: How to make a macro execute another macro?
Dropbox is ok. Translation not necesary as long as you give pointers on how to reproduce.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How to make a macro execute another macro?
Ok that's the point
As I said before there is a Token that allow me to "see" the spell on the map... the one called "Aura Debilitante" that have a green skull icon.
This is how the macro should work.
1. Select the token
2. once you click on the macro the following should happen.
- The property "Turni" of the token should be set to turni-1
- other property of the token should be set on another token named "AuraTemp". This token will be used to check attack status of the spell vs defence status of the enemies. I used that to have a "fixed" name to recall property from.
- The macro should now select all the token in the area of effect and then all the "friendly" token should be suddenly deselected (friendly tokens are setted using the status "Amico")
- Now the macro should compare "Penetrazione Spirituale" of the spell with "AssSpiFigura" of the selected enemies. If "Penetrazione Spirituale" >= "AssSpiFigura" then the damage (previously setted on "AuraTemp" token) is dealt to the target.
I hope this is clear. If is not i will try to explain better.
This is the map i was using to test the macros:
https://www.dropbox.com/s/94q2s4kty22ln ... rpmap?dl=0
And this is the cmpgn file:
https://www.dropbox.com/s/mwdk67gvmdvy1 ... cmpgn?dl=0
The game is a game I am developing and is not yet published ^_^
I forgot to say a couple of things before:
I have Windows 8.1 with Java latest version (both 32bit and 64bit) installed and I am using Maptool ver. 1.3.b89
As I said before there is a Token that allow me to "see" the spell on the map... the one called "Aura Debilitante" that have a green skull icon.
This is how the macro should work.
1. Select the token
2. once you click on the macro the following should happen.
- The property "Turni" of the token should be set to turni-1
- other property of the token should be set on another token named "AuraTemp". This token will be used to check attack status of the spell vs defence status of the enemies. I used that to have a "fixed" name to recall property from.
- The macro should now select all the token in the area of effect and then all the "friendly" token should be suddenly deselected (friendly tokens are setted using the status "Amico")
- Now the macro should compare "Penetrazione Spirituale" of the spell with "AssSpiFigura" of the selected enemies. If "Penetrazione Spirituale" >= "AssSpiFigura" then the damage (previously setted on "AuraTemp" token) is dealt to the target.
I hope this is clear. If is not i will try to explain better.
This is the map i was using to test the macros:
https://www.dropbox.com/s/94q2s4kty22ln ... rpmap?dl=0
And this is the cmpgn file:
https://www.dropbox.com/s/mwdk67gvmdvy1 ... cmpgn?dl=0
The game is a game I am developing and is not yet published ^_^
I forgot to say a couple of things before:
I have Windows 8.1 with Java latest version (both 32bit and 64bit) installed and I am using Maptool ver. 1.3.b89
Re: How to make a macro execute another macro?
really ?!? you have what... 15 maps??1. Select the token
you need to do a better job than that.
1. go to map ?
2. select the token called ?? on layer ??
3. go to panel ??
4. here you find a macro called ??
5. click it, the following *should* happen: ?? but doesn't?
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How to make a macro execute another macro?
Maybe I am getting wrong but you seem upset... Remember that I am new to maptool... actually I started using it something like 10 days ago...
2. select the token called ?? on layer ??
It's in the Token layer
If you don't here is the code (that I already provided before)
I also tried to launch macro from the global panel using the macro (in the global panel) called This is the macro!!!
This macro have Auto Execute enabled and apply to selected token disabled
I linked one map... how it happen that you see like 15 maps...?really ?!? you have what... 15 maps??
That's what I am trying to do... learn to do better...you need to do a better job than that.
The map is the same that I linked and is named "Cave01"1. go to map ?
2. select the token called ?? on layer ??
Kurghoth wrote:As I said before there is a Token that allow me to "see" the spell on the map... the one called "Aura Debilitante" that have a green skull icon.
It's in the Token layer
In global panel you should find a macro called "Aura Debilitante"3. go to panel ??
4. here you find a macro called ??
If you don't here is the code (that I already provided before)
Code: Select all
[macro("Next@lib:debilitante"): ""]
[macro("Target@lib:debilitante"): ""]
[macro("Calcola@lib:debilitante"): ""]
Code: Select all
[macro("RidTurni@Global"): ""]
[macro("SelTarget@Global"): ""]
[macro("CalcoloDanni@Global"): ""]
I tried to explain better than I can how the macro should work... step by step... if I launch the macros from global panel one by one everything work fine but if I try to launch them from the lib:debilitante or from the global panel using [macro:()] I keep getting the error that I already mentioned before:5. click it, the following *should* happen: ?? but doesn't?
I apologize if I haven't been clear enough... I am really doing my best to explain and learn. I know something about "coding" from VBA and here is almost everything new for me...Error in body of roll.
Statement options (if any): macro("Next@lib:debilitante")
Statement Body : ""
Re: How to make a macro execute another macro?
Ok there is quite some stuff going on. First of all: see the link in my sig the big one ("getting started") and check it out. You are REALLY missing a LOT of stuff which results in these kinds of issues. Especially check out 'debug tutorial'
a few things:
1. did you notice the 'select map' in the upper right? that in combination with 'map menu'. Your campaign file is a mess and contains lots of maps with the same name: thats a disaster waiting to happen. So clean that up first. (e.g. two maps with the same lib:token name on them will send things haywire)
2. Global macros are linked to your pc. I never use them. You should move them to the campaign panel.
3. When someone is willing to have a look at your campaign file, it is custom to present the campaign file *including* (that is imported into the campaign file) and then with the above steps so it can be recreated AND state what the *problem* is. You gave a description of what it *should* do, but not of what goes wrong.
4. I've tried the macro (loaded it into the campaign macro and turned on 'apply to selected token' and I got no errors. It worked.
The 'turni' was lowered by 1. Tokens were NOT selected, is that the problem??
a few things:
1. did you notice the 'select map' in the upper right? that in combination with 'map menu'. Your campaign file is a mess and contains lots of maps with the same name: thats a disaster waiting to happen. So clean that up first. (e.g. two maps with the same lib:token name on them will send things haywire)
2. Global macros are linked to your pc. I never use them. You should move them to the campaign panel.
3. When someone is willing to have a look at your campaign file, it is custom to present the campaign file *including* (that is imported into the campaign file) and then with the above steps so it can be recreated AND state what the *problem* is. You gave a description of what it *should* do, but not of what goes wrong.
4. I've tried the macro (loaded it into the campaign macro and turned on 'apply to selected token' and I got no errors. It worked.
The 'turni' was lowered by 1. Tokens were NOT selected, is that the problem??
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How to make a macro execute another macro?
I will ^_^Ok there is quite some stuff going on. First of all: see the link in my sig the big one ("getting started") and check it out. You are REALLY missing a LOT of stuff which results in these kinds of issues. Especially check out 'debug tutorial'
I cleared the map section... now i only have the map needed... there is one think I don't understand... as long as I need the same macro on all the maps, do I have to change the lib:token on each map? or i have to keep one map at time in my campaing file so the name of the lib token is unique? is this explained on your tutorial? if it is i will learn from that1. did you notice the 'select map' in the upper right? that in combination with 'map menu'. Your campaign file is a mess and contains lots of maps with the same name: thats a disaster waiting to happen. So clean that up first. (e.g. two maps with the same lib:token name on them will send things haywire)
I used Global to let player use the campaign macros... is it better if i give macros to player tokens and move the global macro to campaign macro?2. Global macros are linked to your pc. I never use them. You should move them to the campaign panel.
I apologize... I thought I was been clear. If I wasn't I will try to do better next time.3. When someone is willing to have a look at your campaign file, it is custom to present the campaign file *including* (that is imported into the campaign file) and then with the above steps so it can be recreated AND state what the *problem* is. You gave a description of what it *should* do, but not of what goes wrong.
My problem is that the macro don't even start because i get that error:4. I've tried the macro (loaded it into the campaign macro and turned on 'apply to selected token' and I got no errors. It worked.
The 'turni' was lowered by 1. Tokens were NOT selected, is that the problem??
Code: Select all
Error in body of roll.
Statement options (if any): macro("Next@lib:debilitante")
Statement Body : ""
Edit:
I checked Apply to selected token and now seems to work again. It also deal damage where it is necessary. Is it possible that the problem was the mess with the thousand map imported?
Re: How to make a macro execute another macro?
a lib:token is accessible from ALL maps. So make sure it has a UNIQUE name. Also (as general advise) make sure that all your lib:tokens are on one map (so you can easily find them).I cleared the map section... now i only have the map needed... there is one think I don't understand... as long as I need the same macro on all the maps, do I have to change the lib:token on each map? or i have to keep one map at time in my campaing file so the name of the lib token is unique? is this explained on your tutorial? if it is i will learn from that
'Global' means from YOUR pc usealbe for ANY (global) campaign file. (As they are linked to your pc) no matter which campaign file is loaded.I used Global to let player use the campaign macros... is it better if i give macros to player tokens and move the global macro to campaign macro?
'Campgaign' means it linked to the CAMPAIGN file, hence accessible to everyone who has loaded (or is connected to) the campaign file. (Note to turn on 'allow players access to campaign macros').
The only time I got an error was when nothing was selected (or apply to selected was turned off).My problem is that the macro don't even start because i get that error:
my advise is to use the following at the start of the macro:
Code: Select all
[toks = getSelectedNames()]
[assert(listCount(toks) == 1, "Make sure (only) one token is selected",0)]
[switchToken(toks)]
OR
Code: Select all
[toks = getSelectedNames()]
[foreach(tok, toks), CODE:{
[switchToken(tok)]
<!-- your code here -->
}]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How to make a macro execute another macro?
The code you provided has to go into the macro that call the lib:token macros? I tried to put in there and to switch off the "apply to selected token" but it give me the same error... anyway if i just keep the "apply to selected token" on everything just work fine... now i will have to improve the macro to make this routine happen for any Aura spell on the map...
New challenge for me but now i have instruments to understand better...
By the way... even if I didn't realize that... i was just studying with your tutorial... my browser open with this page:
http://lmwcs.com/rptools/wiki/Main_Page
Just one last question:
I don't want to know how because I am afraid it will be a mess until i learn more things... but... is it possible to make a PC token summon a NPC token?
New challenge for me but now i have instruments to understand better...
By the way... even if I didn't realize that... i was just studying with your tutorial... my browser open with this page:
http://lmwcs.com/rptools/wiki/Main_Page
Just one last question:
I don't want to know how because I am afraid it will be a mess until i learn more things... but... is it possible to make a PC token summon a NPC token?
Re: How to make a macro execute another macro?
The code indeed goes to lib:token macros.
You also might want to check out the bag of tricks by then (as it has a macro 'summon token' on it).
yes. and vice versa for that matter. You might want to make sure that 'allow players to edit macro' is turned OFF in your macros!I don't want to know how because I am afraid it will be a mess until i learn more things... but... is it possible to make a PC token summon a NPC token?
You also might want to check out the bag of tricks by then (as it has a macro 'summon token' on it).
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: How to make a macro execute another macro?
Ok... thanks for the help and again... sorry for I haven't been clear enough...