you can also do a "while loop"
so while (update) {
//..do stuff
} do ... {
//..whatever needs to be done to break it
}
okay, I will look what that does.
😛 I am a serious noob when it comes to javascript, so this is going to be a challenge
😛
but there are ways, but hard to tell what approach is best for you.
and where.
you can also make simple functions like:
mathCheck = function() {
// your code
}
and call it in an event, and loop the event through this.
depends what you feel most comfortable with.
Well, I do now call it in a looping common event, and that works just fine. But that is what I would like to avoid. Not to make it run better, just to make it easier on the user.
😛
Now, to use the plugin, the user needs to run that plugin command constantly. This means they need a (common) event running all the time. I would like to make it so that the same formula's run in the background the whole time, but without the use of that event.
Another thing I tried was to have it run with every step the player takes. This too works perfectly fine, but the variables won't be updated if the player doesn't move. So therefor the looping event has a better result.
---------
Then let's give you a more general answer
To have anything happen without giving specific commands, you can select a function of the engine and link your code into it (usually by aliasing or replacement).
If you do this, the code will be executed whenever the engine runs that function.
The msin problem now is to decide which function to use - because that determines not only when the code is called but also in which context and with which data the code is run.
Yes, this would be great, but like you said: Which function? I tried updating with each step, which I thought was going to lag, but it didnt. However, this won't update when the player is standing still.
😛
And that is why the question of what the code does is important here.
If you do not want to share that infor, then you have to look through the entire engine for yourself to find the function best used to integrate your plugin.
only if you share what you're doing someone esle might answer "yes, I remember doing something silmilar and the best function to use is xyz".
I told what it does, but without the reason why it is doing it.
Now it's your choice, you can either keep the surprise and search for the best function yourself or reveal part of what you need to get advice on which function to use.
you're probably right... This puts me kind-off in a tough spot. I think the reveal of the plugin will kick-start the popularity, like it did with the project this whole idea is based on.
😛
I want to announce the plugin during a stream, and on all platforms at the same time, and as shortly before release as possible.
I think I'll experiment a bit with the suggestions I got so far. If that won't fix it, I could still decide to give a quick preview.
😛 (I know, I am my own problem here... I am fully aware. Ha ha.)
-------------------------------------------------
If this means every frame, then aliasing the map's update function would probably be best. You can do it like so:
JavaScript:
var _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function () {
_Scene_Map_update.apply(this);
//Add your custom logic here
}
Or alias whenever is responsible for changing the input of those formulas if that's possible.
oh, no every frame is not required. If it runs about a few times per second, should be enough. I tried up to 20 times per second, which surprisingly didn't lag at all. It actually makes the variables update super fast and smoothly, with absolute precision. It is overkill though, but... doesn't mean I'm not going to try this! Hahaha!
-------------------------------------------------
Guys, thank you for your quick replies.
👍
👍 this will get me experimenting some more, to find the right methods.