Users browsing this thread: 1 Guest(s)
Adding a character to the Narshe battle

#11
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
...How weird. I seem to have bit $132 set:

Code:
CC/C834: D2    Set event bit $1E80($132) [$1EA6, bit 2]

Code:
D2 32

Bit $139 is only set after you defeat Kefka whereas $1B6 is never ever set.

I'm totally blank. If it helps, the guy who runs back and forth in front of Kefka doesn't move either.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#12
Posts: 3,971
Threads: 279
Thanks Received: 237
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(12-28-2015, 10:11 AM)catone Wrote: D4 F3. : Set Bit $2F3 (Shadow is available for party)
C0 F3 82 : Is Bit $2F3 set? (Always yes, you just set it before this)
42 6C 02. :Branch to CC/C642 (Mog explains battlefield)

What is the advantage of doing a conditional check that will always be true over a subroutine call followed by a return? All I can see is that that method use 6 bytes instead of 5...
  Find
Quote  

#13
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
Alright, next questions are:

Does Kefka say the "Get those vial insects" line?

If you EA (think thats NOP for events..) from CC/CBFB to CC/CC0C do they move then?

I don't remember where it starts the code at CC/CBFB, it might have actually been part of that save point code even. Temporarily removing those checks will test if a bit is being set or not being set, or taking them out one at a time may be a better plan to see if its there. If not then it has to be the call to that code is missing somewhere. Like I said, don't remember where it is called from, but didn't find it with a search so you might check NPCs in LE for if any have that address as their event code, actually leaning toward it being part of that save point code, very likely.

Probably/hopefully just a simple typo, but yeah that whole pre battle code, while not poorly writen per say, has a strange flow to it. No telling where that code is started, might even be at the very start of it all.

As for doing a nonfailing bit check as a jump/branch? By doing B2 to jump to a subroutine means the code will come back to there after a return, doing it that way is a one way jump with no return. Depending on the following code, sometimes it works better... okay I know there is a reason for that over a JSR I just can't recall an exact example, it does it often in the auction house and a few other places normally or it uses other methods to trick a one way branch instead of calling a subroutine. Just can't remember exactly, also I have a thing about straight line codes vs RTS 2 or 4 times in a row. So its partially personal preferance too, remember I'm a little off at times.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#14
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
Yes, Kefka says "Get those 'vial' (lol) insects!". However, EA-ing from CC/CBFB to CC/CC0C does NOT make the soldiers move.

The save point code is

Code:
CC/C581: C0    If ($1E80($132) [$1EA6, bit 2] is set), branch to $CA5EB3 (simply returns)
CC/C587: C0    If ($1E80($1B5) [$1EB6, bit 5] is set), branch to $CA5EB3 (simply returns)
CC/C58D: F4    Play sound effect 209
CC/C58F: 55    Flash screen with color component(s) 8 (Blue), at intensity 0
CC/C591: 42    Hide object $31
CC/C593: 45    Refresh objects
CC/C594: 3D    Create object $12
CC/C596: 3D    Create object $13
CC/C598: 3D    Create object $14
CC/C59A: 3D    Create object $15
CC/C59C: 3D    Create object $16
CC/C59E: 3D    Create object $17
CC/C5A0: 41    Show object $12
CC/C5A2: 41    Show object $13
CC/C5A4: 41    Show object $14
CC/C5A6: 41    Show object $15
CC/C5A8: 41    Show object $16
CC/C5AA: 41    Show object $17
CC/C5AC: 42    Hide object $11
CC/C5AE: 45    Refresh objects
CC/C5AF: 12    Begin action queue for character $12 (NPC $12), 5 bytes long
CC/C5B1: D5        Set vehicle/entity's position to (18, 11)
CC/C5B4: CE        Turn vehicle/entity down
CC/C5B5: FF        End queue
CC/C5B6: 13    Begin action queue for character $13 (NPC $13), 5 bytes long
CC/C5B8: D5        Set vehicle/entity's position to (19, 11)
CC/C5BB: CE        Turn vehicle/entity down
CC/C5BC: FF        End queue
CC/C5BD: 14    Begin action queue for character $14 (NPC $14), 5 bytes long
CC/C5BF: D5        Set vehicle/entity's position to (20, 11)
CC/C5C2: CE        Turn vehicle/entity down
CC/C5C3: FF        End queue
CC/C5C4: 15    Begin action queue for character $15 (NPC $15), 5 bytes long
CC/C5C6: D5        Set vehicle/entity's position to (21, 11)
CC/C5C9: CE        Turn vehicle/entity down
CC/C5CA: FF        End queue
CC/C5CB: 16    Begin action queue for character $16 (NPC $16), 5 bytes long
CC/C5CD: D5        Set vehicle/entity's position to (22, 11)
CC/C5D0: CE        Turn vehicle/entity down
CC/C5D1: FF        End queue
CC/C5D2: 17    Begin action queue for character $17 (NPC $17), 5 bytes long (Wait until complete)
CC/C5D4: D5        Set vehicle/entity's position to (23, 11)
CC/C5D7: CE        Turn vehicle/entity down
CC/C5D8: FF        End queue
CC/C5D9: 3D    Create object $00
CC/C5DB: 3F    Assign character $00 (Actor in stot 0) to party 1
CC/C5DE: 45    Refresh objects
CC/C5DF: 00    Begin action queue for character $00 (Actor in stot 0), 3 bytes long (Wait until complete)
CC/C5E1: D7        Center screen on vehicle/entity
CC/C5E2: CE        Turn vehicle/entity down
CC/C5E3: FF        End queue
CC/C5E4: 3C    Set up the party as follows: $00 (Actor in stot 0), $FF (<Invalid Character>), $FF (<Invalid Character>), $FF (<Invalid Character>)
CC/C5E9: 41    Show object $00
CC/C5EB: 45    Refresh objects
CC/C5EC: 3F    Remove character $04 (Actor in stot 4) from the party
CC/C5EF: 3F    Remove character $06 (Actor in stot 6) from the party
CC/C5F2: 3F    Remove character $01 (Actor in stot 1) from the party
CC/C5F5: 3F    Remove character $05 (Actor in stot 5) from the party
CC/C5F8: 3F    Remove character $02 (Actor in stot 2) from the party
CC/C5FB: 3F    Remove character $0B (Actor in stot 11) from the party
CC/C5FE: 45    Refresh objects
CC/C5FF: D2    Set event bit $1E80($1B5) [$1EB6, bit 5]
CC/C601: D2    Set event bit $1E80($1BF) [$1EB7, bit 7]
CC/C603: 3A    Enable player to move while event commands execute
CC/C604: FE    Return

Considering you don't NEED to touch the save point to proceed I don't think it has much to do, but it's worth a shot...


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#15
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
Unless I'm missing it, nothing in that code to stop it. And removing bit checks doesn't allow it, then its never being called.

The only instance of FB CB 02 (a call to the address that starts movement) is at D1/FC40.

Isn't that in NPC info territory? If yes then it will be in LE, one of the npc types has it as a set event. Or did have it. Check an unmodified rom for an NPC that has it and see if you changed that.

Might even try adding a call to that line from somewhere near the end after the battle starts and force it to run, as a test.


The only true wisdom is knowing you know nothing.
  Find
Quote  

#16
Posts: 378
Threads: 94
Thanks Received: 17
Thanks Given: 26
Joined: Jul 2013
Reputation: 11
Status
Charmed
(12-28-2015, 04:25 PM)catone Wrote: The only instance of FB CB 02 (a call to the address that starts movement) is at D1/FC40.

If D1/FC40 with a header translates to 011FE40, I have 66 6F 02 instead.

This scares me. In fact, I did a hex search for FB CB 02 and my hex editor didn't find any results. Uh oh.


Step forward, spriters! We are also responsible to make hacks look new and fresh, we are no less important than code or ASM hackers! CHARGE!!
Quote  

#17
Posts: 3,971
Threads: 279
Thanks Received: 237
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(12-28-2015, 04:02 PM)catone Wrote: By doing B2 to jump to a subroutine means the code will come back to there after a return, doing it that way is a one way jump with no return.

I suspected that. Placing a return after the subroutine call comes to the same thing though? Or one thing I don't remember is if your method will make "the code forget" any previous B2 calls and will always return to the game at the last FE after the branch. Using B2-FE does let you return to previous calls if any. Dunno if I get that right. This is maybe where one using your method should be aware of what it does. Note that the B6 command always has a return after it, though theoretically it should never reach that point (dunno if it does actually).

(12-28-2015, 04:02 PM)catone Wrote: it does it often in the auction house and a few other places normally or it uses other methods to trick a one way branch instead of calling a subroutine.

I'm a bit skeptical because I've never see an event finishing with a always true conditional branching, meaning there's always (to my knowledge) at least one command followed by a FE after a C0 command. I've also never seen a C0 command followed directly by a FE (not talking about branching to the return routine here) or a bit set - check if bit set - branch like you did. I'm not saying the branching behavior you describe is false or doesn't work. I'm not saying either there is no useless check in the event dump, it's a possibility, though all bit should be used at least once in the game.

I've just never seen it in the vanilla game.
  Find
Quote  

#18
Posts: 2,550
Threads: 98
Thanks Received: 148
Thanks Given: 160
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
(12-28-2015, 05:09 PM)Kugawattan Wrote:
(12-28-2015, 04:25 PM)catone Wrote: The only instance of FB CB 02 (a call to the address that starts movement) is at D1/FC40.

If D1/FC40 with a header translates to 011FE40, I have 66 6F 02 instead.

This scares me. In fact, I did a hex search for FB CB 02 and my hex editor didn't find any results. Uh oh.

Perhaps you changed the entrance event address in the level editor on accident or incorrectly?


We are born, live, die and then do the same thing over again.
Quote  

#19
Posts: 826
Threads: 11
Thanks Received: 22
Thanks Given: 13
Joined: Nov 2011
Reputation: 16
Status
Double
(12-28-2015, 05:22 PM)Madsiur Wrote: I've just never seen it in the vanilla game.

I'm pretty sure that I've seen it somewhere, but I can't remember exactly where.


Confused Moogles FTW
Quote  

#20
Posts: 676
Threads: 44
Thanks Received: 26
Thanks Given: 21
Joined: Jan 2015
Reputation: 11
Status
Zombie
In the auction house they use $1F0, reset every map load to clear, so unless set at that time it will always be clear. Also, it doesn't "forget" where to return, that line of code just doesn't get marked for a return to that branch. The return would lead back to before that branch was made in a way, acting exactly like branching from a dialog choice.

Also used in places for only repeating a dialog one time (with other bits sometimes). Have that check at start of event, display dialog/do action, set bit. If attempted a second time, it checks the bit (which was just set, and branches over the dialog/action and either to a second dialog or directly to RTS.

Simple answer, it works as a JMP or a BRA instead of a JSR in event code.

Back on topic, that code is called from the event square (in LE) that is nor.ally under the save point. The bit of code about "place character at 25, 5" would place you on top of it, check those three bits (mainly "has started battle) then start them walking.

So that's where the issue is.


The only true wisdom is knowing you know nothing.
  Find
Quote  
[-] The following 1 user says Thank You to Catone for this post:
  • madsiur (12-31-2015)



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite