Jump to content
  • 0

Changing Fighting Stance/Style


LeDavid

Question

4 answers to this question

Recommended Posts

  • 0

I mean it'd depend on how you want the stance to change. Is it simply a button press that changes it, is it because the HP is low, etc.

 

Like DarkFlare said, it'd required a variable if you wanted the stance to stay changed until whatever the above requirement would be changes.

For example sake, let's say it was when your HP is low.

_________________________________________________________________________________________________________________

Lets say this is state 0/the stand state

[StateDef 0]
type = S
physics = S
moveType = I
velSet = 0,0
sprPriority = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
value = 0

[State 0, Dead]
type = ChangeState
trigger1 = !Alive
value = 5050

To do what you want, you'll want something like this

[StateDef 0]
type = S
physics = S
moveType = I
velSet = 0,0
sprPriority = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
value = Cond(Var(x)=1,a,b)

[State 0, Dead]
type = ChangeState
trigger1 = !Alive
value = 5050

X isn't a real variable just a placeholder for whatever number you'd want to use.

a and b aren't real either, just placeholders for your anim numbers

 

What this means is, if Var x is active/equal to 1, then use anim a for the stance. If it doesn't equal 1, then use anim b.

 

Now you wanna define what this variable is

 

[state 0, VarAdd]

type = VarSet

trigger1 = life <= 500

v = (x)

value = 0

 

[state 0, VarAdd]

type = VarSet

trigger1 = life > 500

v = (x)

value = 1

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

So your code becomes

[StateDef 0]
type = S
physics = S
moveType = I
velSet = 0,0
sprPriority = 0


[State 0, Alt.Stance]
type = VarSet
trigger1 = life <= 500 ;if your HP is less than or equal to 500
v = (x) ;you choose this number
value = 0

[State 0, Normal Stance]
type = VarSet
trigger1 = life > 500 ;if your HP is more than 500
v = (x) ;you choose this number
value = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
value = Cond(Var(x)=1,a,b)

[State 0, Dead]
type = ChangeState
trigger1 = !Alive
value = 5050

You can use other values but to make this simple, i used those.

 

the code i wrote can prob be condensed a little because iirc just using Var(x) without the =1 will give the same result

Link to comment
Share on other sites

  • 0

TBH I know very little coding (and the little coding I know is how to pause or play an animation in flash) so if you don't mind me asking, what would the code look like if the changing mechanic was mapped to a single button? Say, the X button?

Link to comment
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
×
×
  • Create New...