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

On Change:Graphic Events: Too Much Demand on Server? And Getting User

1599052622

Edited 1599052835
I'm in the process of setting up a number of On Change events that will capture and record in a token's GM Notes what changes were made to a token and when.  Here is an example code and a screen shot of the result.  Here, I am looking at changes made to bar3_value or "Unit Strength" in this campaign: on("change:graphic:bar3_value", function(obj, prev) { let gm_notes = obj.get("gmnotes"); if (gm_notes !== "") {gm_notes += "<br>";} gm_notes += "Strength: " + prev["bar3_value"] + " --> " + obj.get("bar3_value") + " " + new Date(); obj.set("gmnotes", gm_notes); }); The above adjusts the GM Notes just fine: I am currently planning to do this for bar2 and bar1 as well as token name and when status markers are changed.  Possibly some other values. Question 1: Is tracking a number of these changes too much of a drain on the roll20 server as far as traffic goes?  Will it slow the game appreciably, especially for friends with low end computers?  Question 2: How can I draw the user id (ultimately I will use that for the user name) of the player or GM (me) who makes the change?  Is that possible? Thanks in advance, -- Tim
1599052978
The Aaron
Roll20 Production Team
API Scripter
1: I think you'd be hard pressed to cause enough events to where this would have any affect on the game.  Events are really pretty sporadic in terms of how fast Javascript runs.  I have a debugging script I use that logs every single event to the chat and to the log, and even with all of them turned on, it never causes a delay that I can notice (and that's doing quite a bit more than just storing the data). 2: There is no user id supplied to any events except chat events.  There's no way to know who performed an action that lead to an event, short of forensic examination like "who is logged in" and "who can access the token". 
Thanks so much. The Aaron said: 1: I think you'd be hard pressed to cause enough events to where this would have any affect on the game.  Events are really pretty sporadic in terms of how fast Javascript runs.  I have a debugging script I use that logs every single event to the chat and to the log, and even with all of them turned on, it never causes a delay that I can notice (and that's doing quite a bit more than just storing the data). 2: There is no user id supplied to any events except chat events.  There's no way to know who performed an action that lead to an event, short of forensic examination like "who is logged in" and "who can access the token".