When adding JS functions to a game using JS.eval()...

Let's say I am making a game in the web editor.

I want to include a JS function. I have this:

JS.eval("myFunction = function(text){alert(text);};")

Will that function:

A. still exist in a saved game if I put it in the start script?

B. need to be in game.inituserinterface, so it is loaded when starting up a saved game?

The answer: B



Happy gaming!

I have often wondered about this KV. I assumed it would need to be in game.inituserinterface . Thanks for the confirmation!

This topic is now closed. Topics are closed after 60 days of inactivity.