øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;u=14;area=showposts;start=270e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe16c-2.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=profile;area=showposts;u=14e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe16c-2.html.zx̼g^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P.ºéOKtext/htmlISO-8859-1gzip0|ÖºéÿÿÿÿÿÿÿÿTue, 10 Mar 2020 16:30:27 GMT0ó°° ®0®P®€§²ð®˼g^ÿÿÿÿÿÿÿÿ]$ºé Show Posts - Pinkpuff

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Pinkpuff

271
Grimoire, you are indeed a miracle worker!!

So let me see if I understand this correctly...
  • The instruction in question is the one currently interpreted as "Load Graphic"
  • It will now essentially become "If flag XX is [ON/OFF] (based on top bit of XX; 1 = on, 0 = off), do the next YY actions"
  • The YY in this description is not a parameter in the usual sense but is read by the next byte following the instruction
  • If the specified flag matches the specified value, it will do the next number of bytes worth of actions (not counting the "fake parameter" byte)
  • If it does not, it will skip them (also skipping the "fake parameter" byte)

If this is correct, what I can do as far as the editor is concerned is get it to detect the patch on startup and set a flag in the editor which will tell it how to interpret the "Load Graphic" command (which I guess should now default to "Crash Game"?); that way it will be readable for both patched and unpatched roms.

Speaking of which, this could definitely be its own standalone patch, "Grimoire LD's Event Instruction Expansion Patch" or something

272
A small amount of custom ASM could also be written that tells the default "change character graphic to xx" instruction that, if the parameter indicates DK Cecil, P Cecil is an acceptable alternative.
I actually did something like that for my hack, though not exactly that.

That's exactly my plan for now.

If we have the pointers to the code for "set event flag" and "clear event flag", can't we just reverse-engineer whatever those are doing to figure out how to read an event flag?

273
The idea you present would work, IF there was a YY portion. None of the four unused/redundant Event Instructions have a YY portion to draw from and to add a YY portion to an instruction that did not originally have it to any of the existing Event Instructions would need a large rewrite to Events all together.

Hm, well if that's the only problem (besides the issue of deciphering how to read flag values) I have a very hack-ish solution:

"Do the following action if Flag XX is (on/off)"

Top bit of XX indicates whether you're looking for on or off, the rest indicate the flag number (since it seems all the used flags besides 255 are under 128 ^_^)

That way if you want multiple conditional instructions, it can still be done, though rather tediously:

Code: [Select]
If "saved Yang" is ON do the next action
 Placement 4: Yang toggles visibility
If "saved Yang" is ON do the next action
 Placement 4: Yang moves up
If "saved Yang" is ON do the next action
 Show Message: "Yang: Leave it to me"
If "saved Yang" is OFF do the next action
 Show Message: "Cecil: If only Yang were here"

Also I do like the stop-gap solution you proposed for my more immediate problem of switching to paladin/DK cecil, but I think if we can somehow swing a more general "conditional" instruction, it would vastly improve the expressiveness of the event code generally and open a lot of new doors.

274
So, with the code you posted that uses the Yes/No routine... would that replace the Yes/No routine? So you could have a game that has yes/no boxes or you could have a game that has flag-based branches, but not both? Also, can you only have one branch in an event with this method?

How does the "Repeat the next XX actions YY times" work? I was picturing the branch instruction to work more similar to that one where you could have code that uses multiple branches like

Code: [Select]
Show Message: "Elder: There are many paths ahead of you."
Show Message: " You can go to the moon using the Lunar Whale..."
If "awakened Yang" is off do the next 1 actions:
 Show Message: "Elder: Your friend Yang may still be alive"
If "found Yang" is on do the next 1 actions:
 Show Message: "Elder: Perhaps his wife knows how to wake him"
If "found Adamant" is off do the next 1 actions:
 Show Message: "Elder: A blacksmith in the underworld needs a rare ore, perhaps he can make something useful with it!"
If "found Tail" is on do the next 1 actions:
 Show Message: "Elder: There is a miner that collects tails, perhaps he will trade that one for something useful"
If "defeated Odin" is off do the next 1 actions:
 Show Message: "Elder: The ghost of Odin waits for you in Baron's basement"
Show Message: "Elder: Good luck, Cecil!"

So I take it it isn't as simple as "check flag value, compare to 0, if equal load A with YY, skip ahead bytes in the event code while decrementing A until 0"?

In any case, I guess something like that would involve hijacking an instruction that took two parameters, wouldn't it?

275
Upon reflection, it wouldn't do what I wanted anyway.

The situation I'm thinking of is this:

Suppose you have a scenario involving the twins, but it could be done while Cecil is still a Dark Knight, or it could be done while he's a Paladin. Furthermore, you don't have any guarantees over who else might be in the party when the scenario is executed.

So I guess it would make more sense to have a function like,
"Change character graphic to DK Cecil if the 'became a paladin' flag is off, otherwise change character graphic to Paladin Cecil"

 :edit: ACTUALLY!! How about this:

"If Flag XX is on, do the following YY actions; otherwise skip past them"

276
I'd love to see an event instruction of the form:

Change character graphic to graphic of character at slot XX in party

So for example, 01 would, instead of changing the graphic to Dark Knight Cecil necessarily, would change to the graphic of the character in the 1st slot, whoever it is.

277
Final Fantasy IV Research & Development / Re: Damage + Sap = Can't absorb??
« on: February 08, 2015, 05:34:58 AM »
Worked like a charm!

I think what I might do is expand my "protect/shell patch" to instead be a "spell routine patch" that fixes various spell routines and/or makes them more customizable for hackers.

278
Final Fantasy IV Research & Development / Re: Damage + Sap = Can't absorb??
« on: February 07, 2015, 06:40:55 PM »
He is indeed undead.

279
Final Fantasy IV Research & Development / Damage + Sap = Can't absorb??
« on: February 07, 2015, 03:22:34 PM »
So I had made Bio a dark-element spell in my hack, and when I created the Shadow Fiend, who of course should in theory absorb dark-element damage, he instead took full damage from it. At first I thought perhaps there was something special about Bio in particular so I swapped indexes with another spell and it didn't affect the behaviour. I then swapped it back and instead tried making it into a normal damage spell. The behaviour was as it should be; it healed him. Then I tried making the monster immune to dark instead of absorbing it and put the routine back to "damage + sap" and sure enough it dealt only 1 damage, as it should. So is there something special about the "damage + sap" spell routine that causes it to not be absorbed by things that should absorb it?

280
Final Fantasy IV Research & Development / Re: Enemy Special/Magic Attacks
« on: February 07, 2015, 09:09:00 AM »
It... didn't work? I tested it at the time and I just tested it now (to reassure I actually did test it back then), the objective was to make it so that 1/10 of HP recovered becomes 1/X'th of HP recovered, wasn't it? What happened when you tried it, out of curiosity? That sort of shakes my confidence a little to have it work for me, but not for others.

Hm, could have simply been a typo on my part or something... though I was sure I checked carefully... anyway the result was that it always healed 1/10 target's max even after making the spell power 1.

 :edit: Definitely was a typo on my part; I just tried it again and it worked no problem. Sorry if I gave you a fright!

A fix for 1/3 current HP is the same case as my original formula posted above... changing This...

$03/DD6E   A2 03 00   LDX #$0003   A:0000   X:0001   Y:0000   P:envMxdiZc - Load 03 into X (/3. How much % of HP to heal.)
$03/DD71   8E 47 39   STX $3947  [$7E:3947]   A:0000   X:0003   Y:0000   P:envMxdizc - Store X in 7E3947.

To this...

$03/DD6E   AD 9D 28   LDA $289D  [$7E:289D]   A:000B   X:0058   Y:FFFF   P:envMxdizc
$03/DD71   8D 47 39   STA $3947  [$7E:3947]   A:0002   X:0058   Y:FFFF   P:envMxdizc

This worked, for target's current HP. I managed to figure out how to change it over to caster's current HP without any difficulty.

Thank you all so much for your help!

281
Final Fantasy IV Research & Development / Re: Enemy Special/Magic Attacks
« on: February 07, 2015, 07:08:53 AM »
I tried Grimoire's solution and it didn't work. I tried avalanche's and it did work.

Any chance I can bug you guys for one more thing: How to change "recover 1/3 target's current HP" to "recover 1/(spell power) caster's current HP"?

282
Final Fantasy IV Research & Development / Re: Throw's Special Graphic
« on: February 06, 2015, 08:50:13 AM »
Expect a new component to the Command editor in the near future!  :wink:
If you wanna hold off for a little while on that, Pinkpuff, I'll probably explore each command to find the location for the performance stance for each. I'll make a little chart and post it here. I'll also try out all the different position possibilities, since so far I only have listed about 1/16 of them.

Agreed! This is exciting!

283
Final Fantasy IV Research & Development / Re: Throw's Special Graphic
« on: February 06, 2015, 05:02:53 AM »
Expect a new component to the Command editor in the near future!  :wink:

284
Final Fantasy IV Research & Development / Re: Enemy Special/Magic Attacks
« on: February 06, 2015, 05:01:35 AM »
You asked about this a while back and here was my fix...

$03/DD5A   AD 9D 28   LDA $289D  [$7E:289D]   A:0000   X:004E   Y:0000   P:envMxdiZc
$03/DD5D   8D 47 39   STA $3947  [$7E:3947]   A:0005   X:004E   Y:0000   P:envMxdizc

When you look at the formula you can see that LDA is loaded again before it is reused for 2707 below, so it's safe to load the Spell Power into A rather than X in the first place.

I did?? My apologies! I had completely forgotten!

Anyway thanks all for your input! I will test these solutions when I get home tonight or possibly tomorrow.

285
Final Fantasy IV Research & Development / Re: Enemy Special/Magic Attacks
« on: February 05, 2015, 03:12:01 PM »
GINORMOUS NECRO TIME!

I was wondering if perhaps some of our assembly miracle workers can enlighten me as to what I did wrong in the post above? For context, I was trying to make it so that the code for the "Resore 1/10 of target's max HP" spell routine, instead of healing 1/10 max, healed 1/(spell power) max.

For my hack, I was trying to create a "White Wind" ability for Draghinazzo. I figured if he absorbs Holy then if I made a Holy attack that dealt damage equal to caster's HP that would more or less do the trick. However, I found that instead what happened was that he would heal only a tiny amount, no matter what his HP was. I thought that if the problem I was tackling here years ago could be solved, I could use that routine and make the spell power 1 and get the White Wind effect.

Any ideas?