- Joined
- Feb 27, 2014
- Messages
- 166
- Reaction score
- 237
- First Language
- English
- Primarily Uses
- RMMV
Okay so basically, using yanfly's spawn/morph plugins and galv's tools, with some help from Imaginaryvillain and ct_bolt I've made a working crop system, but the most eventing intensive part comes with planting seeds. I am not sure if the current way I plan to tackle this is the most efficient with my current resources.
Lets say there are 20 seed items for example, they all use a common event to grab the item id then set it to a variable.
The thing is, how should I approach USING this variable that would cause the least amount of stress on the game, or if this is even the best way. They would spawn a different event depending on what seed is used.
If helpful note that the scripts between ifs will only change the following # in the first script call:
------------------------------------------------------------------------------------------
I.e. if the seed was number 11:
1) Nested if/else statements by 10 then 5:
This method is the one I currently am thinking of, where it checks if it's over/under 10, then between 11-15 or 16-20, then has standalone ifs for 5. It kind of cuts down the amount of checks from 20 to 3/7.

2) Using 20+ if's

3) Using a plugin to handle this.
In this case, does anyone have a plugin to recommend (one unlikely to break other plugins) or has the free time to build me one? qvq Unsure if this is super complex but to be honest if this is at all a bit heavy for eventing every time a person uses a seed, I can saunter on over to plugin requests and hope for one aaa-!
3) A different method!
The above was the only method my tired, tiny non-js understanding brain could come up with, but if you have a lighter/easier way of sorting this let me know!
Lets say there are 20 seed items for example, they all use a common event to grab the item id then set it to a variable.
The thing is, how should I approach USING this variable that would cause the least amount of stress on the game, or if this is even the best way. They would spawn a different event depending on what seed is used.
If helpful note that the scripts between ifs will only change the following # in the first script call:
Code:
Yanfly.SpawnEventAt(3, #, $gameVariables.value....
------------------------------------------------------------------------------------------
I.e. if the seed was number 11:
1) Nested if/else statements by 10 then 5:
This method is the one I currently am thinking of, where it checks if it's over/under 10, then between 11-15 or 16-20, then has standalone ifs for 5. It kind of cuts down the amount of checks from 20 to 3/7.

2) Using 20+ if's

3) Using a plugin to handle this.
In this case, does anyone have a plugin to recommend (one unlikely to break other plugins) or has the free time to build me one? qvq Unsure if this is super complex but to be honest if this is at all a bit heavy for eventing every time a person uses a seed, I can saunter on over to plugin requests and hope for one aaa-!
3) A different method!
The above was the only method my tired, tiny non-js understanding brain could come up with, but if you have a lighter/easier way of sorting this let me know!