Users browsing this thread: 1 Guest(s)
BTB's Enemy Scripting Tutorial

#11
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
Oh! so it becomes...

- F5 00 unhide at max HP;
- F5 01 hide and remove;
- F5 02 unhide at same HP;
- F5 03 hide but not remove;
- F5 04 hide but not remove + delay end battle check;
- F5 05 hide and death.

Good to know, i'm pretty sure that i put in some task the wrong command and so i witnessed disappeared monsters still fighting, nothing that i can allow to happen in my hack... thanks.


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#12
Posts: 180
Threads: 3
Thanks Received: 26
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
On a related note, here's something interesting I found in bank C2. I believe this is a bit of code that would have allowed debuggers/testers to instantly win any battle. First, it checks if the font color is set to 30,30,30 and then it checks if the select button and the down button are pressed on controller 1 (kinda like a secret code). If so, it basically does AI command F5 00 05 FF, which instantly kills all monsters. This is the only instance I've ever found that uses the F5 05 command. Unfortunately, whatever was supposed to jump to this code every frame has been removed, so the game needs to be hacked in order to make it work. Here's the original code:

Code:
; [ Defeat All Monsters Immediately (unused) ]

; debug

C2/643E: C2 20        REP #$20
C2/6440: AD 55 1D     LDA $1D55       ; font color
C2/6443: C9 DE 7B     CMP #$7BDE
C2/6446: E2 20        SEP #$20
C2/6448: D0 1E        BNE $6468       ; branch if not (30,30,30)
C2/644A: AF 19 42 00  LDA $004219     ; controller 1
C2/644E: C9 28        CMP #$28
C2/6450: D0 16        BNE $6468       ; branch unless select and up are pressed on controller 1
C2/6452: A9 02        LDA #$02
C2/6454: 0C 96 3A     TSB $3A96       ; make sure it's been pressed for more than one frame ???
C2/6457: D0 0F        BNE $6468
C2/6459: A9 FF        LDA #$FF        ; affect all monsters
C2/645B: 85 B9        STA $B9
C2/645D: A9 05        LDA #$05        ; hide monsters and set wound status
C2/645F: 85 B8        STA $B8
C2/6461: A2 00        LDX #$00        ; enter/exit immediately
C2/6463: A9 24        LDA #$24        ; command $24 (monster entrance/exit)
C2/6465: 20 91 4E     JSR $4E91       ; create immediate action
C2/6468: 60           RTS

this code was taken from ff3u, but is also present in ff6j at C2/6426

To get this "instant win" code to work, I made the change below. Try it out, it's pretty fun.
Code:
C2/001B: 20 3E 64     JSR $643E
C2/001E: 80 03        BRA $0023

Note that this hack replaces some of the code for the Quick spell.
  Find
Quote  

#13
Posts: 2,549
Threads: 98
Thanks Received: 147
Thanks Given: 159
Joined: Aug 2009
Reputation: 52
Status
Nattak\'d
I've recently wondered what that dummied out feature did. Pretty cool! I'll have to check it out sounds fun.


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

#14
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
What insteresting discover!! Kungfu!
Do you have any other possible location to make work your code, in order to allow its use without affecting nothing?
It makes me come some nice idea that combination...

hey wait, i might bound that code to when you start/try to escape, instead of loading F5 00 05 FF i'll load a command to set a battle variable bit(one var that resets his value after battle) so that i can finally detect if the player is trying to run away(chase the coward thread reference)... lovely.

Said that i didn't understand where that code loads "F5" byte, could you point that out?

EDIT: it should be
C2/6463: A9 24 LDA #$24 ; command $24 (monster entrance/exit)
but how #$24 translates into F5?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  

#15
Posts: 200
Threads: 1
Thanks Received: 10
Thanks Given: 0
Joined: Oct 2015
Reputation: 18
Status
None
*ahem*

http://mnrogar.slickproductions.org/phpB...?f=3&t=967

all forums are behind Mnrogar's! Tongue

-------

Tenkarider: there are two stages to monster script execution:
1) the script itself running. it goes through the FF, FE, FD, and FC commands, with the last being an If-Then that decides whether to do anything. when the script hits other commands, whether those be an attack ID or commands like F5, it doesn't fully run them. rather, it performs a "placeholder" that queues them so their "payload" can be executed after the script is done processing, a little later. F5's placeholder will queue Command 24h.
2) the payloads. whatever command(s) was/were queued above is/are actually executed. each command's code is indexed by C2/19C7, with the special commands starting at C2/1A03.
Quote  

#16
Posts: 180
Threads: 3
Thanks Received: 26
Thanks Given: 4
Joined: Apr 2015
Reputation: 18
Status
None
Nice! Do you still have the patch you made? I couldn't download it from the other forum. Did you find a way to implement it without affecting anything else?
  Find
Quote  

#17
Posts: 3,970
Threads: 279
Thanks Received: 236
Thanks Given: 58
Joined: Oct 2011
Reputation: 65
Status
Tissue-aware
(12-05-2015, 02:20 PM)Everything Wrote: I couldn't download it from the other forum.

That's the main reason this thread always remained a mystery for me up until now (I never bothered to actually look around C2/6443).

I was imagining some funny battle quote from the dev team (though this would have existed in the data) or all charcaters doing a pose at the same time.
  Find
Quote  

#18
Posts: 1,633
Threads: 56
Thanks Received: 13
Thanks Given: 84
Joined: Apr 2014
Reputation: 12
Status
Atma
And this is also why i didn't knew that Assassin knew that already...
Lots of people ouside this site knows a lot of stuff, huh?


THE GREATEST CHALLENGE OF ALL TIMES AWAITS:
http://www.ff6hacking.com/forums/showthr...p?tid=2593
DO YOU HAVE WHAT IT TAKES TO SLAY A GOD?
------------------------------------------------------------------------
Tenkarider's project #2 is started: FF6 Curse of the Madsiur Joke (CotMJ)
http://www.ff6hacking.com/forums/showthr...p?tid=2755
What happens when Madsiur tweaks your account? This full game hack will show that!
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite