whimsicalobservant: (Default)
 I am an idiot. An absolute buffoon. A paragon of walnuthood.

The title is not an exact quote. I think Himeworks was it who said something along those lines. About a common mistake being that your script does too much.

I need to separate at least the Quest Log, because it's a hideous tangle of switches, from the Encyclopedia script.

I might need to outsource the data I'm calling to a common event so both scripts can access them.

But the point stands: the script is probably doing too much.

#fail
whimsicalobservant: (Default)
For the past months, I kept thinking: Man, adding a simple quest log to ADFR should be simple! A day coding and I should be done.

As evidenced by the fact that this is day 4, I am not. I do, however, have 150 lines of currently too incomplete to be useable code. Because I don't do things by halves, and a couple more things happened:
  1. I decided that the current grimoire/encyclopedia setup was utter bullshit and would best be integrated with the quest log
  2. You wouldn't believe how difficult it is to add a simple line to the main menu in RPGMaker VX Ace
  3. There is hardly any documentation. All tutorials are basic programming shit, or telling me to use Yanfly's Engine.
  4. Realized that hardcoding this is stupid and it would probably be easier and faster if I write a script that can be re-used just by changing the content variables
  5. Today I realized why Yanfly uses hashes.
Now I have the code for Yanfly's Engine open in my code editor for cross referencing. It's a beautiful piece of code. I almost understand how it works.

What I also have open is Coelocanth's Crafting script, and the internal game scripts (in the game editor).

The first day, I googled, and found nothing.

The second day, I watched basic programming tutorials about Ruby, RGSS3, RPGMaker VX Ace, and wrote down whatever I needed and didn't want to forget. I'm ADHD af, I need to write shit down. I had to learn how to take notes first, though.

The third day, I found the documentation to RGSS3.

All three days I looked at code, searched code, compared code, copied code, altered code, and wrote code. I now have somehwat of an idea what I actually need to do.


But Kite, why not just use Yanfly's Engine?

Well. The thing is? It's not just for a simple Quest Log anymore. I put the whole damn Grimoire/Encyclopedia there as well, and it has several layers of content that I want accessible easier than an option window and 3 lines of text at a time. So I had to figure out how to not only add an item to the menu (and let me tell you the precision on those searches was absolutely fucking horrible), but also understand how windows work and how you trigger them, and trigger multiple ones at once, and and and.
The deepest level of nesting, at the moment, is

Grimoire -> Log -> General, which lists Controls/Saving/Passing Over/What is this Grimoire

 
So the current list of things I need to do is as follows:
  • Write the handler that generates the current submenu from input
  • Write the corresponding window handler
  • Write the handler that generates the content of the chosen options at bottom level
  • Write the corresponding window handler
  • Write the window handler for the narrower help window
  • Write the function that calls all window handlers
  • Transfer actual content to the script
See how the actual thing I'm doing this for is at the bottom? I can't actually transfer the data until I have the handlers done and running, unless I want to hardcode this.

And looking at Yanfly's beautiful code, I kind of don't want to, lol.

So I went and started coding. Little switchcase, when submenu, generate this list...

And then I was like, wait, writing this out is stupid. Let's make a for loop. For that they'll have to be in arrays, but that's alright--

Four arrays nested in one later. This was the part where I understood why Yanfly uses a hash toplevel instead of an array, because this is some top grade nesting bullshit and since I need to reference which piece of the content list list I need to use, getting this with a key is ever so much fucking easier.

I spent the past hour typing this post because the alternative is tearing up what I already have and writing it in a fresh file because the one I have at the moment is a right fucking mess. And my ADHD meds are running out.

Profile

whimsicalobservant: (Default)
whimsicalobservant

April 2019

S M T W T F S
 123456
789 10111213
14151617181920
21222324252627
282930    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2025 12:06 am
Powered by Dreamwidth Studios