Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Javascript warning messages in custom posterender passage

edited July 2016 in Help! with 1.x
I am using Greensock text animation in my game, and when I use it in normal passages it works fine, but when I use it in an additional custom passage I have added on (appears every turn like StoryPassage), I get a javascript warning message saying something is broken, but when I click OK, everything works as normal - the greensock animation plays and life goes on.

So I'm getting a useless message.

This is the code I am using to append the custom passage to my story:
postrender["updateTitles"] = function () {
	setPageElement("titles", "Titles");
};

This is the error code. I store GSAP code in PassageDone. But when I click "OK", it functions as normal.

jpyaaeq.png


Anyone know what might be causing this? Obviously something is not of the required element type, so I am assuming something is missing when it evaluates it, but when I click OK, it magically appears and the code executes as desired.



Comments

  • edited July 2016
    OK 2 minutes after I posted it I found the bug that was causing it. Nevermind. :p

    I use several instances of GSAP text animation on each page and I had forgotten to disable one that I wasn't using at the time. It was that one not being there, rather than the one I was looking at, that caused the error.
  • What is the code you're using within the PassageDone<<silently>><<script>> macro? Since, you know, that's where the error is coming from.

    You've shown how you're populating the element with the ID "titles" with content every turn. Where is the element actually located within the page and how exactly are you inserting it there?

    PS: You do not need to use <<silently>> within the PassageDone special passage, as it is already silent.
  • edited July 2016
    I solved the issue just after I posted the question sorry, see my above post. :wink: Otherwise I would reply with the needed details.

    It was caused by that I have two Greensock scripts per page. One for the title text, and one for the first few words of the paragraph texts.

    I forgot to turn off the paragraph text animation on a screen with only title text. Hence the game posted an error that it could not find any paragraphs to animate, before displaying the title text animation, because titles weren't related to the error. The error message didn't say that in so many words, but that's what it was complaining about.

    Once I told it to stop looking for paragraphs, it worked.

    Thanks for the tip about <<silently>> though, I'll remove that bit.
Sign In or Register to comment.