Giter Site home page Giter Site logo

Comments (11)

shdwjk avatar shdwjk commented on July 24, 2024

Can you give the call stack that was produced with the error?

from roll20-api-scripts.

shdwjk avatar shdwjk commented on July 24, 2024

Incidentally, it likely won't work on those tokens as their graphics are in the Marketplace, not a user library:

Known bugs/issues: If the avatar image of the character is not in a user library (i.e: it's a marketplace image or from the Monster Manual, or the like),
due to limits placed upon the API, it can't set an avatar image. You will have to do that yourself.

from roll20-api-scripts.

BWare96 avatar BWare96 commented on July 24, 2024

How do I get the call stack that was produced?

Yes, I saw the note about the token, however when I copy the Orc on a new game with no module loaded it works fine and includes the token image.

from roll20-api-scripts.

shdwjk avatar shdwjk commented on July 24, 2024

Usually there is a callstack in red along with the error. However, that doesn't always happen with the possible infinite loop detection. The way that is detected is based on a watchdog event in the sandbox which is touched each time the script returns control to the sandbox. If control is not returned after some period of time, the sandbox kills the scripts.

What command are you running when it stops working? I'm guessing just !dupCharToken which does several findObj() calls wrapping createObj() calls. Storm King's Thunder is a big Game, so those will probably be very expensive calls and cause the watchdog to trigger. The only way around that is to rewrite the script to defer as much work as possible. Even though that script is pretty short, it would take a while to do that task as it requires restructuring it into a much more asynchronous model of operation.

from roll20-api-scripts.

BWare96 avatar BWare96 commented on July 24, 2024

No call stack with the error.

You are correct in what I am running. As for rewriting the script that is beyond the time I would have. I would first have to teach myself roll20 scripting. So I guess it is back to pen and paper for the big group encounters.

from roll20-api-scripts.

shdwjk avatar shdwjk commented on July 24, 2024

Is there a reason that copying the existing orc tokens multiple times, or dragging in new orc tokens is insufficient to your needs?

from roll20-api-scripts.

BWare96 avatar BWare96 commented on July 24, 2024

from roll20-api-scripts.

ChrisDDickey avatar ChrisDDickey commented on July 24, 2024

I am the Author of the script, and just noticed this issue had been opened (wish somebody had contacted me on Roll20 PM).

Anyway, I have a few questions.

BWare96:
Did this happen when you when you were just trying to duplicate one token, or were you trying to make a fairly large number of Orcs?
Because one quick work around is to break a large batch into smaller batches.
!dupCharToken 2 (will make Orc 1 and Orc 2)
!dupCharToken 2 3 (will make Orc 3 and Orc 4)
!DupcharToken 2 5 (will make Orc 5 and Orc 6)
etc.
I would be very interested in knowing how many duplication's it did / did not happen on. ie: it happens when trying to make more than X orcs, but never when trying to make less than Y orcs.
Also, I am unfamiliar with "Storm King's Thunder" and am curious as to what you two consider a "big" game. How many characters are in the module. How many Attributes and Abilities would an Orc have?

shwjdk:
What are your ideas for rewriting?
The one thing I notice is that the script makes the new characters one at a time. For each newly created character it calls FindObj() looking for the original characters attributes and again looking for abilities. Thus for 10 new characters it makes 20 calls to FindObj(). Obviously it should be fairly straightforward to create all the new characters, then after all have been created, make one call to FindObj() to get all the attributes, and then do 10 CreateObj()s, etc.
However if the timeout is happening when just making one character, then this change would not save any time at all, it only saves time if making more than one character.
I would appreciate any advice you have.

from roll20-api-scripts.

ChrisDDickey avatar ChrisDDickey commented on July 24, 2024

OK, did testing on my own small campaign (just a few dozen characters, some with very few attributes).
My old code worked when making 36 or fewer copies of a certain character, but always gave the infinite loop detected error whenever trying to make 37 copies or more.
I pulled everything out of the one loop I talked about above that I could and the cutoff point improved slightly to somewhere between 42 and 45 copies. so there was a noticeable improvement, but not huge.
Any other ideas or tricks you could suggest?

from roll20-api-scripts.

ChrisDDickey avatar ChrisDDickey commented on July 24, 2024

OK, version 1.01 of DupCharToken went live yesterday, and like I said, there was some improvement, and I also updated the wiki page instructions to note that if this happens, to try making smaller batches.

Unless anybody has any specific suggestions on how the script can be further improved, I think this issue should probably be closed, but I can't figure out how to close it myself, I assume the creator or the administrator will need to do that.

from roll20-api-scripts.

BWare96 avatar BWare96 commented on July 24, 2024

Thank you Chris for the troubleshooting and tweaks to the code. Sorry it took so long to respond. It has been busy lately. I understand the limits and knowing what they are makes this a great tool. I will close the issue.

Brian

from roll20-api-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.