Users browsing this thread: 1 Guest(s)
Newbie Still Doesn't Understand Code

#23
Posts: 89
Threads: 11
Thanks Received: 3
Thanks Given: 1
Joined: Dec 2015
Reputation: 3
Status
Debrave
With the benefit of hindsight, I can answer myself.

(10-12-2016, 10:51 AM)Turbotastic Wrote: All right, I was playing around with NOP-ing pieces of the code with various degrees of success*, and I became curious about something.

Despite the fact that the "default" view is the normal pool of available spells, both the code and my tests seem to indicate that the Spell + Cost view when pressing Y mode is actually the primary mode (and thus any changes must be made there first), while the view the player sees by default is actually the secondary view. Is this actually the case, or am I making a distinction where there is none?


You're making a distinction where there is none, because you don't understand how the code works and why the change you made did have an effect.

The spell availability in "Y mode" is based on whether that specific spell is known or not. However, this is likely the secondary mode, as it occurs after the branch away from the main code. Basically, the game treats the menu normally unless Y is pressed. Given how simplified the menu is and that its appearance is determined through used of the existing subroutines, you can gather this is the secondary mode if you plan to distinguish them like that.

There is duplicate code to determine whether to blank out a spell as you have noticed, but this is because the conditions for "Y mode" derive from the percentage of spells known and uses that as a barometer for blanking out a slot. That is the code you affected. As was mentioned, yes, it could be done more efficiently, but that's an irrelevant detail. "Y mode" doesn't contain any display option for partially known spells and just either makes the spell available or not.

The key fact is that you haven't grasped is that while "Y mode" is on/off in terms of spell display, the regular menu is made of subroutines which determine how a spell is displayed (on/off/partial). Basically, you are going to have to hop around the various subroutines to actually figure out the order they are applied. Even with documentation, this isn't straightforward. That spell generation (or more accurately, spell elimination) procedure is what you are going to have to hijack as well.  Once you figure out how to do that, modifying "Y mode" will be simpler in comparison.

(10-12-2016, 10:51 AM)Turbotastic Wrote: *My short-term goal was to allow spells to be available even if they aren't in the actor's spell list. I had limited success on that front. I NOPed C3/4FE0-C3/4FE3 andC3/4FE7-C3/4FEA and all the spells became usable when I pressed Y.  When I NOP-ed C3/4FD5, though, removing the branch granted access to the spells...but removed the ability to see the spells without the MP cost next to them.

You essentially rendered the menu acting like Y is pressed all the time by removing the branch. However, you did not change the behavior of magic list population outside of that limited scenario. You need to figure out the place or places that this occurs, then work with that simplified menu later.

Although you did make some baby steps, you are going to have to look at the code more broadly than serially, line by line. You have to figure out the process, not just the general guidelines and overall rules, of how the list builds itself.
  Find
Quote  
[-] The following 1 user says Thank You to Turbotastic for this post:
  • madsiur (08-13-2017)



Messages In This Thread
RE: Newbie Still Doesn't Understand Code - by dn - 09-21-2016, 12:06 PM
RE: Newbie Still Doesn't Understand Code - by Turbotastic - 08-09-2017, 10:05 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite