Page immediately scrolls to bottom
keysmashingpoorly
17 Feb 2020, 06:32I have 0 background in coding and I just want to know how to stop the game from scrolling to the bottom of the page if it opens a page with a large amount of text. I was glancing through the forums and saw someone recommend using this:
JS.eval("scrollToEnd = function () {};")
Could someone please explain to a total novice where and how to insert that code?

Pykrete
17 Feb 2020, 08:59Oh, that might've been my topic!
You wanna head into the 'game' object at the top, advanced scripts, User Interface Initialisation Script, code view and just plop it in exactly as written.
It'll appear back in the normal view like 'JavaScript:eval ("scrollToEnd = function () {}")
'.
My version of it doesn't have the semicolon at the end, but that's just a separator for adding more to a single line, if I remember correctly.
I can't remember if you have to check a box somewhere to make User Interface Initialisation Script appear, come to think of it...
mrangel
17 Feb 2020, 09:49I can't remember if you have to check a box somewhere to make User Interface Initialisation Script appear
On the "Features" tab of the game object. "Advanced scripts" is hidden by default.

Pykrete
17 Feb 2020, 10:32That's the one! Granted, this would probably work elsewhere too, but if you want it activated from the very beginning of your game, this is the first script that'll fire off. If I remember correctly...