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

Directional Movement?

I'm thinking about putting in some retro sprites in my game, and the only problem is the perspective is off for rotational directions. There would need to be a separate sprite for the north, east, south, and west directions. Since players can move using the up, down, left, and right arrows, would it be possible to update their sprite in real time as they're moving so it reflects this? 
Not without using an API script.
That's good to know that this feature is possible. Are there any existing API scripts in which could accomplish this or would I have to homebrew it myself? I checked out the API github and I could not find anything myself, but most scripts I did check out just provided the download links with little to no information / read me on the features.
1491194552
Silvyre
Forum Champion
H3atmiser said: Are there any existing API scripts in which could accomplish this or would I have to homebrew it myself? Here's one. And another!
1491194673
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Here is a script from the page on  Isometric play . I can't vouch for it, since I've never tried it, but it might be a good start. According to the documentation, it flips left and right depending on direction of movement.
I'll have a look at these all. Thank you guys so much for the support!
1492722774

Edited 1492722814
Azurift
Sheet Author
Sorry for the bump, but I just now got around to implementing the directional movement and I am having some problems. Silvyre's second link <a href="https://app.roll20.net/forum/post/2778056/script-t" rel="nofollow">https://app.roll20.net/forum/post/2778056/script-t</a>... provides the perfect solution to my problem as I am also using retro-styled 3/4 perspective sprites. I tried implementing the script as per the post, but I get an error that reads as below: Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again.&nbsp;More info... For reference, the error message generated was:&nbsp;TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at apiscript.js:13:14 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:146:1), &lt;anonymous&gt;:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:903:16) at updateLocalCache (/home/node/d20-api-server/api.js:1194:18) at /home/node/d20-api-server/api.js:1378:11 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147) at Kd (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:546) at Id.Mb (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:489 Looking at the code from the forum thread link, it does appear to have a peculiar statement at line 13 in which may be the cause of crashing. I tried removing that statement and tinkering with it to some extent, but to no avail. I'm absolutely sure I implemented the rollable table tokens and its associated icons as per what the link said, so I'm pretty sure this is a problem with the code. Any ideas on what's wrong?
Fixed the problem! Turns out you need to specify an additional attribute called "Rotateable?" and set it to "Yes" for it to work for tokens.
1492727501
Silvyre
Forum Champion
Glad to hear that you've resolved your issues! Thanks for sharing your solution, and happy rolling!