Users browsing this thread: 1 Guest(s)
Shock Ability

#1
Posts: 241
Threads: 16
Thanks Received: 11
Thanks Given: 39
Joined: Dec 2017
Reputation: 2
Status
None
Is it possible/easy to make the "Shock" ability used by General Leo consume MP? I just wanted to make it so that it costs around 50 MP for General Leo to use his Shock ability in my mod.
  Find
Quote  

#2
Posts: 3,807
Threads: 270
Thanks Received: 766
Thanks Given: 405
Joined: Oct 2011
Reputation: 63
Status
Tissue-aware
Yes it's possible but you gotta code a check for enough MP, deduct the MP used from total and consider command disabling if MP below 50 and command enabling when MP goes back higher than 50, as an example following the use of an elixir. I'm not sure you could easily hook up to the existing system since Shock is not a spell and will likely have to redo part of the MP logic for this ability only. (Shock is also a spell but it is not cast here like spells are)
  Find
Quote  

#3
Posts: 241
Threads: 16
Thanks Received: 11
Thanks Given: 39
Joined: Dec 2017
Reputation: 2
Status
None
(05-22-2018, 02:34 AM)madsiur Wrote: Yes it's possible but you gotta code a check for enough MP, deduct the MP used from total and consider command disabling if MP below 50 and command enabling when MP goes back higher than 50, as an example following the use of an elixir. I'm not sure you could easily hook up to the existing system since Shock is not a spell and will likely have to redo part of the MP logic for this ability only. (Shock is also a spell but it is not cast here like spells are)

Sounds too complex for a non-coder like me to get into. Tongue
  Find
Quote  

#4
Posts: 17
Threads: 3
Thanks Received: 0
Thanks Given: 7
Joined: Nov 2014
Reputation: 0
Status
None
(05-22-2018, 11:16 AM)Lightning Wrote:
(05-22-2018, 02:34 AM)madsiur Wrote: Yes it's possible but you gotta code a check for enough MP, deduct the MP used from total and consider command disabling if MP below 50 and command enabling when MP goes back higher than 50, as an example following the use of an elixir. I'm not sure you could easily hook up to the existing system since Shock is not a spell and will likely have to redo part of the MP logic for this ability only. (Shock is also a spell but it is not cast here like spells are)

Sounds too complex for a non-coder like me to get into. Tongue

I'm not a coder by any means but it's less complicated if you know where to look.

If you go [here] it is disassembly of C2 (Assassin / Terri Senshi) and search for Shock you get the following:

Code:
Shock

C2/171A: A9 82        LDA #$82       ("Megahit" spell, which is what has Shock's data)
C2/171C: 80 02        BRA $1720      (go set that as spell/animation)


So if you use a coding tool (I use WinHex32) you can search for those pointers and make edits accordingly. I think this area might be relevant:

Code:
C2/57AA: BD 00 00     LDA $0000,X    (get spell # from menu)
C2/57AD: 30 0A        BMI $57B9      (branch if undefined)
C2/57AF: EB           XBA
C2/57B0: A5 EF        LDA $EF
C2/57B2: 10 07        BPL $57BB      (branch if character not an Imp)
C2/57B4: EB           XBA
C2/57B5: C9 23        CMP #$23    
C2/57B7: F0 02        BEQ $57BB      (branch if spell is Imp)
C2/57B9: 38           SEC            (spell will be unavailable)
C2/57BA: 60           RTS


(Set Carry if caster lacks MP to cast spell.
Clear it if they have sufficient MP.)

C2/57BB: BD 03 00     LDA $0003,X    (get spell's MP cost from menu data)
C2/57BE: CD 4C 3A     CMP $3A4C      (compare to Caster MP + 1, capped at 255)
C2/57C1: 60           RTS


But again, I'm a novice when it comes to coding so take this with a grain of salt.
  Find
Quote  

#5
Posts: 1,633
Threads: 56
Thanks Received: 50
Thanks Given: 135
Joined: Apr 2014
Reputation: 12
Status
Atma
Golden rule for newbies: make backups of ROM before dealing with hex


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  

#6
Posts: 89
Threads: 11
Thanks Received: 17
Thanks Given: 55
Joined: Dec 2015
Reputation: 3
Status
Debrave
(05-23-2018, 12:48 AM)ShadowDreamer Wrote: I'm not a coder by any means but it's less complicated if you know where to look.

If you go [here] it is disassembly of C2 (Assassin / Terri Senshi) and search for Shock you get the following:

Code:
Shock

C2/171A: A9 82        LDA #$82       ("Megahit" spell, which is what has Shock's data)
C2/171C: 80 02        BRA $1720      (go set that as spell/animation)


So if you use a coding tool (I use WinHex32) you can search for those pointers and make edits accordingly. I think this area might be relevant:

Code:
C2/57AA: BD 00 00     LDA $0000,X    (get spell # from menu)
C2/57AD: 30 0A        BMI $57B9      (branch if undefined)
C2/57AF: EB           XBA
C2/57B0: A5 EF        LDA $EF
C2/57B2: 10 07        BPL $57BB      (branch if character not an Imp)
C2/57B4: EB           XBA
C2/57B5: C9 23        CMP #$23    
C2/57B7: F0 02        BEQ $57BB      (branch if spell is Imp)
C2/57B9: 38           SEC            (spell will be unavailable)
C2/57BA: 60           RTS


(Set Carry if caster lacks MP to cast spell.
Clear it if they have sufficient MP.)

C2/57BB: BD 03 00     LDA $0003,X    (get spell's MP cost from menu data)
C2/57BE: CD 4C 3A     CMP $3A4C      (compare to Caster MP + 1, capped at 255)
C2/57C1: 60           RTS


But again, I'm a novice when it comes to coding so take this with a grain of salt.


I hate to be a spoilsport, but as madsiur communicated, it isn't that easy.

The battle menu is designed to only allow Magic (including the Equipped Esper) and Lores to deduct MP. "But isn't Shock a spell?" It is...but it's not a spell in the same way as Flare or even Aqua Rake is, each with spots allocated in the menu and an MP cost defined.  The code in the second part is useless because it only refers to the Magic/Lore menus, and Shock is not normally cast out of those.

There are then two ways of going about this.

1. Adding a 'Megahit" clone to the learnable spell list by creating a new spell than can be cast (advanced).
2. Rewriting the "Shock" command so that it costs MP (and what would you like? A mini-window like with Lore/Magic with Shock as the only option? For the command to be used and succeed and deduct the MP without fanfare if successful, but fail otherwise?...this is also advanced)

It's possible and the outline on how to proceed is straightforward...but this is not easy by any stretch of the imagination.
  Find
Quote  

#7
Posts: 175
Threads: 11
Thanks Received: 78
Thanks Given: 18
Joined: May 2013
Reputation: 13
Status
Well-Fed
I wonder, actually, if you could repurpose the unused Summon command (with the appropriate targeting fixes) to accomplish this. IIRC, it deducts the appropriate MP for your equipped esper, doesn't it? I don't remember offhand if the current coding disables the command at low MP, but the functionality to disable commands in certain circumstances exists (no appropriate weapon equipped, Imp status, etc), and could definitely be adapted.

If you want Shock to cost MP, but not Megahit (i.e. it costs MP when Leo uses it, but not when an enemy does), there's some additional coding you'd need to do, because you'd need to hardcode the MP cost into the function rather than pulling it from spell data, but that's not actually all that hard, either.


Current Project: FF6: Tensei | Discord ID: TristanGrayse
  Find
Quote  

#8
Posts: 89
Threads: 11
Thanks Received: 17
Thanks Given: 55
Joined: Dec 2015
Reputation: 3
Status
Debrave
PowerPanda tried to work with the Summon command for a different purpose, but got stuck.

Catone released a patch that allowed for the creation of an 8-option menu, but the MP problem still remains.

Edit: Take anything I say with several grains of salt, as I am a complete nincompoop.
  Find
Quote  

#9
Posts: 241
Threads: 16
Thanks Received: 11
Thanks Given: 39
Joined: Dec 2017
Reputation: 2
Status
None
Thanks for the responses, guys. I tried editing a bit, but got nowhere. I think I will finish the rest of my mod first, and then maybe a few of you guys can help me with it. I also want to make sure the mod stays compatible with real hardware (which it currently is).

I do have another question that maybe you can help me with. I am trying to change Vanish in to Image using FF3usME, but I can't get the casting effect right. Does anyone know which bytes to use in order to get the bubble effect for image? Currently, vanish has these animation codes in FF3usME:

027E
00B9
FFFF
FFFF

Sound:
89
Byte10:
10
Speed:
16

I tried messing with these to change it to other stuff, but it glitched big time. Can anyone either give me an alternative effect I can use for image, or tell me how to get the blue bubble effect? I am open to suggestions to make this effect look good. Thanks!
  Find
Quote  

#10
Posts: 3,807
Threads: 270
Thanks Received: 766
Thanks Given: 405
Joined: Oct 2011
Reputation: 63
Status
Tissue-aware
The first 4 pairs of bytes are pointers to animation scripts, regrouped by layer or sprite script. In order to get what you want, use the same value at the same place as another spell with the bubble effect. You can also change the scripts themselves but it's more work.
  Find
Quote  



Forum Jump:

Users browsing this thread: 1 Guest(s)


Theme by Madsiur2017Custom Graphics by JamesWhite