RPG Maker Forums

definite_lee
definite_lee
Interesting, but what would stop a player from just changing their computer time settings like this to alter the flow of the game?
Galenmereth
Galenmereth
Nothing. It’s just an example to show a live updated Switch that runs performantly without a need for a parallel process event :)
Bonkers
Bonkers
Very impressive!
??????
??????
functionality wise - awesome. programming wise - ewww, evals...
Galenmereth
Galenmereth
Actually not evals! I wrap the commands in a new anonymous Function with the string as content, and a “use strict”; prefix, so that both error debugging and runtime safety is significantly improved
Galenmereth
Galenmereth
ie. Function(‘“use strict”; ’ + command)();

This causes any errors to show a proper stack trace
Galenmereth
Galenmereth
Technically it is still evaluating a string as code and not optimal, but at least this is scoped a bit more safely. I wish there was a better way but alas.
??????
??????
lol yea I figured it would be the wrapped functions, but its still an eval as you say :p
Don't get me wrong, I've done similar in the past myself... :D
Galenmereth
Galenmereth
MV internally does it with the "Script" event commands as well, so in that context I'd say it's OK. But yeah, generally to be avoided as much as one can. Especially if the input can in any way come from the end user (player), then it's absolutely verboten ;)
  • Like
Reactions: ??????

Latest Threads

Latest Posts

Latest Profile Posts

Evening humans! How goes the game make?
The anime characters we saw 20 years ago,
still have the same age when we see them now.
Somehow it's strange but also beautiful.
It's like no matter how much we change,
there's certain part of ourselves we can reconnect to when we see them again.
Took a long, long time, way longer than it should to be honest...but I've finally finished the big content update to my demo!
Lots of not good things happening IRL but I'm not gonna let this day end like this. Quote time:
"Success is not final, failure is not fatal: it is the courage to continue that counts." -Winston Churchill

So, keep going, lads. Whatever you do keep going. Until next time.

It's a Spanish devlog don't get scared!. (please)

Forum statistics

Threads
117,251
Messages
1,105,858
Members
153,417
Latest member
Lavalord
Top