[MV] Help Optimizing seed eventing/nesting

Status
Not open for further replies.

Riazey

Master of None
Veteran
Joined
Feb 27, 2014
Messages
160
Reaction score
201
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:
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.
1583426953081.png

2) Using 20+ if's
1583426038202.png

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!
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,180
Reaction score
1,181
First Language
Dutch
Primarily Uses
RMMV
you can try to use this one that reduce a big nested conditional branch, but I'm also not sure
if this is what you are looking for.
 

Riazey

Master of None
Veteran
Joined
Feb 27, 2014
Messages
160
Reaction score
201
First Language
English
Primarily Uses
RMMV
you can try to use this one that reduces a big nested conditional branch, but I'm also not sure
if this is what you are looking for.

This is really nice for checking "If you have x amount of items" and cut out that condition! However how many of the seeds they have doesn't affect this current event build only WHAT seed they are using! Which is why all the conditions (it spawns a different "plant" depending on the seed used)~

Thanks though! I might actually be able to use this plugin elsewhere!
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,180
Reaction score
1,181
First Language
Dutch
Primarily Uses
RMMV
if its done in a common event, than I dont know if there is a nicer way.
the image menu I build also use alot of " if " statement, each with a different purpose.
I'm not sure if there is a good way or plugin to handly those if statement, other than using
a variable or switches that handles those switch, like Yanfly SelfSwitch/Self Variables,

each seed has its own variable, like 20 seed, seed = 0 to seed = 20.
if you know what I mean, than you control the seeds by a variable when placing it.
1 self variable per event handles its own and dont interupt with the other one.

Else I hope someone know a better way.
 

Riazey

Master of None
Veteran
Joined
Feb 27, 2014
Messages
160
Reaction score
201
First Language
English
Primarily Uses
RMMV
if its done in a common event, than I dont know if there is a nicer way.
the image menu I build also use alot of " if " statement, each with a different purpose.
I'm not sure if there is a good way or plugin to handly those if statement, other than using
a variable or switches that handles those switch, like Yanfly SelfSwitch/Self Variables,

each seed has its own variable, like 20 seed, seed = 0 to seed = 20.
if you know what I mean, than you control the seeds by a variable when placing it.
1 self variable per event handles its own and dont interupt with the other one.

Else I hope someone know a better way.


Yeah I am using self variables to handle their growth and morphing~ It's very smooth, I sprited my first tree last night! They have separate IDs thanks to being assigned a number based on the item they are o.ob I am just unsure what to do about that haha~ Unless I make the items the same ID as the events hmm
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.
Bendyizzt wrote on staggqueen's profile.
Hello Newcomer...
I haven't make anything new yet, but I'm back addicted to writing some MZ plugins. Man, I wish I have more free time like I did 5 years ago.

Forum statistics

Threads
107,692
Messages
1,031,485
Members
139,816
Latest member
Ald974
Top