YesNoOk
avatar

Projectile Is Not Working (Read 807 times)

Started by Monday-Night-War, August 18, 2009, 03:51:20 pm
Share this topic:
Projectile Is Not Working
#1  August 18, 2009, 03:51:20 pm
  • ***
  • The New Age Of Mugen
This code worked for one of my characters but everytime i try to use the move it crashes mugen, any ideas? here's the cns code:

Code:
;Ki Blast
[StateDef 6000]
type = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
anim = 6000
poweradd = 20

[State 6000, 1]
type = Projectile
trigger1 = AnimElem = 18
projanim = 6010
projhitanim = 6011
projpriority = 1
projheightbound = -100, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 30,-10
velocity = 3
attr = S, SP
damage   = 150
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

[State 6000: EnvColor]
type = EnvColor
trigger1 = (Time < 100)
value = (Time*4),(Time*4),(Time*4)
time = 1
under = 1

[State 6000: AllPalFX]
type = AllPalFX
trigger1 = (Time < 150)
time = 1
add = 0,0,0
mul = 256,256,256
sinadd = 0,0,0,1
invertall = 0
color = (Time*5)

[State 6000: Pause]
type = Pause
triggerall = (GameTime%1) = 0
trigger1 = Time = [0,20];[Insert trigger here.]
time = 1
movetime = 1
ignorehitpause = 5

[State 6000: EnvShake]
type = EnvShake
trigger1 = (!Time)
time = 200
freq = 230
ampl = -3
phase = 90

[State 6000, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

And here's the command:

Code:
;Ki Blast
[State -1, Ki Blast]
type = ChangeState
value = 6000
triggerall = command = "down_a"
trigger1 = statetype = S
trigger1 = ctrl
triggerall = power >= 330

Re: Projectile Is Not Working
#2  August 18, 2009, 03:54:41 pm
  • ******
what do you mean it crashes

You can't put a triggerall after a trigger1, they have to be in order, triggeralls first, then your trigger1s, 2s etc.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#3  August 18, 2009, 03:59:51 pm
  • ***
  • The New Age Of Mugen
It keeps saying that windows has encountered a problem i click ok and then it goes off. i put the pause command before all of the trigger 1's and it still crashed, what can i do?
Re: Projectile Is Not Working
#4  August 18, 2009, 04:11:29 pm
  • ******
triggerall = command = "down_a"
trigger1 = statetype = S
trigger1 = ctrl
triggerall = power >= 330




Remove your blocks of code one by one (first remove the envcolor, then remove the projectile, then remove the pause...) and test each time if it crashes. It might also be a problem with the SFF.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#5  August 18, 2009, 04:16:02 pm
  • ***
  • The New Age Of Mugen
I removed the life add, and all other code other than the projectile one by one and still no success, then i redid the projectile code and still nothing, what can i do to the sff, reupload the sprites?
Re: Projectile Is Not Working
#6  August 18, 2009, 04:19:11 pm
  • ******
If it still crashed when you removed the entire code inside your move (including the projectile), then yes, it's probably the SFF. Remove the sprites and make sure you readd them properly.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#7  August 18, 2009, 04:22:53 pm
  • ***
  • The New Age Of Mugen
it only crashes when i attempt the move, everything else works fine, i re-uploaded the sprites and it still crashed when i tried the move, is there anything else i can do? sorry for the trouble
Re: Projectile Is Not Working
#8  August 18, 2009, 06:34:21 pm
  • ******
-Delete the sprites you last added from your SFF and then in the code, when creating the projectile, simply have it use another animation (even if you tell it to use your character's standing animation, it's fine, it's just for test)
-Redo the code from the ground up, using something you KNOW works (like, from another character, and you just change the values)

One of them is bound to fix your problem, and then you'll know exactly what causes it when it starts working... -_- It's either the  SFF or the code.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#9  August 18, 2009, 07:24:15 pm
  • ***
  • The New Age Of Mugen
i did what you told me to dao and i even used the projectile template provided by UFF, and it did the same thing, i changed the sprites and all, i'm so confused
Re: Projectile Is Not Working
#10  August 18, 2009, 07:27:18 pm
  • ******
Quote
and i even used the projectile template provided by UFF
Yeah you know what I'll make a guess and say that's your problem right here DON'T DO THAT EVER AGAIN. I said use one you know is working. Templates are retarded.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#11  August 18, 2009, 07:31:44 pm
  • ***
  • The New Age Of Mugen
okay, well i used the ame exact code and template on my other character and their move works just fine, but alrite i will look at another character's code and try it out, why wouldn't it work the same way it did last time?(curious)
Re: Projectile Is Not Working
#12  August 18, 2009, 09:18:28 pm
  • ***
  • The New Age Of Mugen
I've realized that even when there is no command, and i press the simple combination(Down_a) Mugen still crashes, whats going on?
Re: Projectile Is Not Working
#13  August 18, 2009, 09:53:09 pm
  • ******
Hum, can you make sure there isn't another state / changestate that uses down_a as a trigger ?
Try changing the command to something else (still leave it with the name down_a) and do the new command, if it still crash it's something that calls the command "down_a", if not it's something that involves a combination of down and a.

On the templates, they're bad because most of the time they have parameters that aren't really needed or set with a default value that you will overlook and it turns out it'll give you an error, things like that. It's the big problem with any sort of automated tools and templates : sometimes they do things by default that you don't realize or don't understand and it turns out it makes your stuff crash one way or another, or it requires you to specify a value and you forget to do it (the worse case is when the template itself is fucked up, when it has a screwed syntax or something - that does happen). It's just easier to never trust any automated tools that you don't know what exactly they do, as a general rule, in the long run it's simpler to just learn how to do it yourself and then copy-paste because you know exactly what values and parameters you set. It's just safer and it saves you time for troubleshooting - if you used some automated tool or template and there's a problem somewhere and youdon't know where it is, you'll always keep a doubt that maybe it's the template because you didn't double-check it and you don't know what it did. If you did it yourself, simple typos aside, you immediately know what you did and if it crashes, you know where it comes from.
Well, if you used the exact same piece of code on another character and it worked, there shouldn't be much problem other than the values.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: August 18, 2009, 09:56:56 pm by Byakko
Re: Projectile Is Not Working
#14  August 18, 2009, 10:33:40 pm
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
I've realized that even when there is no command, and i press the simple combination(Down_a) Mugen still crashes, whats going on?
Do you have crouching moves? I mean, down+a could be picking up on that.

Look through the .cmd (or post it here) and we can see what down+a is picking up on.

Normally when there's no actual fault message it's a "you've fucked up your sff file" thing. Or you're using the elecbyte template and something, as usual, is corrupt.


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: Projectile Is Not Working
#15  August 18, 2009, 10:51:06 pm
  • ***
  • The New Age Of Mugen
CMD:
Code:
[command]
name = "Dash_Z"
command = F,F,z
time = 5

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"
command = F,F,
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "start"
command = s
time = 1

[command]
name = "QCB_xy"
command = U,F,B,x,y
time = 0

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

;------Air Movement Commands--------
;Air Movement
[Command]
name = "uf"
command = /UF
time = 1

;Air Movement
[Command]
name = "ub"
command = /UB
time = 1

;Air Movement
[Command]
name = "df"
command = /DF
time = 1

;Air Movement
[Command]
name = "db"
command = /DB
time = 1

;Air Movement
[Command]
name = "up"
command = /U
time = 1

;Air Movement
[Command]
name = "down"
command = /D
time = 1

;Air Movement
[Command]
name = "fow"
command = /F
time = 1

;Air Movement
[Command]
name = "back"
command = /B
time = 1

;Wall Jump
[State -1:ChangeState]
type = ChangeState
value = 40
triggerall = (StateType = A) && (Ctrl) && (Pos Y < -30)
trigger1 = ((command = "holdup") && (command = "holdfwd") && (Vel X <= 0) && (backedgebodydist <= 10) && (backedgebodydist > -10))
trigger2 = ((command = "holdup") && (command = "holdback") && (Vel X >= 0) && (frontedgebodydist <= 10) && (frontedgebodydist > -10))
persistent = 0

;---------------------------------------------------------------------------
; 2. State entry
; --------------
; This is where you define what commands bring you to what states.
;
; Each state entry block looks like:
;   [State -1, Label]           ;Change Label to any name you want to use to
;                               ;identify the state with.
;   type = ChangeState          ;Don't change this
;   value = new_state_number
;   trigger1 = command = command_name
;   . . .  (any additional triggers)
;
; - new_state_number is the number of the state to change to
; - command_name is the name of the command (from the section above)
; - Useful triggers to know:
;   - statetype
;       S, C or A : current state-type of player (stand, crouch, air)
;   - ctrl
;       0 or 1 : 1 if player has control. Unless "interrupting" another
;                move, you'll want ctrl = 1
;   - stateno
;       number of state player is in - useful for "move interrupts"
;   - movecontact
;       0 or 1 : 1 if player's last attack touched the opponent
;                useful for "move interrupts"
;
; Note: The order of state entry is important.
;   State entry with a certain command must come before another state
;   entry with a command that is the subset of the first.
;   For example, command "fwd_a" must be listed before "a", and
;   "fwd_ab" should come before both of the others.
;
; For reference on triggers, see CNS documentation.
;
; Just for your information (skip if you're not interested):
; This part is an extension of the CNS. "State -1" is a special state
; that is executed once every game-tick, regardless of what other state
; you are in.


; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 101
triggerall = Var(2) = 0
trigger1 = (command = "fow") && (statetype = A) && (ctrl = 1)

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 102
triggerall = Var(2) = 0
trigger1 = (command = "back") && (statetype = A) && (ctrl = 1) ;PREVENT

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 103
triggerall = Var(2) = 0
trigger1 = (command = "uf") && (statetype = A) && (ctrl = 1) ;PREVENT

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 104
triggerall = Var(2) = 0
trigger1 = (command = "ub") && (statetype = A) && (ctrl = 1) ;PREVENT

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 106
triggerall = Var(2) = 0
trigger1 = (command = "down") && (statetype = A) && (ctrl = 1)

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 107
triggerall = Var(2) = 0
trigger1 = (command = "df") && (statetype = A) && (ctrl = 1)

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 108
triggerall = Var(2) = 0
trigger1 = (command = "db") && (statetype = A) && (ctrl = 1)

;---------------------------------------------------------------------------
;Air Movement
[State -1]
type = ChangeState
value = 109
triggerall = Var(2) = 0
trigger1 = (command = "up") && (statetype = A) && (ctrl = 1) ;PREVENT

;===========================================================================
;Run Fwd
[State -1, Run Fwd]
type = ChangeState
value = 100
trigger1 = command = "FF"
trigger1 = statetype = S
trigger1 = ctrl
;===========================================================================
;Run Back
[State -1, Run Back]
type = ChangeState
value = 105
trigger1 = command = "BB"
trigger1 = statetype = S
trigger1 = ctrl
;===========================================================================
;Taunt
[State -1, Taunt]
type = ChangeState
value = 195
triggerall = command = "start"
trigger1 = statetype != A
trigger1 = ctrl


;Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200


type = ChangeState
value = 200
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 200
trigger2 = time > 6


;Stand Strong Punch
[State -1, Stand Strong Punch]
type = ChangeState
value = 210


type = ChangeState
value = 210
triggerall = command = "b"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 210
trigger2 = time > 6

;Stand Light Kick
[State -1, Stand Light Kick]
type = ChangeState
value = 230

type = ChangeState
value = 230
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 230
trigger2 = time > 6

;Stand Strong Kick
[State -1, Stand Strong Kick]
type = ChangeState
value = 240

type = ChangeState
value = 240
triggerall = command = "a"
triggerall = command != "holddown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = stateno = 240
trigger2 = time > 6

;Jump Light Punch
[State -1, Jump Light Punch]
type = ChangeState
value = 600


type = ChangeState
value = 600
triggerall = command = "x"
triggerall = command != "holddown"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 600
trigger2 = time > 6

;Jump Strong Punch
[State -1, Jump Strong Punch]
type = ChangeState
value = 610


type = ChangeState
value = 610
triggerall = command = "y"
triggerall = command != "holddown"
trigger1 = statetype = A
trigger1 = ctrl
trigger2 = stateno = 610
trigger2 = time > 6

;Ki Blast
[State -1, Ki Blast]
type = ChangeState
value = 6000
triggerall = command = "down_a"
trigger1 = (statetype = s) && ctrl

I dont have crouch moves, and will not be using them for this character and i'm putting in the right values, I'm also using BC's Template on Ultimate Fighter Factory/Fighter Factory(for palleting)
Re: Projectile Is Not Working
#16  August 18, 2009, 11:17:11 pm
  • ******
First thing is see is that your
Quote
;Wall Jump
[State -1:ChangeState]
type = ChangeState
value = 40
is above statedef -1, that can't work. It has to be below the line that says [statedef -1].

Second, there's a big problem here
Quote
;Stand Light Punch
[State -1, Stand Light Punch]
type = ChangeState
value = 200


type = ChangeState
value = 200
triggerall = command = "x"
You have two type = changestate and value = 200. Same for the
Quote
;Stand Strong Punch
[State -1, Stand Strong Punch]
immediately below that, and the Stand Light Kick below that, and Stand Strong Kick below that, and Jump Light Punch, and Jump Strong Punch and do you even know how to code ??!! Where the hell did that crap come from o_O
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#17  August 18, 2009, 11:20:49 pm
  • ***
  • The New Age Of Mugen
They also came from automated FF templates, i'm a begginer in the coding field but i have made some private characters before just never projectiles, and those puches and kicks work just fine but i will see what i can do on that, did you see anything relating to the projectile?
Re: Projectile Is Not Working
#18  August 18, 2009, 11:23:50 pm
  • ******
I don't even see how it worked before your projectile problem. Clean that first, we'll see then if it still does it.
(see ? Templates.)
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: Projectile Is Not Working
#19  August 18, 2009, 11:26:36 pm
  • ***
  • The New Age Of Mugen
Okay, i leaned the extra type and values for all of the moves, nothing has changed on screen but i have fixed the command codes, what should i do next in the cleaning process, could it have anything to do with
some of the -3 States I've Added? just wondering
Re: Projectile Is Not Working
#20  August 19, 2009, 12:23:30 am
  • ******
What did you add in -3 ? Doubtable it's that, though.

So, let's start over. Do all of this in order, and nothing more than what's here.
Remove the changestate to state 6000. Remove statedef 6000. Remove the sprites.
Test and do the down_a command.
if it doesn't crash, add the changestate to statedef 6000 back triggered by the command down_a.
Make sure you don't already have another statedef 6000 (that isn't the one with your projectile, maybe you're already using that statedef somewhere else).
Add a statedef 6000 that just plays an animation and then ends.
Test and do the command down_a.
If it works, add a type = projectile that uses an existing animation. Any animation, it doesn't matter. A very basic type = Projectile, not one from a template. An empty one that ONLY has the required parameters with some basic values. ONLY that. DO NOT use the same projectile as before, even if it wrked for other characters.
Test the move.
If it works, add the sprites for your projectile back. Double-check the animation in the .air file. Make your projectile use that animation.
Test the move.
If it works and displays the projectile properly, start adding back the envshakes and envcolors and whatever you want.
Test.
If it works, add back the other parameters on the projectile that worked for your other characters and that you removed when putting only a very basic projectile with only the required parameters.
Test.

The thing is, the error HAS to be somewhere. The template, the sprites, the code, the command, the animation, it's somewhere. We are most likely missing something somewhere. So if you want to find it, you'll have to test every single element one by one. Add one, test it, and once you're absolutely sure it works, add the next element, and so on. You're bound to reach a point where, before adding an element, it works, and after, it doesn't work anymore. That element will be the culprit.
That's extensive troubleshooting, that's time-consuming, that's a little annoying and frustrating, but hey, if something doesn't work, that's pretty much the only thing you can do, and that's the very best and very safest way to do it.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: August 19, 2009, 12:28:43 am by Byakko
Re: Projectile Is Not Working
#21  August 19, 2009, 01:01:37 am
  • ***
  • The New Age Of Mugen
FIXED IT!!!!!! It was due to me adding in random code snippets i got from the guild without exactly knowing how everything worked such as "Button Mash Recovery", things that were in my CNS but never worked correctly, so i cleaned it up along with my -3 states and now it works perfectly, from now on i will make mor of an effort into knowing what i'm doing and understanding my actions while working with code. Thanks Byakko for your continuous help, i really appreciate you
Re: Projectile Is Not Working
#22  August 19, 2009, 05:16:31 pm
  • ******
  • [E]
    • Mexico

  • Online
post the animation's code, some animation errors cause mugen to crash like that.