YesNoOk
avatar

Why doesn't this fatality work. (Read 997 times)

Started by Shamrock, August 02, 2008, 10:12:35 pm
Share this topic:
Why doesn't this fatality work.
#1  August 02, 2008, 10:12:35 pm
  • ******
  • I got a PM.
Ok working on a Fatality and for some reason the lives dizzy and Finish him does not work. That mean the end of round2 finish him does not pop up.

Here is the Fatality.cns

[StateDef 10000]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
ctrl = 1

;Invisible Helper that will make P2(opponent) is dizzy.
[State 10000, 1]
type = Helper
trigger1 = 1
trigger1 = NumHelper(7000) = 0 ;another Helper cannot exist as this in the screen.
ID = 7000
stateno = 7000
pos = 160, -140
postype = left
helpertype = normal
name = "FINISH HIM!"
keyctrl = 0
ownpal = 1

[StateDef 7000]
type = S
movetype = A
physics = S
anim = 7000
velset = 0,0
ctrl = 1

;Affecting all the screen.
[State 7000, 1]
type = HitDef
trigger1 = AnimElem = 1
trigger1 = P2StateType != A
attr = S, SA
damage = 0,0
animtype = Heavy
hitflag = MF
guardflag = A
priority = 7
pausetime = 0,3
sparkxy = 0,0
sparkno = -1
gurad.sparkno = -1
hitsound = -1
guardsound = -1
ground.type = High
ground.slidetime = 0
ground.hittime = 0
ground.velocity = 0
air.velocity = 0
air.fall = 1
fall = 0
numhits = 0
p2stateno = 49999 ;P2 will go for this state after to be affected by the Helper.

;"FINISH HIM!" - MSG
[Statedef 7010]
type = S
movetype= I
physics = S
juggle = 1
velset = 0,0
anim = 7010
ctrl = 0

;Voice of Shao Kahn(optional).
[State 7010, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2200,0

;"FINISH HIM!" it will not have shadow while it will be in the screen.
[state 7010, 2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

;The message will appear above of all the elements of the screen(scene, lifebars, chars...)
[State 7010, 3]
type = SprPriority
trigger1 = 1
value = 5

;Helper do "FINISH HIM!" - MSG
[state 7010, 4]
type = Helper
trigger1 = NumHelper(7000) = 1 ;It must have a Helper that makes P2 is dizzy in the screen.
trigger1 = NumHelper(7010) = 0 ;It cannot have message "FINISH HIM!" in the screen.
trigger1 = P2StateNo = 49999 ;P2 must be in this state it message to appear.
id = 7010
stateno = 7010
pos = 160, -140
postype = left
helpertype = normal
name = "FINISH HIM! - MSG"
keyctrl = 0

;Dizzy(before one fatality, with chronometer).
[Statedef 49999]
type = S
movetype= H
physics = S
juggle = 1
ctrl = 0
velset = 0,0

;Enemy will be with life equal the 1.
[State 49999, 1]
type = LifeSet
trigger1 = 1
value = 1

;Its personage gains a little more than energy to prevent an equal result.
[State 49999, 2]
type = TargetLifeAdd
trigger1 = P2life <= 1
value = 1

;After 480 ticks without having fatality, P2 falls.
[State 49999, 3]
type = SelfState
trigger1 = Time = 480
trigger1 = P2StateNo != [3000,3200] ;It places here the numbers of states of fatalities.
value = 5050
ctrl = 0

;After 480 ticks without having fatality, P2 is died.
[State 49999, 4]
type = LifeSet
trigger1 = Time = 480
trigger1 = P2StateNo != [3000,3200]
value = 0

;Enemy is dizzy.
[State 49999, 5]
type = ChangeAnim
trigger1 = AnimExist(5300)
trigger1 = Anim != 5300
value = 5300

Here is the -2 and -3

;If there are any -3 states, you can cut and paste them at the bottom of this
;file.
;---------------------------------------------------------------------------

[Statedef -2]

[State -2, StopAI]
type = VarSet
triggerall = var(58) > 0 && !IsHelper
trigger1 = RoundState != 2
trigger2 = !Alive
var(58) = -2
IgnoreHitPause = 1

[State -2, Simplifier]
type = VarSet
triggerall = !IsHelper
trigger1 = var(58) = 1
trigger2 = var(0):=0
var(0) = 1   ; Another option is to replace 1 with something like MatchNo, if
      ; you want to design your AI to have varying levels of difficulty.
IgnoreHitPause = 1

;---------------------------------------------------------------------------

;Insert all your -2 states here...

;--------------------------------------------------------------------------
;This VAR will be set in motion when one round previous will be gained.
[State -2, 1]
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(7000) = 0 ;Invisible Helper that makes the opponent is dizzy.
v = 56
value = 1

;When the enemy is deceased, it erases.
[State -2, 2]
type = varset
trigger1 = Win = 1
trigger1 = NumHelper(7000) = 1
trigger1 = p2life != 0
v = 56
value = 0

;When P2 will be with 1 of energy, it is died with any blow.
[State -2, 3]
type = AttackMulSet
triggerall = !Var(56)
triggerall = p2Life <= 1
trigger1 = Win = 0
trigger1 = RoundNo != 1
trigger2 = P2StateNo = 49999
value = 9999

;This state is optional, but I suggest that it places it to have a notion of the
;distance between P1 and P2. It will appear in debug during the game.
[State -2, 4]
type = DisplayToClipBoard
trigger1 = 1
text = "P2BodyDist X %f, P2BodyDist Y %f, Var(56) = %d"
params = P2BodyDist x, P2BodyDist y, Var(56)

kill = !var(58) || 1*p2stateno = 49999


;****************************************************************************************************
;Blood Color Changes
[State -2, YellowBlood]
type = palFX
;triggerall = 6000 = ID
;triggerall = 1
triggerall = IsHelper(6000)
trigger1 = p2name = "Yellow Devil"
add = 255,255,-255
mul = 128,128,-128
time = 9999

[Statedef -3]



[State -3, SetAI]
type = VarSet
triggerall = Alive && !IsHelper
triggerall = IsHomeTeam
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(58) = 1

[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(58) && !IsHelper
trigger1 = !NumHelper(9742)
trigger1 = Alive && RoundState = 2
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = var(58) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(58) = 1

[State -3, RCSC Helper]
type = Helper
triggerall = var(58)!=1 && !IsHelper
triggerall = !NumHelper(9743)
triggerall = Alive && RoundState = 2
trigger1 = MatchNo = 1
trigger2 = NumPartner
trigger2 = ID > Partner,ID
HelperType = normal
name = "Recent Custom State Check"
ID = 9743
pos = 9999999,99999
StateNo = 9743
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647



And finally here is the cmd.

[Statedef -1]



[State -1]
type = Changestate
trigger1 = Ctrl ;It must have the control.
trigger1 = P2Life <= 1 ;Life of P2 must be equal the 1.
trigger1 = NumHelper(7000) = 0 ;It cannot have another Helper as this in the screen.
trigger1 = P2StateNo != 49999 ;Opponent cannot be in Custom State.
trigger1 = RoundNo != 1 ;Round cannot be the first one.
trigger1 = var(56) >= 1 ;You must be to win one round before.
trigger1 = statetype != A ;P1 cannot be in air.
trigger1 = p2statetype != A ;P2 also not.
value = 10000

[State -1, Fatality]
type = Changestate
trigger1 = Ctrl ;It must have the control.
trigger1 = P2Life = 1 ;Life of the opponent must be equal the 1.
trigger1 = NumHelper(7000) = 1 ;It must have at least 1 invisible Helper in the screen.
trigger1 = P2StateNo = 49999 ;Opponent must be in this state.
trigger1 = RoundNo != 1 ;Round cannot be the first one.
trigger1 = var(56) >= 1 ;You must be to win one round before.
trigger1 = command = "Fatal" ;It places the command to execute fatality.
trigger1 = statetype != A ;P1 cannot be in air.
trigger1 = p2statetype != A ;P2 also not.
value = 3000


I've been working on this for two days and can't get it to work. I'm using winanne ai if that makes a difference.
Re: Why doesn't this fatality work.
#2  August 02, 2008, 10:29:25 pm
  • avatar
  • ******
    • Thailand
Are you sure the invisble helper is there when you do this, because it says the "finish him" will only appear when that helper is there, use debug to see if he is there or not.

mybe in your helper state you triggered the destroyself wrong or something, i haven't looked at all the code you posted but that was like one of the possible problems i saw so far :P

Cheers,P.o.t.S Die Hard Fan Boy
Re: Why doesn't this fatality work.
#3  August 02, 2008, 11:47:05 pm
  • ******
  • I got a PM.
Nothing is coming up in the Debug Rajaa. My guess is it's not activating for some reason.
Re: Why doesn't this fatality work.
#4  August 02, 2008, 11:52:45 pm
  • avatar
  • ******
    • Thailand
Nothing is coming up in the Debug Rajaa. My guess is it's not activating for some reason.
if you don't see the name of the helper in the debug anywhere. yeah it's not summoning let me take a quick look at the code again....
okay you have a helper in 7000 then in that state i don't see anything else but a hit def. i can conclude this from looking at it that

You helper 7010 is going to the same state as it's being summoned in ???


who is is in 7010 you or your helper 7000, maybe you have helper 7010 going into the wrong state because it's being sent ight back to the state that summons it, which is weird.
Last Edit: August 03, 2008, 12:01:40 am by P.o.t.S Die Hard Fan Boy
Re: Why doesn't this fatality work.
#5  August 03, 2008, 12:01:46 am
  • ******
  • I got a PM.
7010 is the finish him animation. 7000 is an empty animation with a clsn 1 that takes up the whole screen
Re: Why doesn't this fatality work.
#6  August 03, 2008, 12:03:58 am
  • avatar
  • ******
    • Thailand
Yes, why is the helper in that state going to the state it is summoned in?

 
Spoiler, click to toggle visibilty
Re: Why doesn't this fatality work.
#7  August 03, 2008, 01:04:08 am
  • ******
  • I got a PM.
I'm afraid you have lost me Rajaa I don't see a problem. Why wouldn't it?
Re: Why doesn't this fatality work.
#8  August 03, 2008, 01:17:40 am
  • avatar
  • ******
    • Thailand
I'm afraid you have lost me Rajaa I don't see a problem. Why wouldn't it?

i don't know it just seems weird to summon a helper in the same state that something else is already in and in the same state it is being summoned. i don't see any ishelper triggers ???

I don't know what the problem is by looking at the codes you've posted, maybe i overlooked somethings but, still summoning a helper in the state that something else is in is weird for what you're trying to do.

Cheers,Rajaboy

i don't know it could be the character your testing it on doesn't have an animation 5300.



Re: Why doesn't this fatality work.
#9  August 03, 2008, 02:15:00 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have this in your hitdefs right?

kill = ifelse(var(56) = 1, 0,1)

Cos that will allow you to hit p2 without killing them in the last round. Just brings health to 1. If that's not there, p2 will never exactly hit one health unless you're lucky. As such, you won't reach state 10000.


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: Why doesn't this fatality work.
#10  August 03, 2008, 03:07:07 am
  • ******
  • I got a PM.
Thanks cy no I didn't have it there you might have just saved me.

Edit No it didn't work. This is driving me freaking bananas.
Last Edit: August 03, 2008, 05:01:04 am by shamrock
Re: Why doesn't this fatality work.
#11  August 03, 2008, 07:11:28 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Lets do something really simple then.

Force yourself into state 10000 with a button press and see what happens. If that isn't working either, we have further problems.


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: Why doesn't this fatality work.
#12  August 03, 2008, 08:19:53 am
  • ******
  • I got a PM.
Now why didn't I think of that.  :oops: You are a freaking genius.

It works the helper for finish him did not.  But his life went to 1 and he entered the right p2state. now the question is why didn't this work on it's own.

Great big thx cy.
Re: Why doesn't this fatality work.
#13  August 03, 2008, 08:31:29 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You have no method of getting to state 7010. That helper seems to be created by state 7010, which aside from being a cycle is probably bad code placement. Move that helper creation to state 7000 or state 10000, whichever suits.

As for the "why the state 10000 bit isn't working"

Probably to do with this.

[State -1]
type = Changestate
trigger1 = Ctrl ;It must have the control.
trigger1 = P2Life <= 1 ;Life of P2 must be equal the 1.
trigger1 = NumHelper(7000) = 0 ;It cannot have another Helper as this in the screen.
trigger1 = P2StateNo != 49999 ;Opponent cannot be in Custom State.
trigger1 = RoundNo != 1 ;Round cannot be the first one.
trigger1 = var(56) >= 1 ;You must be to win one round before.
trigger1 = statetype != A ;P1 cannot be in air.
trigger1 = p2statetype != A ;P2 also not.
value = 10000

Cut that down to 2 triggers. ctrl, and p2life <= 1, then see what we get. What i gave you before is causing your punches to take p2 to one health right?



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: Why doesn't this fatality work.
#14  August 03, 2008, 09:05:48 am
  • ******
  • I got a PM.
no cy the Life code does not work. Still just goes to dead. before I go messing with my trigger I would Like to get that to work. I'm guess that has something to do with the variable not being coded properly I'm going to take look. let me know if you see something.

Oh again thx for all the help.