YesNoOk
avatar

Charging meter (KOF style) and another prob I'm havin' (Read 2252 times)

Started by #Shaun, September 24, 2007, 04:28:57 pm
Share this topic:
Charging meter (KOF style) and another prob I'm havin'
#1  September 24, 2007, 04:28:57 pm
  • *****
  • corner push pusher
I've set up the necessities for my char to charge their supers meter by holding down two buttons simoutaineoulsy (or however its spelled).  When I perform it he gets caught in a infinite loop.

I might release a beta version of him tomorrow so I can get concrete help. until then, this is what I got:

THE CNS
;======================================================================
; ++Chi Power (Focus Charge) ==========================================
;======================================================================
[Statedef 1220]
type = S
movetype = I
physics = S
ctrl = 1
velset = 0,0
anim = 1220

[State 1220, PowerAdd]
type = PowerAdd
trigger1 = ((GameTime%5) = 0) && (command = "HOLDX") && (command = "HOLDY")
value = 1

[State 1220, 2]
type = PlaySnd
trigger1 = Time = 5
value = 3,0
channel = 0
volume = 50

[State 1220, 2]
type = PlaySnd
trigger1 = Time = 5
value = 3,1
channel = 1
volume = 50

[State 1220, 6]
type = Explod
trigger1 = time = 4
ignorehitpause = 1
anim = 1222
id = 1222
pos= 0,0
postype = P1
removetime = 9999
supermove = 10
sprpriority = 2
removeongethit = 1
ownpal = 1

[State 1220, End]
type = ChangeState
trigger1 = (command != "HOLDX") || (command != "HOLDY")
value = 1221

;======================================================================
; ++Chi Power (Retire Charge) =========================================
;======================================================================

[Statedef 1221]
type = S
movetype = I
physics = S
anim = 1221
ctrl = 1

[State 1221, StopSnd]
type = StopSnd
trigger1 = Time = 0
channel = 1

[State 1221, 2]
type = removeexplod
trigger1 = Time = 0
id = 1222

[State 1221, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1




THE CMD
Code:
;Chi Focus
[State -1, Chi Focus]
type = ChangeState
value = 1220
triggerall = power < 5000
trigger1 = command = "HOLDX"
trigger1 = command = "HOLDY"
trigger1 = stateno = 0
trigger1 = ctrl

The animation (along with its explod



theres a loop in the last two frames obviously.


;++Chi Power (Focus Charge)
[Begin Action 1220]
Clsn2: 3
  Clsn2[0] = -23, -43, 27, -2
  Clsn2[1] = -15, -77, 20, -42
  Clsn2[2] = -13, -102, 22, -67
1220,0, 0,0, 2
Clsn2Default: 2
  Clsn2[0] = -19, -100, 20, -41
  Clsn2[1] = -27, -41, 29, 0
1220,1, 0,0, 2
1220,2, 0,0, 2
1220,3, 0,0, 2
1220,4, 0,0, 2
1220,5, 0,0, 2
Loopstart
1220,6, 0,0, 2
1220,7, 0,0, 2

;The animation of the character stop the chi focus is the reverse animation of him doing it.


;++Chi Power (Action Graphic)
[Begin Action 1222]
1222,0, 0,0, 2
1222,1, 0,0, 2
1222,2, 0,0, 2
1222,3, 0,0, 2
1222,4, 0,0, 2
1222,5, 0,0, 2




 Once again, WTF gives???
Re: Charging meter (KOF style) and another prob I'm havin'
#2  September 24, 2007, 04:34:04 pm
  • *****
  • corner push pusher
The other problem I'm having is concering directional CMDs.  My character can do simple hadouken-ish CMDs, but doing the shinkyuu hadouken-ish motion (D, Df, F, D, DF, F, x) is a no go.

I have no command buffer time set. Commands are assigned like this:

name = "Super01"
command = ~D, DF, ~F, D, DF, ~F, X
time = 1

The hadouken CMDs also work too well.  The character doesn't have any restrictions as to how many times it can pull off a projectile. Where am I going wrong?  Bah....I'm pretty sure I'm gonna release a beta tomorrow so yall can see what I'm talking about.
Re: Charging meter (KOF style) and another prob I'm havin'
#3  September 24, 2007, 05:12:39 pm
  • ******
  • [E]
    • Mexico

  • Online
in this case, it would be good to have the two questions separated, no biggie, though.

for the chargning problem, do you have animation 1221 ? there seems to be a problem concerning it, it either does not exist or it has infinite loop, any of those two conditions get p1 stuck in state 1221. use the debug (ctrl+d) to check in which state is p1 stuck.

for the second one, the changestates for the supers must be before the changestates for the specials, or being more specific, command that require a more complex command input should be trioggered before commands that require a simpler one, if they overlap.

still, that is not the problem, time =1 in your cmd means that you have only one tick to input the command, making it impossible to input for a human or non cheating ai. change time = 1 to a more sensible value like 30.
Re: Charging meter (KOF style) and another prob I'm havin'
#4  September 24, 2007, 05:27:30 pm
  • *****
  • corner push pusher
in this case, it would be good to have the two questions separated, no biggie, though.

for the chargning problem, do you have animation 1221 ? there seems to be a problem concerning it, it either does not exist or it has infinite loop, any of those two conditions get p1 stuck in state 1221. use the debug (ctrl+d) to check in which state is p1 stuck.

for the second one, the changestates for the supers must be before the changestates for the specials, or being more specific, command that require a more complex command input should be trioggered before commands that require a simpler one, if they overlap.

still, that is not the problem, time =1 in your cmd means that you have only one tick to input the command, making it impossible to input for a human or non cheating ai. change time = 1 to a more sensible value like 30.

The 1221 anim is 1220 backwards.  More specifically, the first three frames of 1220 backwards.  If you look in the 1220 anim code I posted the loopstart starts at 1220,6, 0,0, 2.  I wonder if that's the problem.....changing the "2" into a -1 sounds like a nice solution to stopping the infinite but I'm pretty sure that's bullshit.

As far as the CMDs go I see your point.  I originally had the time set to 30 but changed it because it didn't work (i.e., the changestates for supers and specials in the wrong spot).

Quote
the changestates for the supers must be before the changestates for the specials, or being more specific, command that require a more complex command input should be trioggered before commands that require a simpler one, if they overlap.

Just out of curiosity, why is this so? Why/how do they overwrite each other if the changestates are set the ignorant way that I set them?
Re: Charging meter (KOF style) and another prob I'm havin'
#5  September 24, 2007, 05:45:29 pm
  • ****
  • Coming Soon?
as far as too many projectiles is concerned...(spamming hadoukens and having 40 on the screen at once everytime you do QCF)

You have to put the limits on them yourself.

In the cns for the projectile have the projID line and set it equal to something.
Then in the .cmd where the changestate triggers are have a trigger that says if number of projectiles with such an such an idea is less than some limit lets say one.  you can check the docs for numProj I believe it is.

That way you can't spam projectiles like megaman.
Latest Yoshi alpha ready for feedback Aug 15th check here for details...
Re: Charging meter (KOF style) and another prob I'm havin'
#6  September 24, 2007, 05:55:02 pm
  • *****
  • corner push pusher
Something like this?:

somewhere in the CNS:
projID = 2900
trigger1 = NumProj = 1

in the CMD:
[State -1, DB POW Projectile]
type = changestate
value = 2900
trigger1 = NumProjID(2900) = 1
...and so forth with the other parts of the code


I dunno if this makes a difference or not but, I should point out that this is not a horizontal projectile. It's a vertical beam.
Re: Charging meter (KOF style) and another prob I'm havin'
#7  September 24, 2007, 06:17:18 pm
  • ******
  • [E]
    • Mexico

  • Online
it might be unrelated, but you have ctrl =1 on your statedefs, that introduces some bugs, so change it to ctrl = 0, unless you have a very specific reason to put ctrl= 1 if you are doing it on purpose.

about the projectile bit, one normally check numproj < X, where X is the limit on your projectiles.
Re: Charging meter (KOF style) and another prob I'm havin'
#8  September 24, 2007, 06:22:04 pm
  • *****
  • corner push pusher
it might be unrelated, but you have ctrl =1 on your statedefs, that introduces some bugs, so change it to ctrl = 0, unless you have a very specific reason to put ctrl= 1 if you are doing it on purpose.

about the projectile bit, one normally check numproj < X, where X is the limit on your projectiles.

Motherfu....I see what you're talking about, in the statedef of him starting the chi focus.  Ugh, it's always the little differences that get overlooked that become a bane in coding. Right on for pointing it out (I would've figured it out eventually, but not before I lost my mind).