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

Battle system

1392872349

Edited 1392872417
Hey guys and girls, I have a really big task for the API and I'm not sure if it's possible. I don't know javascript so I won't be able to contribute to well if help is needed. Pretty much the way it needs to work is the selected token rolls for an attack value against a target token who is prompted to roll for a defense value. The two totals are then subtracted and the final result displayed (negative or positive). I have an 3 different attack macros (Melee Range, Long Range, and Magic Attacks) and a four defense macros (Dodge, Parry, Def, and Magic) so when the player is prompted they are gonna need to just input the macro because different attacks require different defenses and there are a lot of variables and attributes involved in the roll. I hope I'm explaining this well. If more information is needed or questions I will try to answer the best I can. Thanks.
Not entirely sure if you can prompt another player for something within the limits of Roll20. Anyone more experienced who can weigh in?
1392877220
Lithl
Pro
Sheet Author
API Scripter
You cannot create pop-up boxes or anything like that, but you could send a whisper via the API instructing the other player to enter a command or hit a certain macro button.
1392886458

Edited 1392886553
Alex L.
Pro
Sheet Author
So in this system, the targeted player selects the defence? You could whisper the target player then change their token actions to be the options (changing them back once done) by doingthis you could include some sort of unique ID to prevent problems when multiple attacks get made. Maybe even put an aura around the token.
Could you force a ?{Select Defense} variable window to pop up on a client side? Then you could just read the variable from the player and send it back to the script.
1392897362
Alex L.
Pro
Sheet Author
Erik G. said: Could you force a ?{Select Defense} variable window to pop up on a client side? Then you could just read the variable from the player and send it back to the script. No
So basically Battle goes as follow: On players turn they select how they are attack which determines what attributes they roll and gain bonuses from and target an enemy (NPC or Player). The target then chooses their defense which determines what attributes they roll and gain bonuses from. The two totals are subtracted which determines the total damage (or lack of) the target receives. Is there any type of API that can accomplish this? I just made a Damage Calculator macro that asks me what the total attack value is and the total defense value and then outputs the result but I was wonder if there is a way the API can do that for me. Doesn't seem like that's possible for the API to prompt players like that. It would have to be written to the effect of: IF (attack attribute) targets (token) Then (token) (prompt response macro) (attack) - (defense) = Output: Result else return But like I said i don't know javascript nor the API all that well so I'm not sure if that's possible.
1392915884
Lithl
Pro
Sheet Author
API Scripter
The API cannot prompt players, beyond sending them a message to the effect of "Please click your defense-selection macro now."
1392945127
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
You could place a token on the map under the player's control with the token actions you want them to take. A "Select Me" for your action token...