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

NPC Gambling Rolls Macro?

I am trying to create a macro for a poker game in my Old West campaign. I wanted it to look something like this: -The Bluffster [[d20+2]] [[d20+2]] ($50) Bet $ [[d50]] -Pokerface [[d20+4]] [[d20+4]] ($75) Bet $ [[d50]] -My Wife's Money [[d20+1]] [[d20+1]] ($25) Bet $ [[d25]] -Deep Pockets [[d20+3]] [[d20+3]] ($100) Bet $ [[d100]] -The Pro [[d20+5]] [[d20+5]] ($200) Bet $ [[d100]]}} Except I need it to not only make the random roll, but keep track of the running tally of money left for each NPC.For instance, the Bluffster starts with $50, and bets anywhere from $1 to $50 of it for each hand. I want it to show as Bets $ x/50 where the second number (the running total) is then reduced by the amount that was wagered (And that way I can just go in and modify the starting amount for the winner for any future hands, while the others simply lose their money). I hope I am explaining this adequately.
1634117856
Ziechael
Forum Champion
Sheet Author
API Scripter
Without the API (pro subscription perk) your options may be somewhat limited... heres what I'd likely do: Have a token for each gambler linked to a character sheet (no need to fill in any info on the sheet if you don't need it) Input the starting cash as a bar value (bar1 for example) and link that to any attribute on the sheet that isn't in use/needed for that character (we'll use hitpoints in this example) Also add the starting cash as the max for that bar too, handy if you want to reference the starting value in future for calculating percentages if gamblers will quit when down to a certain amount or whatever Change your macro to reference that value: The Bluffster [[d20+2]] [[d20+2]] - Bet $ [[ d@{The Bluffster|hitpoints} ]] / $@{The Bluffster|hitpoints} After each round you'll need to update the bar value with the new amount but can use the minus button to easily do a calculation on it rather than pesky mental arithmetic. It's not as slick as automation but should make manual tracking a lot quicker and easier :)
I set the macro up as you said and linked the tokens to the sheets, but I just keep getting a Syntax error. I attached screenshots.
1634159689

Edited 1634159752
vÍnce
Pro
Sheet Author
"Input the starting cash as a bar value (bar1 for example) and link that to any attribute on the sheet that isn't in use/needed for that character (we'll use hitpoints in this example)" I think you'll need to either pick another attribute that's found on the sheet (but not used), or create a custom attribute(attributes and abilities tab on each character) and use that in your macro instead of "hitpoints".
1634200447
Ziechael
Forum Champion
Sheet Author
API Scripter
Yeah, as Vince says, you'll need to use an actual attribute on your sheet of choice, it looks like you just need to find/replace 'hitpoints' with 'hp' in the macro to reference the attribute you've selected. Again, as Vince says, you don't necessarily have to use that one if you need it (in case of a combat scenario involving those characters too) but the macro does have to reference an attribute on your sheet :)
Using the hp worked nicely for the non-combat NPC's, as I didn't need to keep track of their hp at all. The problem I am running into now, however, is for a main villain who will also be gambling. I do have to track his hp, and I can't figure out another attribute to use instead that tracks as X / X.
1634244787
Ziechael
Forum Champion
Sheet Author
API Scripter
You can make your own :) Head to the attributes and abilities tab and create a new attribute on each sheet called whatever you like: 'cash' for example. Link the bars to this new attribute and set it/the max as before then update the macro to reference that attribute instead of hp, then you can use hp as normal without worrying about it.