[Solved?] Labels and spaghetti code

FoxySeta

Cleric, script kiddie and fudanshi
Veteran
Joined
May 6, 2017
Messages
270
Reaction score
110
First Language
Italian
Primarily Uses
RMMV
This is kinda of an "eventing" (how is it called outside RPG Maker?:kaoswt2:) style question, but when are you actually supposed to prefer labels over conditions/loops scene commands?

In high-level programming, for example, goto should be used only when:
  • a program automatically generates code (ex. parser generators)
  • exiting from nested loops
I understand how "eventing" is somewhat different, but I'd appreciate some stylistic guidelines to event good scenes.

I also tried checking VNM's guide, but here's all I found:
 
Last edited:

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
Jump to label is quite rare to be used, because the only time when it's more usable than loop is when you need to jump forward in the code instead of looping the code.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Labels are good when you really need to jump around the code a lot or to a far far part of the code (which if you do via conditionals would cause you to copy paste a lot of codes making conditionals inefficient), but in my so many years of using RM products, I rarely used that function..
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,248
Reaction score
1,250
First Language
Spanish
Primarily Uses
RMVXA
I used a label structure to create subroutines on an event, which can't account for them.
program goes in, literally runs the command "go to label xxxxx" as a script call ("xxxxx" being dynamic, changes according to the game), runs the event, goes back right after the script call, exits the main loop.
I didn't want to bother making hundreds of independent common events that would all run the-same-thing-but-not-quite, so I packed them all into the same event through labels.

the system didn't merit it's own plugin, hence the complex eventing.

the whole system is basically a manager: you send it one piece of data, the event does all the processing, and returns, independent from the main program.
 

FoxySeta

Cleric, script kiddie and fudanshi
Veteran
Joined
May 6, 2017
Messages
270
Reaction score
110
First Language
Italian
Primarily Uses
RMMV
Jump to label is quite rare to be used, because the only time when it's more usable than loop is when you need to jump forward in the code instead of looping the code.
What about conditions?
Labels are good when you really need to jump around the code a lot or to a far far part of the code (which if you do via conditionals would cause you to copy paste a lot of codes making conditionals inefficient), but in my so many years of using RM products, I rarely used that function..
Oh I see here come conditions:kaophew:

Thanks! (I just hope it's the same with VNM)
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,639
First Language
Czech
Primarily Uses
RMMV
I still like using the loops even with conditions, because it keeps cleaner code - I don't have to worry about processing more than I wanted to by accident.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top