The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.3.33 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Users browsing this thread: 1 Guest(s)
Command Change Custom Event

#1
Posts: 175
Threads: 11
Thanks Received: 10
Thanks Given: 8
Joined: May 2013
Reputation: 13
Status
Well-Fed
This came up on Discord today and I ended up coding it already. It's a set of three basic custom events that will change a character's command on a more permanent basis than the command-changing relics, either as an upgrade or as the foundation for a class change hack. The first variant assumes that you'll only ever have one instance of this in the game and hard-codes the character and command (using defines in the .asm to make it easier on, well, everyone), while the second takes two variables, character ID and command ID. Both of these versions change the third-slot, character-specific ability. (Variant one is currently set to give Celes the Shock command instead of Runic; variant two would do this with A4 06 1B.)

The third variant is more flexible still, and takes three variables -- character ID, command slot (00-03), and command ID. A5 06 02 1B would again give Celes Shock instead of Runic, whereas A5 00 03 09 would give Terra Tools instead of Item. You get the idea. Laugh

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Command Change v1.0
;
; Two-Variable (gen.act. A4)     - first variable is character ID, second variable is command ID
; Three-Variable (gen.act. A5)    - first vairable is character ID, second variable is command slot (00-03)
;                                  third variable is command ID
; CommandChange (gen.act. A3) takes no variables and is designed for scenarios where you only have one
;                                character who only ever has one command changed in your hack.
;                                It uses defines to make it easier on the modder (see below!)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

hirom
;header


;;;;;;;;;;;;;;;;;;;;
; DEFINES
;;;;;;;;;;;;;;;;;;;;

!FreespaceC0 = $C0D700        ; 10 bytes needed
;!FreespaceC0_1 = $C0xxxx    ; if placing second event command in different free space
;!FreespaceC0_2 = $C0xxxx    ; if placing third event command in different free space

!GeneralActionA3 = $C099A0    ; The location of the pointer for general action A3, which is unused in vanilla; we'll be following with A4 and A5
                            ; if your hack has other custom commands, make sure that you adjust this as necessary to a free one
;!GeneralActionA4 = $C0xxxx        ; if using different general action commands, please note which general action you're actually using
;!GeneralActionA5 = $C0xxxx

; Command Defines
!Fight = #$00
!Item = #$01
!Magic = #$02
!Morph = #$03
!Revert = #$04
!Steal = #$05
!Capture = #$06
!Swdtech = #$07
!Throw = #$08
!Tools = #$09
!Blitz = #$0A
!Runic = #$0B
!Lore = #$0C
!Sketch = #$0D
!Control = #$0E
!Slot = #$0F
!Rage = #$10
!Leap = #$11
!Mimic = #$12
!Dance = #$13
!Row = #$14
!Def = #$15
!Jump = #$16
!XMagic = #$17
!GPRain = #$18
!Summon = #$19
!Health = #$1A
!Shock = #$1B
!Possess = #$1C
!Magitek = #$1D

; Character Defines and ID reference
!Terra = $1618        ; #$00
!Locke = $163D        ; #$01
!Cyan = $1662        ; #$02
!Shadow = $1687        ; #$03
!Edgar = $16AC        ; #$04
!Sabin = $16D1        ; #$05
!Celes = $16F6        ; #$06
!Strago = $171B        ; #$07
!Relm = $1740        ; #$08
!Setzer = $1765        ; #$09
!Mog = $178A        ; #$0A
!Gau = $17AF        ; #$0B
!Gogo = $17D4        ; #$0C
!Umaro = $17F9        ; #$0D
!15th = $181E        ; #$0E
!16th = $1843        ; #$0F


;;;;;;;;;;;;;;;;;
; CODE
;;;;;;;;;;;;;;;;;


org !GeneralActionA3
dw CommandChange
;org !GeneralActionA4
dw TwoVariable
;org !GeneralActionA5
dw ThreeVariable

org !FreespaceC0
CommandChange:
LDA !Shock
STA !Celes
LDA #$01
JMP $9B5C

;org !FreespaceC0_1
TwoVariable:
LDA $EB        ; get character ID
STA $4202   ; store as first multiplier
LDA #$25    ; character blocks are 25h/37d bytes long
STA $4203    ; store as second multiplier
REP #$21
NOP
NOP
LDA $4216
TAX
TDC
SEP #$20
LDA $EC
STA $1618,X
LDA #$03
JMP $9B5C


;org !FreespaceC0_2
ThreeVariable:
LDA $EB        ; get character ID
STA $4202   ; store as first multiplier
LDA #$25    ; character blocks are 25h/37d bytes long
STA $4203    ; store as second multiplier
LDA $EC        ; this is the slot (0-3) the command is going into
REP #$21
NOP
ADC $4216
TAX
TDC
SEP #$20
LDA $ED        ; and this is the command!
STA $1616,X
LDA #$04
JMP $9B5C


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  
[-] The following 10 users say Thank You to GrayShadows for this post:
  • C-Dude (09-03-2019), Catone (09-06-2019), Gi Nattak (10-06-2017), Lockirby2 (10-12-2017), madsiur (10-06-2017), PowerPanda (10-19-2017), seibaby (10-07-2017), Simulacrum (10-26-2017), SSJ Rick (10-06-2017), Warrax (10-06-2017)



Messages In This Thread
Command Change Custom Event - by GrayShadows - 10-06-2017, 12:52 AM
RE: Command Change Custom Event - by Lockirby2 - 10-12-2017, 07:24 PM
RE: Command Change Custom Event - by PowerPanda - 10-19-2017, 12:50 PM
RE: Command Change Custom Event - by GrayShadows - 10-19-2017, 01:28 PM
RE: Command Change Custom Event - by PowerPanda - 10-19-2017, 02:13 PM
RE: Command Change Custom Event - by GrayShadows - 10-19-2017, 06:11 PM
RE: Command Change Custom Event - by KefkasKronie - 09-03-2019, 11:43 AM
RE: Command Change Custom Event - by C-Dude - 09-03-2019, 11:34 PM
RE: Command Change Custom Event - by fedorajoe - 05-22-2022, 11:07 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite