 |
|
 |
|
Views: 236,202,706 Time: 2013-05-21 06:45:48 PM | 17 users online: aj6666, BLARG, Carld923, cyphermur9t, Dark Yoshi, Dotsarecool, imamelia, Jordohio, Masterlink, Mr. Micro Yoshi, natedog2007, Orphen Kirisame, Riolu180, RPG Hacker, TLMB, Usetheforce, Zildjian - Guests: 39 - Bots: 12 | Users: 22,858 (1,284 active) Latest: FUNKY kong ending |
|
|
 |
|
 |
|
| Tip: Palettes 0-3 do not work correctly on the overworld unless you use LM's option to disable the event reveal animation. |
|
|
|
 |
|
 |
|
 |
|
 |
|
| How do you make sprites take a # of hits? |
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - How do you make sprites take a # of hits? |
|
Pages: 1  |
|
|
|
| Posted on 2008-11-19 10:51:38 AM |
Link | Quote |
|
Example: How would I take an ordinary Goomba and make it die when you jump on it 3 times instead of one?
Is there some sort of routine I can just tack on to any sprite and it will take a certain number of hits?
|
|
| Posted on 2008-11-19 11:49:15 AM |
Link | Quote |
|
|
There are a couple of sprites that have "stomp hp" routines that you can look at - Rex disassembly, Ground Pound Koopa Boss and Pelican Bros. off the top of my head.
|
|
| Posted on 2008-11-19 01:39:02 PM |
Link | Quote |
|
You can use most sprite RAM tables for this one, with the exception of $14C8 - $14D3, $9E - $A9, $AA - $B5, $B6 - $C1, $D8 - $E3 and $E4 - $EF.
I might be forgetting a few but most other sprite tables (you can find almost all of them in the RAM map) are free to use here.
In spriting, you use $aaaa,x. aaaa = 16 bit start address of the sprite table, for example, $1528, $1534 and a few others.
You use $1534,x here.
Now... how to make a sprite take a # amount of hits? Well, unflag the 'Kill when jumped on flag' in Tweaker or the .cfg editor. That depends whether you're hacking the original Goomba or if it's a custom sprite.
Search for the interaction routine. I'm not exactly sure if there is one in the original SMW's Goomba, so you'll have to create one yourself.
Anyway, each time the sprite is stomped or something by Mario, you can increase the HP. Say, you use sprite table $1528,x for the HP, like Chargin' Chucks do. It would be like this:
Why INC? Wouldn't that increment $1528,x instead?
Yes, it would.
It starts out on 00.
Somewhere in the sprite's code you set up something like this (preferably in the sprite's main code):
CodeLDA $1528,x
CMP #$04 ; Amount of hits sprite take to die.
BCS KillSprite
This means that if sprite's HP is increased up to 4 (or more, but that shouldn't happen), the sprite is killed.
Now this kill routine, you have to set this up yourself.
You can change CMP #$04 to anything you want.
If CMP #$01, sprite dies at 1 hit, CMP #$10, sprite dies at 16 hits.
In the original SMW Goomba it's probably harder to implement this than with a custom sprite but it should be doable.
|
| Last edited on 2008-11-19 01:40:12 PM by Roy. |
|
| Posted on 2008-11-20 09:26:00 AM |
Link | Quote |
|
The Goomba thing was ONLY an exmaple not my intentions. Well I added this to the Sledge bro
CodeMARIO_WINS
INC $1528,x ; increment hit counter
LDA $1528,x ; \
CMP #$04 ; |
BNE Return
BCS KillSprite
RTS ; return
KillSprite
INC $1528,x ; Increase hit counter and...
LDA $1528,x ; \ Check if the sprite has been hit 4 times
CMP #HIT_POINTS ; /
BCC RETURN
LDA #$02 ; \ Kill sprite
But it doesn't work...jumping on him still kills him in 1 stomp and after the first ground shake he does from the jump he falls right through the ground. I do have the Hit point counter that the CMP is refering to at the top of the asm file. So is there something I'm missing?
|
| Last edited on 2008-11-20 09:29:15 AM by mario90. |
|
| Posted on 2008-11-22 11:58:43 AM |
Link | Quote |
|
|
If you haven't already downloaded the Pelican Bros., Pelican Bros. is a good example of a sprite taking a number of hits. I played with it to make it have 5 hits. This does read in hex so if you put 10, it is actually 16 hits.
|
|
| Posted on 2008-11-23 05:21:54 AM |
Link | Quote |
|
I tried adding that coding to the giant goomba, and it didn't work. I'm sure it's because I put the 'INC $1528,x' in the wrong place.
Where can I put that in the giant goomba sprite so it works?
|
|
| Posted on 2008-11-27 03:40:01 PM |
Link | Quote |
|
Originally posted by DoomdragonI tried adding that coding to the giant goomba, and it didn't work. I'm sure it's because I put the 'INC $1528,x' in the wrong place.
Where can I put that in the giant goomba sprite so it works?
exactly my problem. I would do as others say and look at other sprite's code. that's what I did.
|
|
|
Pages: 1  |
|
|
|
|
Forum Index - SMW Hacking - General SMW Hacking Help - ASM & Related Topics - How do you make sprites take a # of hits? |
|
|
 |
|
 |
The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.
Copyright © 2005 - 2013 - SMW Central Legal Information - Link To UsTotal queries: 27
|
|
|
|