YesNoOk
avatar

Grab Error (Read 1526 times)

Started by Plum, June 07, 2018, 04:42:00 am
Share this topic:
Grab Error
#1  June 07, 2018, 04:42:00 am
  • **
  • Variables > Boyfriends
I've never encounter this problem before:  I recently made some sprites for a character and used the same code from another. The original Athena is fine when the grabbed like normal, so I used her code. When I apply the same animation/code to my character they suddenly become /huge/ and I can't tell what I need to change to fix the issue. Any help would be appreciated. This is my first time trying to build/port a character over to mugen, at least seriously anyway.
Re: Grab Error
#2  June 07, 2018, 05:37:06 am
  • ****
    • Peru
Who's getting scaled up? Your character or the victims? Depending on that, post the code of the corresponding state.
Millie, "Ozy and Millie" said:
"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."
Re: Grab Error
#3  June 07, 2018, 05:46:30 am
  • **
  • Variables > Boyfriends
My character is the one taking damage after the grab, the /victim/ as you put it. Coding is where I'm lost, and I wouldn't know what to post since I honestly have no idea what text file/code it is that's causing this. I still have a very basic understanding of it, like punch/kick here activates "X" sound or how to determine if the hit is high/low/ or overhead; my knowledge stops here. I've only been harshly using the code from animation, such as x,y axis and number of ticks per frame, learning as I go through trail and error for a few weeks.
Re: Grab Error
#4  June 07, 2018, 06:07:43 am
  • ****
    • Peru
Right, you need to read up on the docs, generally speaking. Other than that, you can find out what state we're dealing with.

Launch up mugen, pick your character and a stage and begin a match. Once you've done this, hit Ctrl+D, which will enable Debug mode. On the lower left, you can see the state (the very bottom value) your character is in as they do something (standing around, moving, attacking, etc.). Find out what the state number is when they get scaled up like that (let's call it State X)

Once you've found the number, edit their .cns file and search for the line "Statedef x". That's where the state is. Copy it and post it here.

If you don't know where the state ends, it usually ends with a changestate or selfstate state controller.
Millie, "Ozy and Millie" said:
"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."
Re: Grab Error
#5  June 07, 2018, 08:21:32 am
  • **
  • Variables > Boyfriends
 The Ctrl+D was a godsend, thanks. :3

Action ID: 24061 and 23061
State No: 6008

The Victim is using 18200 and 18210 and so is the Athena.

Oh, did you mean to copy the cns of the one whose sprites were growing huge? Or the attacker?

Also, the one doing the attack, their cns is in japanese if that matters.
Last Edit: June 07, 2018, 09:09:19 am by Chartreuse
Re: Grab Error
#6  June 07, 2018, 01:44:04 pm
  • *****
  • Shame on you!
    • USA
This is a localcoord issue with the throw. It seems like P1, the one doing the throw, is regular size, and the victim is hd.
When P1 throws P2, P2's sprites are considered to be P1's. P1 isn't HD so mugen sizes the pixels at full size instead of shrinking them.
Altoid worked out a fix for this with Jailbot I believe.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Grab Error
#7  June 07, 2018, 08:29:22 pm
  • ****
    • Peru
This is a localcoord issue with the throw. It seems like P1, the one doing the throw, is regular size, and the victim is hd.
When P1 throws P2, P2's sprites are considered to be P1's. P1 isn't HD so mugen sizes the pixels at full size instead of shrinking them.
Altoid worked out a fix for this with Jailbot I believe.

I'm... confused by this. I mean I got several characters here in MKvsSF scaled at different values and I don't see P2 states getting rescaled at P1 values. Unless you yourself declare a scale value through AngleDraw or something, I don't think P2 should rescale.

The Ctrl+D was a godsend, thanks. :3

Action ID: 24061 and 23061
State No: 6008

The Victim is using 18200 and 18210 and so is the Athena.

Oh, did you mean to copy the cns of the one whose sprites were growing huge? Or the attacker?

Also, the one doing the attack, their cns is in japanese if that matters.

What I meant is, after seeing what the states are from debug mode, post the states from the .cns file. Post everything related to Statedef 6008, Statedef 18200 and Statedef 18210.

In fact, if you're having too much of an issue locating them or don't know how much exactly to post, post the entire .cns file.
Millie, "Ozy and Millie" said:
"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."
Re: Grab Error
#8  June 07, 2018, 09:31:25 pm
  • *****
  • Shame on you!
    • USA
vVv Ryuko718 Updated 10/31/22 vVv
Re: Grab Error
#9  June 08, 2018, 07:12:05 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
If you will be drawing P2 in a custom state using their own sprites, you must use ChangeAnim, not Explod.

Explod, in a custom state, will not convert the sprites to the local coordinate space.
It is not possible to detect a player's local coordinate space, so you won't be able to scale the enemy based on that condition.


It's been awhile since I coded that move, but I used AngleDraw to scale any enemy to about 18 pixels tall, which was calculated by their const.size.height/2.
So AngleDraw may or may not be necessary here... but definitely steer clear of Explod in custom state for player sprites.

Last Edit: June 08, 2018, 07:20:20 pm by altoiddealer
Re: Grab Error
#10  June 08, 2018, 08:39:54 pm
  • ****
    • Peru
No disrespect intended and not to be nitpicky, but since he's quite new at this, I feel like you should clarify he needs to use ChangeAnim2, not ChangeAnim.
Millie, "Ozy and Millie" said:
"I think there are really three types of people: "Glass is half-full" sorts of people, "Glass is half-empty" sorts of people,
and people who will spit into the glass until that's fixed."
Re: Grab Error
#11  June 08, 2018, 09:27:15 pm
  • **
  • Variables > Boyfriends
I was surprised to have just one person replying so early in the morning, didn't think I have three people, thanks for the responses!

I was trying my best not to be lazy and actually try some things out myself first, looking over what Odb and ESFAndy said I started messing with the Localcoord and x,y scaling instead of just posting the cns here. I /really/ want to learn this stuff myself, I spent a few weeks just getting /familiar/ with FF3 and I'm still not certain of every little thing. Sooo I did manage to fix the size of the character sprites finally! Unfortunately, it did make other sprites such as portraits and power gauge huge, I thought I could just resize them in Photoshop/Rotsprite though I may try AngleDraw in the future but their palette was inverse for a single frame and this kept happening whenever I messed with the localcoord I believe.

I honestly feel I should have just posted the cns instead of evening trying for as long as I did.^^"

Altoiddealer, I've seen that name a lot around here, you always come off as very well informed... like most in the help forum. Still, I think I'll give try one more thing before just posting the entire cns file. I expect I'll be back soon.
Re: Grab Error
#12  June 08, 2018, 10:19:01 pm
  • ****
  • Robotics Engineer
    • USA
    • altoiddealer@gmail.com
I have less experience than many of the others on here :)

I made one character and one stage, but I did try to get as educated as I could... had tons of help on this board, and now I just try to give back (and keep ideas fresh in case I dive back in!)


But yeah, looking a little closer your problem probably won't be solved with AngleDraw, ChangeAnim2, etc.
You need to take a much closer look at your player's Constants, and coordinate space defined in the Player.

If your character is the one changing size during a throw, it's not bad coding on your end.  Test getting thrown by a few other characters, and make sure it isn't bad coding in that character who you are testing against.

Re: Grab Error
#13  June 09, 2018, 04:06:08 am
  • **
  • Variables > Boyfriends
Well, I really am stumped. I tried changing constants and localcoord on three characters and still the only one to mess up was the original p2/Inma character I was using. The Athena still works just fine, I also borrowed her cns to see if I can fix the issue and still nothing, and removing localcoord seems to be the only fix, though removing it does ruin/enlarge a few other things so I believe I'll just have to suck it up and re-scale the other sprites in Photoshop that it does scale. It does fix the overall issue at the expense of extra work, but progress is progress.

I do have a better understanding,(slightly) of constants and etc now at least. I tried changing the air front/back scaling as well since in debug mode the grab apparently puts the opponent in an airborne state, still no luck there. So I'm going to stop trying to figure out this localcoord issue seeing as only p2 with localcoord is acting up at the moment.

Thanks for all the help everyone, at the very least I /really/ hope I didn't waste too much of your time.