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

[Help] ItsATrap! crashes api every time a token collides with a trap horizontally.

Hey there, so I I'm really liking the ItsATrap! script and all the improvements that have been made to it over the last few months, and everything was running smoothly with it until I realized I can't seem to enter the space of a trap horizontally without the api crashing. It's weird because it seems to work fine when I approach a trap from every other angle. It just seems to have a problem whenever a character token passes over a corner of trap, rather than its edges. Not sure what to do about it and thought someone could shed some light on the situation for me. 
1480518644

Edited 1480518801
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I'm not having any problems on my end with it. Can you share the JSON information from the trap's GM notes? Also, could you provide the dimensions of the character token and the trap token? Also also, please provide the error message it produces in the API console.
1480563120

Edited 1480563186
Sorry for the late reply, anyway, the JSON Info is: {"stopAt":"edge","triggers":["-KXmkAKYQDdkMwcPoP-D"]} The dimensions of both the character & trap are 70px x 70px / 1x1 square, and the error message it produces is: Possible infinite loop detected, shutting down.
1480602416
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Could you also provide the JSON for the triggered trap?
Forgive my absolute stupidity on the matter, but I thought I did. Isn't it the bit you put in the trap token's gm notes?
1480620584
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Charlie N. said: Forgive my absolute stupidity on the matter, but I thought I did. Isn't it the bit you put in the trap token's gm notes? Yes, you provided me with the GM notes for the primary trap. You also have a trap ID specified in the triggers property for it. I need the GM notes JSON for that trap as well.
1480621267

Edited 1480621796
Ah. Sorry about that. Here it is: {"message":"Invalid Space!","stopAt":"none","revealLayer":"objects"} edit: I just found through some experimentation it may have something to do with AutoFacing:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/tree/" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/</a>... When I turn that script off, I can pass through diagonally without issue. So I suppose the question now is, how do I get both working properly together? Also I just realized this isn't the first time these two scripts haven't meshed well with each other in my personal experience.
1480626124
Ada L.
Marketplace Creator
Sheet Author
API Scripter
Hmm... I'll take a closer look at AutoFacing (not one of my scripts) later to try to figure out why they won't play nicely together.&nbsp;
1480782742

Edited 1480783466
Ada L.
Marketplace Creator
Sheet Author
API Scripter
I just tried dropping Autofacing into my sandbox with It's A Trap and I'm also observing the infinite loop error. This may require a more significant amount of time to look into what's causing this... It could be a bug in either of our scripts, or possibly a previously undiscovered bug in the API events system.&nbsp; I found a way to fix Autofacing so that the two scripts can work together. On line 64 change on('change:graphic', function (obj, prev) { to&nbsp; on('change:graphic:lastmove', function (obj, prev) { If this works for you, be sure to also poke the author of Autofacing to apply the fix for it. :) Aside from that problem, it looks like Autofacing has some weird behavior with how it rotates the tokens. For me it never seems to want to rotate the tokens in the correct direction. That of course is beyond the scope of this thread though. You might also wan
Awesome, that seemed to do the trick! I'll definitely send the author a message. As for 'weird behavior' I haven't had any problems with it, but as I recall I had to blindly screw around with it a bit when I installed it to get to it work properly (I think). I couldn't even begin to tell you how or what I did, but I'm just gonna be thankful it's all running smoothly now, haha Anyway, thanks a ton, the help is very much appreciated. :D&nbsp;