Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Use roll result in different macro spot

Hi all, I've a macro where the player has to select on which Pokemon he is trying to do something. The chosen pokemon has to be used in different location for other calculation. I need to store, during the macro process, the result of the first pick so I can use it in the other places, instead of make the player pick the same pokemon lot of times. using pseudocode, is like set pokemon = ?{Pokemon|pkmn1|pkmn2|pkmn3} echo Trainer ha make [[pokemon]] fight and it done [[[[@{[[pokemon]]|strength} + @{[[pokemon]]|dexterity}]]d6>4]] damage There is a possibility to do something like this?
1586191019
GiGs
Pro
Sheet Author
API Scripter
in theory yes, but you cant do this @{[[pokemon]]|strength} Attribute calls cannot be constructed from their parts, they must always be used in full. The way to do this would be like this: set pokemon = ?{Pokemon| pkmn1, Trainer ha make @{pkmn1|character_name} fight and it done [[@{pkmn1|strength} + @{pkmn1|dexterity}]]d6>4]] damage| pkmn2, Trainer ha make @{pkmn2|character_name} fight and it done [[@{pkmn2|strength} + @{pkmn2|dexterity}]]d6>4]] damage| pkmn3, Trainer ha make @{pkmn3|character_name} fight and it done [[@{pkmn3|strength} + @{pkmn3|dexterity}]]d6>4]] damage} Within a query, you can put a line break at each |, to make it easier to read (dont do this in attributes, though). In each row, whatever is to the left of the comma is what's displayed to the player in the dropdown, and whatever is the right is what the macro actually sends to chat.
Ok, I think I understood this. And if also strength and dexterity are result of some dropdown? I can put a macro (or a query) in there?
1586346843
GiGs
Pro
Sheet Author
API Scripter
If you're asking if you can put a query inside a query, you can but it gets very complex and is better avoided. See here:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> Can you describe what you specifically want to do?
1586700555

Edited 1586700646
I can try to explain. English is not my main language, so I hope to be understandable. Every trainer has six pokemon with himself, they are attributes of the character sheet called: @{pokemon_slot_1} @{pokemon_slot_2} etc. In addiction, every pokemon have his own character sheet that has the same name of pokemon itself. So, to make it easy: Ash have six pokemon, Pikachu, Squirtle, Charizard, Bulbasaur, Tauros and Pidgeot. They are attribute of his characer sheet as attributes @{pokemon_slot_1} = Pikachu @{pokemon_slot_2} = Squirtle, etc... Every pokemon have is own character sheet, so Pikachu has is sheet with his own attributes. I've an ability of the trainer that work on some attribute of his pokemon, to make them gain some extra exp point. Now the ability is a modified version , because I make it use some attribute of the trainer instead of the pokemon and, the pokemon attribute I really need i write in a text query /desc **@{character_name}** allena il suo **?{Pokemon|@{pokemon_slot_1}|@{pokemon_slot_2}|@{pokemon_slot_3}|@{pokemon_slot_4}|@{pokemon_slot_5}|@{pokemon_slot_6}}**, questo guadagna [[[[?{Sociale| Tough,@{tough}| Cool,@{cool}| Beauty,@{beauty}| Smart,@{smart}} + ?{Abilità| Fight,@{fight}| Survival,@{survival}| Contest,@{contest}| Knowledge,@{knowledge}} - ?{Disobedience|0} + ?{Aiuto|0}]]d6&gt;4]] punti esperienza It's a bad rework because, in real, i need that at least Disobedience it's taken automatically from the pokemon character sheet from the attribute with the same name @{Pikachu|disobedience} So I need that I could do something like /w gm **@{character_name}** allena il suo ?{Pokemon| @{pokemon_slot_1}, **@{pokemon_slot_1}**, questo guadagna [[[[?{Sociale|Tough,@{tough}|Cool,@{cool}|Beauty,@{beauty}|Smart,@{smart}} + ?{Abilità|Fight,@{fight}|Survival,@{survival}|Contest,@{contest}|Knowledge,@{knowledge}} - @{@{pokemon_slot_1}|disobedience} + ?{Aiuto|0}]]d6&gt;4]]| @{pokemon_slot_2}, **@{pokemon_slot_2}**, questo guadagna [[[[?{Sociale|Tough,@{tough}|Cool,@{cool}|Beauty,@{beauty}|Smart,@{smart}} + ?{Abilità|Fight,@{fight}|Survival,@{survival}|Contest,@{contest}|Knowledge,@{knowledge}} - @{@{pokemon_slot_1}|disobedience} + ?{Aiuto|0}]]d6&gt;4]] } But @{@{pokemon_slot_1}|disobedience} give me some errors like No attribute was found for @{Ash|@{pokemon_slot_1} No character was found for 'pokemon_slot_1' This is the easiest, but also the one is most used :)
1586700777
GiGs
Pro
Sheet Author
API Scripter
You cannot do this in roll20: @{@{pokemon_slot_1}|disobedience} Attributes cannot be built up from parts, because of roll20's order of operations: attribute calls happen before putting parts together.&nbsp;
Ok, that is no way to work around the problem with a "dirty solution"? :)
1586705324
GiGs
Pro
Sheet Author
API Scripter
No, the only way is what i said earlier in the thread - making queries that include the full name of the attribute call. Unfortunately since you already have one query, you would need to nest a second query within it, and that way lies madness - or at least learning about html entities.&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> It looks like you already have a query within a query, so you'll need to look at that anyway.