Advertisement Create a free account

Help with setting up the ammo api on the darker dungeon sheet

1562690949

Edited 1562694561
Dark
Pro
Im not very good with these things and im trying to make where i can use the ammo API to help the party track the food and water they have. Every time i try to do it it fails or disables the APIs all together. I would like to make where they can go to their wagons inventory and click a button to remove one ration or more and if possible add more when they get more.  If this is not the place to post this please tell me where i can get help
1562691899
Scott C.
Pro
Sheet Author
API Scripter
This is the right forum for API questions, unfortunately I'm just not familiar with the sheet you're using. I'll try to take a look when I get a chance to hop on an actual computer instead of my phone.
1562692008
Dark
Pro
Thank you any help would be very much welcomed as i am pulling my hair out
1562698367
The Aaron
Forum Champion
API Scripter
Can you post the error that occurs when you try to use it?  Also, what command you are supplying. 
1562713068
Dark
Pro
im sorry i dont know the error code as i have reset it. if there is away for me to find it again i will. i was trying to make it where food would be "ammo" but when i pu the command on the main thing " !ammo <id> <attribute> <amount> [resource name]"it says is it can not find the name of the thing i am trying to add in  attributes so i add it and then it API stops or i enter it and nothing happens.   im 110% sure i am doing something  wrong all im trying to do is make where food and water would count as "Ammo" so when they use the attack it would take 1 away. I am very bad things like this so if you explain something back to me tell me like ima child lol
1562715557
GiGs
Pro
Sheet Author
Are you entering this specific text? !ammo <id> <attribute> <amount> [resource name] Or are you changing the words to match your character and sheet? For example,  !ammo @{selected|character|id} food -1 Food This will subtract 1 from an attribute called food on the selected character, if it exists, and use "Food" as a label when reporting it. You'll have to find the attribute names your sheet uses for food and water.
1562716326

Edited 1562716367
Dark
Pro
Yes i use that and i had to add it in my self (if i did it right) nothing happened !ammo @{selected|character|id} food -1 Food
1562717877
GiGs
Pro
Sheet Author
If you're using the 5e Darker Dungeons sheet, there is no attribute on the sheet named food. You'll have to find what the attribute is named. Open the character sheet, select the attribute, press F12 to bring up a sidebar and look for the text "attr_" nearby. Whataver is after that will be the name. If it's in a repeating section, it gets a lot more complicated.
1562728848
Dark
Pro
i think im just going to do it the hard way so i don't break my game. I have very little understanding of coding and this stuff. i thank you very much for trying to help me.
1562729364

Edited 1562729396
The Aaron
Forum Champion
API Scripter
There is a typo in that command, should be: !ammo @{selected|character_id} food -1 Food
1562731289

Edited 1562732392
Dark
Pro
Heyyyy that worked Thank you! now is there a way for me have that as an attack on the sheet so the players can click that attack so i dont have to do it every time or if some kind of way that it can be placed in a macro where they dont have to select the token every time 
1562766903
GiGs
Pro
Sheet Author
Sorry about that typo! It's a day for oops :)
1562770525
The Aaron
Forum Champion
API Scripter
You could put it in a macro, just replace selected with the character's name, or the whole argument with the character is (which you can get by: /w gm @{selected|character_id} ).  Putting it in an attack will depend on the character sheet. Macro is probably the easiest. 
1562771344
Scott C.
Pro
Sheet Author
API Scripter
In the macro, you don't even need to specify the character I'd, you can just put @{character_id} in that part of the ammo command. Then it's easily copyable to multiple sheets.
1562771546

Edited 1562771613
The Aaron
Forum Champion
API Scripter
Scott C. said: In the macro, you don't even need to specify the character I'd, you can just put @{character_id} in that part of the ammo command. Then it's easily copyable to multiple sheets. Scott means in a Character Ability on the Attributes and Abilities tab of a Character. In a Macro (in the Collections tab of the game), you can't omit the character name...
1562771881
Scott C.
Pro
Sheet Author
API Scripter
Heh, true, I tend to ignore global macros for anything character related.
1562803461
Dark
Pro
Thank you guys sooo much i got it to work:D
1562813346
The Aaron
Forum Champion
API Scripter
Cool. =D