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

Script Request

I don't think this is something that can be done with a macro. I track reputation in my game, I would like a script that when the player makes a query via the script it will whisper to them an answer based on a rollable table. For example. PC Reputation -30 (stored in a Character Sheet not visible by players, I update an attribute field manually) If Reputation is between 0 and -30 - Whisper to player "People think you are a [rollable table1 result] If Reputation is between -30 and -60 - Whisper to player "People think you are a [rollable table2 result] etc.
Hi Kunguru - this sounds like something that would be very good for an API. I'd be happy to help you with it. Are you looking to write it yourself with some assistance, or just for someone else to write it for you? You can PM me on these forums or respond here.
I've found Java code that I think can be manipulated into what I want, but I don't really have an idea of how to get started, or what some of the code means. In the code it looks like you have to manually enter the test score into the code, where I would prefer to either take it from a character sheet, or preferably handout GM notes. class IfElseDemo { public static void main(String[] args) { int testscore = 76; char grade; if (testscore >= 90) { grade = 'A'; } else if (testscore >= 80) { grade = 'B'; } else if (testscore >= 70) { grade = 'C'; } else if (testscore >= 60) { grade = 'D'; } else { grade = 'F'; } System.out.println("Grade = " + grade); } }
1429104494
The Aaron
Pro
API Scripter
Just a point of clarity, the API is in Javascript, not Java. The two are very unfortunately similarly named, where in actuality about they only thing they have in common is a C-Style syntax. Let me try and boil down what you want, with the intent that the community can provide you a solution: Each Player's Character will have a reputation score Reputation will change throughout the game Reputation will be managed by you Reputation has a range from -??? to +??? Each Player will be able to get a feel for their reputation based on the result of an API Command A table will be used to provide descriptions for a given range of reputation Players will be able to check the reputation of only their characters? Here's some thoughts on how I think the above would work best in the API: Make several tables named "Reputation [##:##]" where the ## are replaced with the high and low end for the scores it represents Track the reputation in the state object ideally. Putting it as attributes on the character means they could look at the attribute. You could store it as attributes on a Reputation character, with the name of the attribute being the Character Name, the value being the reputation and the max being the character_id. That would have the advantage that you could load that Reputation character and modify the scores directly. Provide a command for setting reputation for a character, support + and - prefixes for adjusting up and down relative to the current score Provide a command for checking the reputation of a character. Players could use this with their character "!rep @{Rook|character_id}" to get the phrase whispered to them. You could optionally provide a command that adds the description tables, or adds rows to them.
1429106172
Ziechael
Forum Champion
Sheet Author
API Scripter
Not going to be able to add much here as I am but a javascript admirer but from personal experience the best way to have a number tied to a character but keep it secret is to have it as one of the 'bubbles' with 'see' and 'edit' both unticked so that the players can't see it but you can. The drawback is the essential waste of a valuable bubble but it would do the job...
If The Aaron's write up is accurate, I can whip up something pretty quick. To help you implement and debug, you might want to invite me to a copy of your campaign and set me as a GM. Don't post the link in the forums, instead send it via private message.
Joshua Let me create a few tables first, so you have something to work with. I will then send you an invite
I stand ready!