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

Execution Speed of Mods

I've created mods for NPC character sheets that uses ChatSetAttr to update the parameters for summoned creatures in Tascha's.  Similarly, we substituted a similar template for the Polymorph spell, which has required a significant amount of script.  My script runs correctly, but it has a significant delay.  It takes 5+ seconds to pop up a query that's in the script.  I've tried combining all my ChatSetAttr calls into one mega-call, but that hasn't helped.  Any suggestions? Thanks!
1670527643

Edited 1670527698
Gauss
Forum Champion
Before someone else comes along and asks, you should post the associated macros so folks can see them. :)
I've also noticed slow processing of MODs lately. It's most noticeable with DoorKnocker and TokenMod. With DoorKNocker, it can take five or more seconds to open or close a door using !knock --key|toggle
1670534962
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Rick and Andrew! Are you experiencing lag in places other than the Mod scripts? Several users have noted unusual lag and CPU usage lately.
1670545048

Edited 1670545306
I experience lag sometimes, due to server loading I imagine.  But this occurs all the time.  It is especially laggy the first time I run the code.  Here's my ability/mod.  I only posted one of the sub-abilities that are called by the main one.  There are 12 of them total.  They are similar, except for the parameters used.  I could save a lot of script if I could nest the macros between size and type (two deep), but I couldn't get that to work. [Transform] !setattr --silent --charid @{Chimera Twin|character_id} --spell_level|[[?{Spell level?|4|5|6|7|8|9}]]  !setattr --silent --charid @{Chimera Twin|character_id} --npc_pb|[[@{target|Caster?|pb}]]  !setattr --silent --charid @{Chimera Twin|character_id} --intelligence|[[@{target|Target?|intelligence}]] --intelligence_base|[[@{target|Target?|intelligence_base}]] --intelligence_mod|[[floor((@{target|Target?|intelligence}-10)/2)]] --intelligence_save_bonus|[[floor((@{target|Target?|intelligence}-10)/2)]]  /fx burst-magic @{selected|token_id} !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npcaction_$0_description|The chimera makes [[floor(?{Spell level?}/2)]] strike attacks.  ?{Type?|Large Sky Chimera,%{Chimera Twin|SkyLarge}|Large Land Chimera, %{Chimera Twin|LandLarge}|Large Sea Chimera, %{Chimera Twin|SeaLarge}|Medium Sky Chimera,%{Chimera Twin|SkyMedium}|Medium Land Chimera, %{Chimera Twin|LandMedium}|Medium Sea Chimera,%{Chimera Twin|SeaMedium}|Tiny Sky Chimera, %{Chimera Twin|SkyTiny}|Tiny Land Chimera,%{Chimera Twin|LandTiny}|Tiny Sea Chimera,%{Chimera  Twin|SeaTiny}} [SkyLarge] &{template:desc} {{desc=@{target|Target?|character_name} is transformed by @{target|Caster?|character_name} into a large Chimera of the Sky with a level ?{Spell level?} spell.}} !setattr  --silent --charid @{Chimera Twin|character_id}  --hp|[[20*(0@{target|Target?|npc_challenge}*0@{target|Target?|npc} + floor(0@{target|Target?|level}*(1-0@{target|Target?|npc})/4)) + 10*?{Spell level?} ]]|[[20*(0@{target|Target?|npc_challenge}*0@{target|Target?|npc} + floor(0@{target|Target?|level}*(1-0@{target|Target?|npc})/4)) + 10*?{Spell level?} ]] &{noerror} !setattr --silent --charid @{Chimera Twin|character_id} --npc_ac|[[11+?{Spell level?}]] !setattr --silent --charid @{Chimera Twin|character_id} --strength|14 --strength_base|14 --strength_mod|2 --strength_save_bonus|2 --npc_str_save_base|'' --npc_str_save|'' !setattr --silent --charid @{Chimera Twin|character_id} --dexterity|18 --dexerity_base|18 --dexterity_mod|4 --dexterity_save_bonus|[[4+@{target|Caster?|pb}]] --npc_dex_save_base|[[4+@{target|Caster?|pb}]] --npc_dex_save|[[4+@{target|Caster?|pb}]] --initiative_bonus|8.18 !setattr --silent --charid @{Chimera Twin|character_id} --constitution|12 --constitution_base|12 --constitution_mod|1 --constitution_save_bonus|[[1+@{target|Caster?|pb}]] --npc_con_save_base|[[1+@{target|Caster?|pb}]] --npc_con_save|[[1+@{target|Caster?|pb}]] !setattr --silent --charid @{Chimera Twin|character_id} --wisdom|14 --wisdom_base|14 --wisdom_mod|2 --wisdom_save_bonus|2 --npc_wis_save_base|'' --npc_wis_save|'' !setattr --silent --charid @{Chimera Twin|character_id} --charisma|16 --charisma_base|16 --charisma_mod|3 --charisma_save_bonus|[[3+@{target|Caster?|pb}]] --npc_cha_save_base|[[3+@{target|Caster?|pb}]] --npc_cha_save|[[3+@{target|Caster?|pb}]]  !setattr --silent --charid @{Chimera Twin|character_id} --npc_str_save_flag|[[0]] --npc_dex_save_flag|[[1]] --npc_con_save_flag|[[1]] --npc_wis_save_flag|[[0]] --npc_cha_save_flag|[[1]] !setattr --silent --charid @{Chimera Twin|character_id} --acrobatics_bonus|4 --npc_acrobatics|[[4+@{target|Caster?|pb}]] --npc_acrobatics_flag|[[1]] !setattr --silent --charid @{Chimera Twin|character_id} --athletics_bonus|2 --npc_athletics|'' --npc_athletics_flag|[[0]] !setattr --silent --charid @{Chimera Twin|character_id} --perception_bonus|2 --npc_perception|[[2+@{target|Caster?|pb}]] --npc_perception_flag|[[1]] !setattr --silent --charid @{Chimera Twin|character_id} --stealth_bonus|4 --npc_stealth|'' --npc_stealth_flag|[[0]] !setattr --silent --charid @{Chimera Twin|character_id} --survival_bonus|2 --npc_survival|'' --npc_survival_flag|[[0]] !setattr --silent --charid @{Chimera Twin|character_id} --npc_hpformula|[[3*(0@{target|Target?|npc_challenge}*0@{target|Target?|npc} + floor(0@{target|Target?|level}*(1-0@{target|Target?|npc})/4)) + ?{Spell level?}+1 ]]d10 !setattr --silent --charid @{Chimera Twin|character_id} --npc_type|Large Monstrosity (Aerial Beast), Unaligned !setattr --silent --charid @{Chimera Twin|character_id} --npc_speed|20 ft, fly 60 ft !setattr --silent --charid @{Chimera Twin|character_id} --npc_senses|darkvision 60 ft, passive perception [[12+@{target|Caster?|pb}]] !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npcaction_$1_attack_tohit|@{target|Caster?|spell_attack_bonus} --repeating_npcaction_$1_attack_damage|2d[[@{target|Caster?|pb}+?{Spell level?} -3]]+4 --repeating_npcaction_$1_attack_damagetype|slashing !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npcaction_$2_name|Stoop (spell level 6, recharge 5-6) --repeating_npcaction_$2_attack_damage|[[?{Spell level?}]]d[[@{target|Caster?|pb}+?{Spell level?}-3]] --repeating_npcaction_$2_attack_damagetype|slashing --repeating_npcaction_$2_description|If the chimera is flying and dives for at least 20 ft downward toward a target, the target must make a DC [[@{target|Caster?|spell_save_dc}]] Dexterity saving throw, or it takes [[?{Spell level?}]]d[[@{target|Caster?|pb}+?{Spell level?}-3]] slashing damage and the chimera can push it 5 ft away if it is no more than one size larger. !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npctrait_$3_name|Flyby  --repeating_npctrait_$3_description|The chimera doesn’t provoke opportunity attacks when it flies out of an enemy’s reach. !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npctrait_$4_name|Keen Sight  --repeating_npctrait_$4_description|The chimera has advantage on Wisdom (Perception) checks that rely on sight. !setattr --silent --charid @{Chimera Twin|character_id} --repeating_npctrait_$5_name|Swift Opportunist  --repeating_npctrait_$5_description|The chimera gains +4 on initiative rolls. !token-mod --set currentside|1 width|2u height|2u bar2_value|60 name|"Chimera of the Sky" {& select @{selected|token_id} }
1670606815

Edited 1670606857
Hi Keithcurtis, It's often takes a long time to open character character sheets and compendium entries. Very rarely NPC character sheets or handouts though, and only if the NPCs have extensive information under the Bio tab. This happens in both Chrome (my preferred) and Firefox, both of which are current. My only extensions are Malwarebytes and a password manager. It also doesn't matter if I use my 5G (390 Mbps - unreliable) or 2.4G (144 Mbps - rock steady) wireless connection. CPU usage by Chrome stays under around 25%. keithcurtis said: Hi Rick and Andrew! Are you experiencing lag in places other than the Mod scripts? Several users have noted unusual lag and CPU usage lately.
1670607937
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If the password manager is LastPass, I have seen anecdotal reports of lag issues from that (though not lately...) See if you can disable it temporarily to test. I have no familiarity with it, but maybe it can whitelist Roll20?
1670611440

Edited 1670620178
It's not LastPass; I use Dashlane. I'll try disabling that the next time I'm working on things in the game and during play to see if it helps. Edit: I just spent some time adding a character, pulling some NPCs from the compendium and a editing few handouts in one of my games. Turning off Dashlane seems to have improved the slow loading of the character and NPC sheets somewhat. I'll see what happens after our game this Sunday when I have more people in the game and more stuff open.