YesNoOk
avatar

2 Quick Slightly Noobish Questions (Read 2051 times)

Started by Sean Altly, September 04, 2007, 08:20:44 am
Share this topic:
2 Quick Slightly Noobish Questions
#1  September 04, 2007, 08:20:44 am
  • *****
  • Deliverater
  • Who's that guy? A-L-T-L-Y
    • USA
    • www.mugenguild.com/seanaltly
Quick questions. I'm using Fighter Factory, and trust me when I tell you I've been desperately trying to avoid having to ask for help by reading the docs, but I just can't figure these two out:

1. My character has a rising knee that is meant to act as an anti-air move (like a Dragon Punch). I've got it looking nice, but my only problem is that if he gets hit in the middle of the move, he remains in mid air where he got hit until I jump again. I've looked at the Gravity state and implemented that, but I guess I'm doing something wrong because he always stays in the air. I could just make him unhittable during the move, but that's not very fair.

2. How do I add sounds for when my character gets hit and/or KO'd? Sorry if that's an easy one, I just can't find it. Thanks!

Download Last Bout now!
Re: 2 Quick Slightly Noobish Questions
#2  September 04, 2007, 04:10:24 pm
  • ****
1. make it it an A (Air type) Move

2. Add sounds to the commun1, for that just copy the commun1.cns form you data folder in mugen and paste in the char folder, then open the char, go to CNS, you see he now has an attack cns and a commun1 cns, then just use playsnds

No Borders, No Nations
Re: 2 Quick Slightly Noobish Questions
#3  September 04, 2007, 04:23:56 pm
  • *****
  • Horrible
    • Sweden
    • http://network.mugenguild.com/anjel/
2. Add sounds to the commun1, for that just copy the commun1.cns form you data folder in mugen and paste in the char folder, then open the char, go to CNS, you see he now has an attack cns and a commun1 cns, then just use playsnds

you shuld use the statedef -3 or -2 instead.

look in Kfm, he got the landing sound in statedef -3.
My shitty mugen stuff:
Re: 2 Quick Slightly Noobish Questions
#4  September 04, 2007, 05:36:36 pm
  • ******
  • [E]
    • Mexico
as far as the uppercut goes:

;
;
;regular punch dp            3000
;

[StateDef 3000]
Type          = S
MoveType      = A
physics       = N
Ctrl          = 0
PowerAdd       = 0
FaceP2          = 1
HitDefPersist       = 0
MoveHitPersist       = 0
HitCountPersist    = 0
SprPriority       = 2


[State Anim ]
Type       = ChangeAnim
trigger1    = !time && Prevstateno != 1370
Value          = StateNo
[State Vel ]
Type       = VelSet
Trigger1    = !Time && Prevstateno != 1370
X          = 0
Y          = 0

[State Idle ]
Type       = StateTypeSet
Trigger1    = !AnimelemTime(7)
;stateType       = U
moveType       = I
;physics       = U


[State Proper]
Type       = StateTypeSet
Trigger1    = Pos Y < 0
stateType       = A
moveType       = A
physics       = N
[State Proper]
Type       = PosSet
Trigger1    = Pos Y >= 0 && AnimElemTime(3) > 1
Y          = 0
[State esp]
Type       = ChangeState
Trigger1    = Pos Y >= 0 && AnimElemTime(3) > 1
Value          = StateNo+1
[State InitVel]
Type       = VelAdd
Trigger1    = AnimElemTime(3) = 1
X          = 2.9
Y          = -6.7
[State AirFriction]
Type       = VelMul
Trigger1    = AnimElemTime(3) > 1
X          = 0.96
[State Accel]
Type       = VelAdd
Trigger1    = AnimElemTime(3) > 1
Y          = 0.62

[State Counter Hit Damage]
Type       = TargetLifeAdd
Trigger1    = NumTarget
Trigger1    = var(15) = 1
Value          = Floor(fvar(0)*39.2+(random*.001))
Kill         = 1
Absolute      = 0
Persistent      = 0
[State hit ]
Type       = Hitdef
Trigger1    = !AnimElemTime(3)
Attr             =  S, SA
HitFlag          = MAF
GuardFlag          = M
AffectTeam          = E
AnimType          = Back
Air.AnimType          = back
Fall.AnimType          = back
Priority          = 3,Hit
Damage             = Floor((49+((random%2)*9.8))*fvar(0)), Floor((9.8+((random%10)*.1))*(fvar(0)))
PauseTime          = Floor(fvar(3)*10),Floor(fvar(3)*12)
Guard.PauseTime       = Floor(fvar(3)*11), Floor(fvar(3)*11)
SparkNo          = 0
Guard.SparkNo          = 40
sparkxY          = 4,-60
HitSound          = 5, 0
GuardSound          = 6, 0
Ground.Type          = Low
Air.Type          = High
Ground.SlideTime       = 16
Guard.SlideTime       = 16
Ground.HitTime          = Floor(fvar(4)*16)
Guard.HitTime          = Floor(fvar(4)*16)
Air.HitTime          = Floor(fvar(4)*13)
Guard.CtrlTime          = 0
Airguard.CtrlTime       = 99999999
Guard.Dist          = 50
YAccel             = 0.636363625526428
Ground.Velocity       = -9.63655853271484, -8.96969699859619
guard.Velocity          = -12.61205725
air.Velocity          = -9.63655853271484, -8.96969699859619
AirGuard.Velocity       = -12.61205725, -8.96969699859619
ground.cornerpush.veloff    = -9
Down.CornerPush.VelOff       = -9
Air.CornerPush.VelOff       = 0
Guard.CornerPush.VelOff    = -9
AirGuard.CornerPush.VelOff    = -9
Air.Juggle          = 0
SprPriority          = 2
;P1Facing          = -1
P1GetP2Facing          = 0
;P2Facing          = -1
;P1StateNo          =
P2StateNo          = 5610
P2GetP1State          = 1
;MinDist          =
;MaxDist          =
;Snap             =
ForceStand          = 0
Fall             = 1
fall.xVelocity          = 0
fall.yVelocity          = 0
Fall.Recover          = 0
Fall.RecoverTime       = 9
Fall.Damage          = 0
Air.Fall          = 1
down.Velocity          = 0
Down.HitTime          = 9
Down.Bounce          = 0
ID             = 0
chainID          = -1
nochainID          = -1,-1
HitOnce          = 1
Kill             = 1
Guard.Kill          = 1
Fall.Kill          = 1
NumHits          = 1
GetPower          = Floor(fvar(5)*(78.125+(random*.001))),Floor(fvar(5)*(78.125+(random*.001)))
GivePower          = Floor(15.625+(random*.001)),Floor(15.625+(random*.001))
Attack.Width          = 5,5
PalFx.Time          = 9
PalFx.Mul          = 256,256,256
PalFx.Add          = 0,0,0
;EnvShake.Time          = 7
;EnvShake.Freq          = 20
;EnvShake.Ampl          = -2
;Envshake.Phase       = 0
;Fall.EnvShake.Time       = 7
;Fall.EnvShake.Freq       = 20
;Fall.EnvShake.Ampl       = -2
;Fall.EnvShake.Phase       = 0

;
;idle

[StateDef 3001]
Type          = S
MoveType      = I
physics       = S
Ctrl          = 0
PowerAdd       = 0
FaceP2          = 0
HitDefPersist       = 0
MoveHitPersist       = 0
HitCountPersist    = 0
SprPriority       = 2

[State Anim ]
Type       = ChangeAnim
trigger1    = !time && Prevstateno != 1370
Value          = StateNo
[State esp]
Type       = PosSet
Trigger1    = !time
Y          = 0
[State esp]
Type       = VelSet
Trigger1    = !time
X         = 0
Y          = 0
[State Anim ]
Type       = ChangeState
Trigger1    = AnimTime = 0
Value          = 0
ctrl          = 1


this is composed by two animations.
the first is the dp, from the ground and including the air frames
animelem 7 is the element in which iori is not able to hit anymore. animelem3 is the first element in which he moves to the air. you can disregard the hit and counter code, and put code of your own.
the second is just the idle animation, for when he hits the ground and recovers.
Re: 2 Quick Slightly Noobish Questions
#5  September 04, 2007, 06:04:33 pm
  • *****
    • Peru
The KO sound is 11,0. No need to code or alter common1.cns for that.

For hit sounds, you can use the following code:



[State -X, PlaySnd]
type=PlaySnd
trigger1=movetype=H ;the char is being hit
trigger1=time=1 ;time=0 doesn't work in ngtive states
trigger1=time%2 ;to add randomness, so the sound is not played everytime your char is hit
value = a,b

Re: 2 Quick Slightly Noobish Questions
#6  September 04, 2007, 10:42:27 pm
  • *****
  • Deliverater
  • Who's that guy? A-L-T-L-Y
    • USA
    • www.mugenguild.com/seanaltly
I appreciate everybody's help. The KO sound worked, and I fixed the Rising Knee with your help. However...

Quote
It was actually the very first result from a google search; Also note that it would have saved you the exersize of someone replying with advice that was as wrong as it was unhelpful if you had looked it up yourself

...I'm not sure why you had to say this. I appreciate the help, but I don't see why it's a bad thing to come to a Message Board titled "Mugen Development Help," proceed to ask for said help, and then get told I would be better served doing Google searches instead. I came here to get a personal response to this specific situation, which I got and has truly helped a lot.

Although as I look at it, I think it may be your signature. I don't understand why one would have such a signature, but if it is, disregard what I've said.


Download Last Bout now!
Re: 2 Quick Slightly Noobish Questions
#7  September 04, 2007, 10:52:11 pm
  • ****
  • Coming Soon?
its the sig he used to have a picture there and he was explaining it I think
Latest Yoshi alpha ready for feedback Aug 15th check here for details...
Re: 2 Quick Slightly Noobish Questions
#8  September 04, 2007, 10:59:54 pm
  • ******
  • [E]
    • Mexico
it IS my signature...spend a few mothsn in this community and you will understand.

The KO sound is 11,0. No need to code or alter common1.cns for that.

For hit sounds, you can use the following code:



[State -X, PlaySnd]
type=PlaySnd
trigger1=movetype=H ;the char is being hit
trigger1=time=1 ;time=0 doesn't work in ngtive states
trigger1=RANDOM%2 ;to add randomness, so the sound is not played everytime your char is hit
value = a,b



renzo: modified your code a bit to add some randomness :P
Re: 2 Quick Slightly Noobish Questions
#9  September 05, 2007, 05:21:11 am
  • *****
    • Peru
Re: 2 Quick Slightly Noobish Questions
#10  September 05, 2007, 06:25:13 am
  • *****
  • Deliverater
  • Who's that guy? A-L-T-L-Y
    • USA
    • www.mugenguild.com/seanaltly
Well, I don't frequent message boards as much as some, so that's my fault that I didn't realize that was your signature. Thanks for the help and sorry about the misunderstanding.

Download Last Bout now!
Re: 2 Quick Slightly Noobish Questions
#11  September 05, 2007, 04:28:30 pm
  • *****
  • Horrible
    • Sweden
    • http://network.mugenguild.com/anjel/


[State -X, PlaySnd]
type=PlaySnd
trigger1= Stateno = 5000;movetype=H ;the char is being hit
trigger1=time=1 ;time=0 doesn't work in ngtive states
trigger1=time%2 ;to add randomness, so the sound is not played everytime your char is hit
value = a,IfElse(random < 500,b,(IfElse(random < 500, c,d))



3 sounds :yes:

What about using state 5000 instead of Movehit = H?
Cause there is more than 1 State right?
And maybe he dont want the sound to be played on everything
My shitty mugen stuff:
Re: 2 Quick Slightly Noobish Questions
#12  September 05, 2007, 05:05:34 pm
  • ******
  • [E]
    • Mexico
I misunderstood one of your past posts:
http://mugenguild.com/forumx/index.php?topic=61543.msg510865#msg510865

You said is not recommended to compare random against ranges of numbers, like random<600, but I understood sh1t instead of that, so I used time%2 :P

Nevermind.

yah, let me explain a bit more on that. in your code you have.

trigger1=time=1 ;time=0 doesn't work in ngtive states
trigger1=time%2 ;to add randomness, so the sound is not played everytime your char is hit

the second rtigger does nothing , as  time increases arithmetically, like 1,2,3, etc..,meaning there is no real random factor on that, on top of it the trigger will only be checked when time = 1 so it will always trigger anyway, because time%2 = 1 when time = 1. if you had suggested gametime instead, it would be cool, though.

what i said about comparing random is using it in the random < X or random =[x,y] manner, it is more common in random operation to get the mod like random%X instead, as random give a very big range of values, talking in the billions here.
While in mugen's case it only goes 0-999, it has also been said (though not proven, but that part is easy) that mugen's random does not distribute the values evenly between 0 and 999, so yet another reason to use %.

about this part

value = a,IfElse(random < 500,b,(IfElse(random < 500, c,d))

check the ai topic in development discussion as the properness of it is compromised depeneding on the results you want to achieve, currently it has a 50% chance of showing spark b, and 25% for both c and d.
Re: 2 Quick Slightly Noobish Questions
#13  September 05, 2007, 06:14:43 pm
  • *****
    • Peru
You talking to me?
I understood the whole thing after you posted the correction; my problem is sometimes I follow recommendations in a blind way :P