I am looking to use multiple instances of an Object. Each one will have a different message in the their own ‘Tip’ Text Variable that will explain what that instance of the object does. No issues here.
I would like these messages to hold variables, since some of the values in tip will change depending on the level etc. Since a text variable’s default value already starts inside quotation marks, I need some form of escape. I’ve tried everything I can think of, at this point I am curious if it is possible to escape a default text object to inject a variable.
For now I will just do it all in the event sheet, instead of in the variable.
afaik, no easy way to do it… what I did was made a custom extension with “replaceText” function, like this:
let string = eventsFunctionContext.getArgument('string');
let find = eventsFunctionContext.getArgument('find');
let replace = eventsFunctionContext.getArgument('replace');
eventsFunctionContext.returnValue = string.replaceAll(find, replace);
Then I have a text in the variable (long text) which contains e.g. %death_notes% in it, and then I call the function to replace this “placeholder” with actual text:
I have this function in my PuterJS extension, but I’m sure I have it in other extensions too.