general coding problems and questions [solved]

Started by Riptide, November 10, 2010, 01:42:17 AM

Previous topic - Next topic

Riptide

I solved my pallet problem though not in the usual way now I have a few questions and problems.

Problem
I started editing the commands and CNS file. I've got some moves working but the character won't hit. Each attack seems to face away from the opponent I'm not sure why this is happening since the attacks are striped down.


Now for some questions.

1) If the standing animation action number is normally 0 what should I do if the character doesn't look the same on the right and left side. there are two separate sprites for each attack in the sprite sheet. I haven't seen anything on the web for this.

2) Is there a way to limit a super to once per turn. I've never been sure about once per turn attacks.

Hero

First problem.

Make sure you added red clsn - clsn1 - to the hit animation.
Make sure the movetype of the state is A
Make sure you have correct triggers.

1) I suggest to override state 0 (from common.st). If the character is facing right (left side), the correct trigger is

trigger1 = facing = 1

If the characters is facing left (right side), you must use

trigger1 = Facing = -1

Use those triggers to change the anim of the character in the state 0.

2) Use a variable. For instance, in state -3, use roundstate = 1 as trigger and set to whatever value yo want. Then, every time you perform a super, substract any value yo want to that variable. If you need more assitance just ask.

Cyanide

The "reversal" of sprites is the same as the transformation code. Buggy inside custom states. Your character should not "turn" during attacks. The default direction of sprites is facing to the right. Unless you have a very very good reason for making them face left they should be facing right. Even your "flipped" sprites should be added facing right. Mugen will turn them for you.


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.

Riptide

likely I don't have the right triggers.

1) I need to add all sprites facing right, then use the transformation code.
what do you mean by not turning during attacks? There character should look different depending on which side the attack is on.
How was Aquaman made correctly if he can't turn during attacks.
Or are you trying to say I should execute the attack sprite for the proper side with a  variable to see what side he is on?

should I show a picture?

2)SHR sounds like a good idea.

I was thinking about changing the pallet of a character for a bit during the game. Is that the same thing as changing the groove of a character?

Lost_Avenger

mugen flips which direction your character is facing when ever you switch sides with your opponent. It mirrors the sprites. Im guessing you got a sprite pack that had the sprites all facing the wrong way? you can manually mirror the sprite using an image editor.

As far as testing a move itself. If you are using the animelem/animelemtime, make sure you have your elem number set to the right number. Or you can use time = 0(for testing purposes I guess...). If it still doesnt hit, then post the code and someone will help you

-
http://www.trinitymugen.net/Hosted/CFJ2/
-
thanks again Vans/Jesuszilla!

Riptide

No, let me explain what I have a sprite sheet of him
Spoiler (click to show)

If he is facing left he will look different than he would when facing right in all his moves.
flipping the sprites isn't the problem I can get them all to face right when I cut the sheet.
It's just he isn't symmetrical and I have given different versions of the same sprite different groups [ left facing punch is group 250, right facing punch is group 251]. I need to  make the character look like it's supposed to look and I'm not sure what to do. :-\

I'll check animelem/animelemtime now

Cyanide

The way it was written made me think he was turning round whichever side of the screen you were on implying the sprites had been added facing the wrong direction. As that's not the case this is simply

anim = ifelse(facing = 1, 200,201)

where 200 is one set and 201 is the other. Animation is basically the same whichever attack is used isn't it.


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.

Riptide

#7
Yes!
Thank you

Edit- it works but for some reason he won't face the opponent half the time. Plus his hits do nothing even though I used the red and blue boxes.

Cyanide

FAQ for the hits problem. Insanely common.

Also this is a transformation. You will need a custom common1.cns (get it from the data folder) and you need to modify every single state in there to display the updated animations. For default states this is commonly 10000 above the other one. For example

Stand facing right = begin action 0
stand facing left = begin action 10000

And once more, this breaks in custom states.


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.

Riptide

Checking FAQ now.

I was wondering where to edit the defaults.
common1.cns is where I should go but there's nothing in there to edit.

what do you mean by custom states, everything that is not the default?

Cyanide

Mugen\data\common1.cns

Copy it. Paste it into your characters folder. Believe me it's there.

Custom states are where p2 throws you and tells you to use an animation from within his own .air file. He'll be using required sprites and not your fancy updated ones.


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.

Lost_Avenger

It will pick whatever your 5030 group is(generally speaking for throws, some people still use 5070). So no matter which way you are facing, it will go with whatever sprite is there and will ignore your facing stuff. Its a cosmetic thing most of the time. It just means he wont play 100% like you want him too against most if not all mugen characters.


-
http://www.trinitymugen.net/Hosted/CFJ2/
-
thanks again Vans/Jesuszilla!

Cyanide

No it will not. Throws generally make use of a custom state and animation. The animation is set by the person doing the throw.

For example

[state Changeanim2]
type= changeanim2
trigger1 = time = 0
value = 810

[begin action 810]
5000,0, 0,0, 5
5001,10, 0,0, 10
5031, 30, 0,0, 20

Where the begin action is in your air file. That won't use your fancy sprites it'll use what it's told to, so he'll revert in a thrown state.


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.

Riptide

I'm using win mugen. Should I get mugen 1.0 and use that common1.cns?

Cyanide

You should use the common1.cns for the mugen you plan to code for. I would suggest coding for 1.0 ANYWAY as it's where things are and will go.


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.

Riptide

I'm using the mugen 1.0 CNS I managed to get him to walk forward and backward, stand and crouch with the correct sprites but it's not working for his jumps.

I'm not using a transformation I'm just using anim=ifelse(facing=1,#,#)
I don't really know what this means....


[begin action 810]
5000,0, 0,0, 5
5001,10, 0,0, 10
5031, 30, 0,0, 20


By the way what else can I check for besides facing I'm looking for a list of parameters.

Riptide

new problem.
um...how do I scale down my projectiles. Since my character is scaled down to 0.5 what do I do about his projectiles.

by the way since I was using the blank files having the character scaled to 1 looks bad. he actually looks normal at 0.5.

Cyanide, did you do any special scaling in the blank files. I meant to ask you what was up with that when I first started adding sprites.

Cyanide

No. They are simply KFM with some stuff cut out.

projdoscale = 1

in the [data] section.


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.

Riptide

#18
Done but doesn't seem to be working. Will it run in winMugen too.
Sorry I was editing the wrong thing.

I need a bit of a tip. What do I do If I need to turn a superjump into an attack. or a move to make the character jump higher then do something else.

Riptide

#19
never-mind that previous post, I'm working on some projectiles and need to use the same projectile animation on two variations of the attack. the attack isn't being called when I do the move but the changestate at the end of the attack is being called.

I wonder if it's because the character doesn't stay in the air long enough or the projectiles are conflicting.
the first standing projectile attack is working.


Sorry the error was because I was confused and tired.
1)I really do need some help with the superjump or jumping attacks


2) I have a problem with a projectile. I'm trying to bind it to the character so as long as the character is in the air the beam projectile still plays even as the character falls through the air.
I tried to use

[State 260, Bind]
type = BindToParent
trigger1 =time=30

after 30 tics the projectile should bind and fall with the parent animation 260 is the parent animation. It doesn't seem to be working. Should I even be using a projectile for this?



I need the character to accelerate quickly to the top of the screen during a jump then come back down quickly. I'm about 75% done with the character so when I'm done do I release it for testing or what?