Sign in to follow this  
Nep Heart

Initiating Commands During Custom States

1 post in this topic

 Boy, is this sub-forum section barren... lemme fix that quickly.

 

 These pieces of code are what I came up with when I was working on a solution of making my own characters' be able to burst during custom states. It allows command usage while your character is in custom state and since I implemented them in all my characters, it should work in the majority of cases with exceptions like custom states that put the character in a non-hit state. First of all, in the character's CMD, put a triggerall for "!ishelper" so that the buffering doesn't clash with the helper that buffers the command.

----------------------------------------------

 

Quote

[State -2, Burst During Custom States]
type = Helper
triggerall = numhelper(5970) <= 0
trigger1 = movetype = H
pos = 9999,9999
name = "Burst"
id = 5970
postype = p1
stateno = 5970
keyctrl = 1

 

 This goes under the character's statedef -2. What it does is call a helper whenever the character is put into a hitstate that is there to buffer the command of your choice. The "keyctrl = 1" part allows the helper to read from your own character's state files while in custom state since, normally, a character in custom state is forced to read from P2's state files (also why it's in -2 and not in -3).

Quote

 

; Burst Buffer

[Statedef 5970]

velset = 0,0

anim = 1 ; <---- must be an invisible animation with no hurtbox or hitbox.

ctrl = 0

 

[State 5970, Invuln]; <---- just in case

type = nothitby

trigger1 = 1

value = sca

ignorehitpause = 1

 

[State 5970, Burst] ; <---- this resets the variable to zero anytime the character is in hit state

type = Varset

trigger1 = root,movetype != H

trigger1 = var(40) > 0

var(40) = 0

 

[State 5970, Burst] ; < --- the variable activates the moment the command of your choice is initiated

type = Varset

triggerall = var(40) <= 0

triggerall = numenemy

triggerall = root,alive

triggerall = root,movetype = H

triggerall = root,stateno != [120,155]

triggerall = root,stateno != [800,899]

triggerall = root,stateno != [3000,4999]

triggerall = enemy,movehit && p2stateno != [3000,4999]

triggerall = enemy,movehit && p2stateno != [800,899] ; <--- the bolded are optional, which disallows for taking action during guard states as well as the opponent' normal throws and supers. 

trigger1 = command = "Burst" ; <--- can be any command of your choice

var(40) = 1

 

[State 5970, End] ; <--- the helper's lifetime expires once the character is no longer in hit state

type = destroyself

trigger1 = root,movetype != H

ignorehitpause = 1

 

 

 This is the helper state itself. It's necessary so that there can be something there to read commands from your character's own files.

Quote

 

[State -2, Burst During Custom States]

type = selfstate ; <--- It must be seflstate, changestate would make your character go into p2's states otherwise

value = 5960

triggerall = numhelper(5970)

triggerall = var(48) <= 0

triggerall = numenemy

triggerall = enemy,hitdefattr != SCA,HA,HP,NT,ST,HT

triggerall = stateno != [120,155]

triggerall = stateno != [800,899]

triggerall = stateno != [3000,4999]

triggerall = enemy,movehit && p2stateno != [3000,4999]

triggerall = enemy,movehit && p2stateno != [800,899] ; <--- bolded are optional, the variable here is also completely unrelated to this command buffering unlike the variable below

triggerall = helper(5970),var(40) > 0 ; <--- this reads the variable set by the helper

trigger1 = statetype != L; <--- optional

trigger1 = movetype = H

 

 

 This also must be under statedef -2, your character will break out of the custom state that p2 placed them in and will successfully go into their own state of choice.

 

 There is likely some imperfections, but it should work as intended for most cases.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this