Typewriter effect on room descriptions?
mbeavitt
20 Mar 2019, 13:50Title says it all really - is there any way to implement the typewriter effect for the room descriptions? Thanks a lot!

DarkLizerd
21 Mar 2019, 02:56One way:
Enter the room description in the "before room enter" as messages...
(I assume you tried the typewriter command and it did not work for the room description.)
mrangel
25 Mar 2019, 11:22The hard part is finding the room description.
Here's a little bit of javascript that might do the job:
function typeRoomDescription() {
var description;
$('div[id^=divOutputAlign] span:visible').each(function () {
if (!$(this).text().match(/^(You can see|You can go)/)) {description = this;}
});
if (description) { $(description).typewriter(120); }
}
That finds the last paragraph that isn't the objects list or exits list, and applies the typewriter effect to it.
Once you've added the JS, you could put JS.typeRoomDescription()
in your enter room script (either for one room, or the one on the game object to apply it to all rooms).