I made an upgrade game, and I want to make it so that you can buy out damage without sitting there and crouching, but, I have a tax on damage that is based on a player’s current damage * 0.01 . I think I need an exponential type thing, but I don’t know how to make that, Can you please help?
Excuse me, but your post isn’t particularly detailed either. As I understood, you already have an upgrade rule ready, and you are concerned that you have to sit and wait while it upgrades (atleast that’s how most of rpg modes work). So in this case, you can just remove wait action in this loop (and effect actions that are not needed anymore too)
Did you try? Your loop is NOT infinite. Either player’s money ends, or he reaches the maximum level.
And you should move some actions that don’t need to be iterated to the end, like applying the level to player’s damage.
Of course, you can try to implement it in a bunch of formulas, but they are probably not gonna be simple, because you also need to check what lvl player is able to reach with his money.
Dude, this is not the loop we are talking about. You can’t even read my message right.
You seem like you just need to learn workshop better. Just play with different options and view others’ codes. See if someone already implemented this.
You are missing the part that the loop needs to be INFINITE to crash. If it isn’t too long, it won’t crash. After all, why would developers allow loops without “wait” if they always crashed?
Why do your conditions have useless True checks? Did you create this from scratch?
He never states that not using wait will crash it all the time. Read the definition of infinte loop. Removing Wait action doesn’t always make it infinite. In fact, the loop can still be infinte even if it has a Wait action.
Just to clarify things:
Since there are 60 frames per second happening, each frame has around 0.016 seconds of time reserved. If the computing-time of all the workshop actions that are scheduled within one frame combined extend this time limit, the server might crash.
Since a loop has the potential to create a lot of actions for its relatively small code size, loops wich run without a wait action (they run within one frame) are a typical source of server performance issues.
Though the 0.016 seconds is a time frame that is usually large enough for most looping-operations.
For example, my bot-pathfinding algorithm has a loop wich is quite complex, even with a nested loop inside (don’t mind the O(n²) runtime complexity worst case, please; it should have a runtime complexity of O(x * n) if my mode is used in a practical way ), but it runs smooth without wait actions within 1 frame.
It actually happened to crash the server, when 2 bots looped at the same time, so in the I needed to put a wait action inside of it.
But you see, in general you can try looping without a wait action first and if the loop then happens to crash your mode, you might try to input a wait action.
Have you considered placing a limit on the number of actions per frame within a loop? It will extend computation time, but will also save resources. For example, within a large For loop do a modulo of some desired number of actions per frame, then when mod == 0 execute a wait operation. Should optimize the compute and spread resources over several frames instead of just one!