YesNoOk
avatar

[Solved] Character Facing Problem (Read 470 times)

Started by ThaWaffle, March 04, 2011, 01:00:54 pm
Share this topic:
[Solved] Character Facing Problem
New #1  March 04, 2011, 01:00:54 pm
  • avatar
Hiya all, i'm new to this forum so please bear with me if i make any mistakes.

I'm pretty basic when it comes to coding a character, but i can understand what each line does, and modify it to get the disired effect. So yeah, on to my problem:

I can't seem to make my character stop facing p2 after everything he does. I've tried making him stop facing p2 by adding AssertSpecial, NoAutoTurn in Statedef -2, but it doesn't seem to work.
At first i tried to trigger it when turning around (Trigger1 = StateNo = 5), but it didn't work.
Then tried Trigger1 = StateNo != Random number here, didn't work either.  I've also tried Type = Turn, but with no diffrence.

I looked at other characters, they all seem to work fine with NoAutoTurn in Statedef -2, but when i try it, it just doesn't want to work. I'm all out of ideas to make it work, so maybe you guys can help me out here ^.^

Please go easy on me if i did something obviously wrong, but i can't find the answer to solve this T_T

Last Edit: March 05, 2011, 12:06:12 pm by ThaWaffle
Re: Character Facing Problem
#2  March 04, 2011, 09:54:28 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
No autoturn in -2 should have worked. However, there was a manual fix placed into the common1.cns by elecbyte in 1.0 that forces your character to turn around now. Are you using 1.0? If you are we may need to overwrite your standing state (this is easy) If it's winmugen, there's something else going on.


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.
Re: Character Facing Problem
#3  March 04, 2011, 11:16:23 pm
  • avatar
Really? I'm still a bit of a noob, but state -2 is always executed every tick right? So why wouldn't it work?

I'm coding in WinMugen, as for the standing state... I never could figure out that one, so i just used KFM's CNS instead, so there is no [StateDef 0] (Still willing to learn how this works though)
And if i added it, i'd get really wierd effects, states not executing right, etc. But that's probably me doing something really wrong :P

If it helps, here are the codes i tried to use:
Code:
;type 1
[State -2, noautoturn]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

;type2
[State -2, noautoturn]
type = AssertSpecial
trigger1 = StateNo != 5999
flag = noautoturn

;This one actually works, but screws up my walking back animation (and still moves towards p2)
[State -2, Turn]
type = Turn
;triggerall = RoundState = 2
triggerall = command = "back" || command = "holdback"
trigger1 = StateNo = 0
trigger2 = StateNo = 10
trigger3 = StateNo = 11
trigger4 = StateNo = 20
trigger5 = StateNo = 40
trigger6 = StateNo = 50
trigger7 = StateNo = 52
trigger8 = StateNo = 205
trigger9 = StateNo = 45
trigger10 = StateNo = 215
trigger11 = StateNo = 220


Maybe I should start to code my character in 1.0...
Re: Character Facing Problem
#4  March 04, 2011, 11:22:29 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Ok, i have a different question. Do you have the line [statedef -2]?

Typing [state -2] doesn't actually put it there. They have to be in statedef -2 to function. noautoturn as a flag for assertspecial has no history of being buggy so you have to have a reason for this not working.


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.
Re: Character Facing Problem
#5  March 04, 2011, 11:33:28 pm
  • avatar
Yeah i did put [StateDef -2] above state -2, and i just noticed by using noautoturn, the only thing that actually changes is when i jump over the other character P2 doesn't turn to face me.
Re: Character Facing Problem
#6  March 05, 2011, 08:21:30 am
  • avatar
  • ****
You should put up your code, we need to see if you did something wrong somewhere.
So cyanide, in the commons of mugen1 there is some sort of code keeping auto turns on. Is in the standing state?
Re: Character Facing Problem
#7  March 05, 2011, 08:38:36 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Oh it was jumpstart actually

;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1
facep2 = 1

facep2 is new. Based on an old issue around jumping people and not actually turning when you hit the ground holding up. Probably not the issue here though.


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.
Re: Character Facing Problem
#8  March 05, 2011, 10:43:35 am
  • avatar
Ok, it isn't much but here's what i got so far:

Code:
;-------
;Walking
[Statedef 20]         
type    = S
physics = S
sprpriority = 0


[State 20, 1]                 
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]                   
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim                 
triggerall = vel x > 0           
trigger1 = Anim != 20 && Anim != 5 
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim                   
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, Goto Stand]                   
type = ChangeState
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
value = 0

[State 20, Goto Fwd Jump]
type = ChangeState
trigger1 = Command = "x" && Command = "holdfwd"
value = 40

;---------
;Jumping
[Statedef 40]
type    = A
movetype= A
physics = A
anim = 41
ctrl = 0

[State 40, 1]
type = Velset
trigger1 = time = 0
x = 0
y = -7.5

[State 40, 2]
type = VelAdd
trigger1 = command = "holdx"
y = -0.15

[State 40, 3]
type = PosAdd
trigger1 = command = "holdx"
y = -1

[State 40, 4]
type = ChangeAnim
trigger1 = command = "holdfwd"
trigger1 = anim != 41
value = 41

[State 40, 5]
type = ChangeAnim
trigger1 = command = "holdback"
trigger1 = anim != 42
value = 42

[State 40, 6]
type = PosAdd
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 40, 7]
type = PosAdd
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 40, 8]
type = ChangeAnim
trigger1 = Vel Y >= 0
value = 44

[State 40, 8]
type = ChangeState
trigger1 = Vel Y >= 0
value = 41

;---------------------------------------------------------------------------
;Jump down
[Statedef 41]
type    = A
movetype= A
physics = A
poweradd= 0

[State 41, 1]
type = VelAdd
trigger1 = 1
y = -0.1

[State 41, 2]
type = ChangeAnim
trigger1 = command = "holdfwd"
trigger1 = anim != 44
value = 44

[State 41, 3]
type = ChangeAnim
trigger1 = command = "holdback"
trigger1 = anim != 45
value = 45

[State 41, 4]
type = PosAdd
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 41, 5]
type = PosAdd
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181

;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 190]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 190

[State 190, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

Re: Character Facing Problem
#9  March 05, 2011, 10:53:37 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
[State 20, Goto Stand]                   
type = ChangeState
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
value = 0
That's managed natively. You don't need that.

Quote
[State 40, 2]
type = VelAdd
trigger1 = command = "holdx"
y = -0.15

[State 40, 3]
type = PosAdd
trigger1 = command = "holdx"
y = -1
You want him to be able to fly? Unless his yaccel const is higher than 1.15 that's what he'll do.

Now, why is there so little here? Have you emptied the common1.cns or something? Or are these just the states you're overriding?


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.
Re: Character Facing Problem
#10  March 05, 2011, 11:04:46 am
  • avatar
The PosAdd is for a little bit extra height in a jump if you hold the button, if you just tap it it'll make you jump lower.

There is so little because i wanted to start creating from scratch, add things step by step. I basically just took kfm's cns, emptied it, and started over. And this is what i currently got so far. And the common1.cns was already empty before i took it. So yeah that's basically it.
Re: Character Facing Problem
#11  March 05, 2011, 11:16:09 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
mugen\data\common1.cns should NOT be empty. You have a massive problem if that file has nothing in.

Also, you probably shouldn't have emptied kfm's .cns. Download my second narutorial, it comes with some blanked out files (i left a punch in) that would be better than wiping it all. And re-extract common1. You do not want to have an empty one, it manages the gethit behaviour.


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.
Re: Character Facing Problem
#12  March 05, 2011, 11:28:30 am
  • avatar
Ok, i'll try that now.

Re: Character Facing Problem
#13  March 05, 2011, 11:34:55 am
  • avatar
I just opened your Common1.cns in FF Classic, and it's the same one i have, empty?
Re: Character Facing Problem
#14  March 05, 2011, 11:36:18 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
.... Open mugen\data\common1.cns. If that's empty, redownload. It bleeding well shouldn't be. Also, i did not provide that file so i don't know what you're talking about there.


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.
Re: Character Facing Problem
#15  March 05, 2011, 11:46:41 am
  • avatar
Oooh... My apologies, giant misunderstanding here. I thought you meant the common1.cns that appears under the .cns in fighter factory. If i open the one in my mugen folder, it's not empty.

As for the turning problem, i'll start over by using your template. Is there anything i could add in the code to stop facing p2?
Re: Character Facing Problem
#16  March 05, 2011, 11:51:06 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
As i say, no autoturn should have done it. Please recreate your character leaving common1.cns where it is. Copy out the states you want ot make alterations to and place them in your .cns file. Add noautoturn. It should work correctly if you override state 40 and remove the facep2 = 1 line.


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.
Re: Character Facing Problem
#17  March 05, 2011, 12:03:15 pm
  • avatar
Will do, thanks for the help ;3