Help with Sonic the Hedgehog "Shield" Code

Started by Sean Altly, February 23, 2013, 10:21:43 PM

Previous topic - Next topic

Sean Altly

So, I'm coding Sonic the Hedgehog for CvTW right now, and I have implemented an item box system, where he breaks open a random box and gets a variety of power-ups and such. Four of them are his various shields (Normal, Fire, Lightning, and Water).

Anyway, I'd like to make it so that when he has the shield, when he gets hit he takes no damage and goes into a custom hit state that looks like the state in the old games (he gets knocked back a bit, blinking).

I tried using hitoverride, but he still takes damage in the custom state, and for some reason it activates even if he's hit while blocking. Is there something about hitoverride I'm not understanding? Why would it activate even if he's blocking? Is there a way to nullify the damage without using the complicated Super Armor code I used for Mr. X and Jin?

Do you guys recommend a different way to accomplish this? Like, code the shield as a helper that can be hit, and put a nothitby on Sonic when he has the shield active? Thanks for any help.

Download Last Bout now!

Cyanide

If this is in -2 you probably will get that effect as guard states are movetype = H. Most of the time people with super armour can't block.

To avoid taking damage make sure your "hitstate" is in fact movetype = I, you won't take damage that way.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

TrinitroRoy

Quote from: Sean Altly on February 23, 2013, 10:21:43 PM
So, I'm coding Sonic the Hedgehog for CvTW right now
:bison: :bison: :bison: :bison: :bison: :bison: :bison: :bison: :bison: :bison:
I also like the idea of giving him shields. It's both fresh and retro. I like it.
===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Sean Altly

Got it fixed, thanks Cyanide.

@Trinitronity

I'll be putting up a WIP thread in my section soon. I'm looking forward to getting people's opinions on what I've done with him.

Download Last Bout now!

TrinitroRoy

===My discord servers===
Unlimited Force HQ: https://discord.gg/hnyK7JZ
Mega Man Megamix Engine Help Server: https://discord.gg/Wjm9GYU

Touhou database (by Ryouchi):
http://mugenfreeforall.com/index.php?/topic/8257-touhou-project/
Quote from: bitter nothings on April 30, 2010, 09:35:51 PM
you are all small and can't grow manly sideburns

Cyanide

Although i appreciate your enthusiasm, this is a HELP forum, not WIP discussion. If you wanna continue, please do so when he posts the thread rather than here.

And don't respond to this post either.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

2OS

tho you can still enter the states hitoverride nullifies the effect of blocking yaa.

selfstate should work too. which imo is better cos of reversaldef.