YesNoOk
avatar

Custom animation for my character (Read 1529 times)

Started by KaedeMonthmore, May 16, 2018, 12:02:46 pm
Share this topic:
Custom animation for my character
#1  May 16, 2018, 12:02:46 pm
  • avatar
  • Little Aprentice
I'll try to design a custom anim for my character, but this anim isn't apply for him and uses default anim, showing wrong sprites. I'm sure if triggers is right, so why the code isn't apllyed? I'm making something wrong?
Code:
[Statedef 270]
type    = S
movetype= H
physics = N
velset = 0,0

[State 270]
type = VelSet
trigger1 = time > 14
x = 0
y = 10

[State 270]
type = ChangeAnim2
triggerall = enemy,name = "God-Normal-Rugal"
triggerall = selfanimexist(10270)
trigger1 = Time = 0
value = ifelse(var(26)=0,10270,270)

[State 270]
type = ChangeAnim2
Trigger1 = Time = 0
value = 270

[State 270]
type = EnvShake
trigger1 = Vel Y > 0 && Pos Y >= 0
Time = 12
ampl = 3
freq = 80

[State 270]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
trigger2 = time = 100
value = 5100
Re: Custom animation for my character
#2  May 16, 2018, 07:25:24 pm
  • *****
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Quote
[State 270]
type = ChangeAnim2
triggerall = enemy,name = "God-Normal-Rugal"
triggerall = selfanimexist(10270)
trigger1 = Time = 0
value = ifelse(var(26)=0,10270,270)

This controller checks if your OWN character has anim 10270. It's not checking if the enemy has the same animation.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: Custom animation for my character
#3  May 17, 2018, 01:38:18 am
  • *****
  • Shame on you!
    • USA
Also, you have a changeanim2 that looks for a specific set up in it's triggers, and then you have a general changeanim2.
The second changeanim2 will work over the first one. So even if the first one changes the animation, it'll still be changed to anim 270. You will NEVER see anim 10270. Put the second changeanim2 above the first one. Like this:

[State 270]
type = ChangeAnim2
Trigger1 = Time = 0
value = 270

[State 270]
type = ChangeAnim2
triggerall = enemy,name = "God-Normal-Rugal"
triggerall = selfanimexist(10270)  ;you may need to change this like XGargoyle mentioned.
trigger1 = Time = 0
value = ifelse(var(26)=0,10270,270)
 
vVv Wheat Stage Released vVv
Re: Custom animation for my character
#4  May 18, 2018, 02:08:29 pm
  • avatar
  • Little Aprentice
Quote
[State 270]
type = ChangeAnim2
triggerall = enemy,name = "God-Normal-Rugal"
triggerall = selfanimexist(10270)
trigger1 = Time = 0
value = ifelse(var(26)=0,10270,270)

This controller checks if your OWN character has anim 10270. It's not checking if the enemy has the same animation.

Yeah, it's right, this prevent show nothing if exist another character with same name but without this animation. (I know, enemy,displayauthor is more easy to avoid it, i'll change this soon)
Also, you have a changeanim2 that looks for a specific set up in it's triggers, and then you have a general changeanim2.
The second changeanim2 will work over the first one. So even if the first one changes the animation, it'll still be changed to anim 270. You will NEVER see anim 10270. Put the second changeanim2 above the first one. Like this:

[State 270]
type = ChangeAnim2
Trigger1 = Time = 0
value = 270

[State 270]
type = ChangeAnim2
triggerall = enemy,name = "God-Normal-Rugal"
triggerall = selfanimexist(10270)  ;you may need to change this like XGargoyle mentioned.
trigger1 = Time = 0
value = ifelse(var(26)=0,10270,270)
 
I dont believe that i make this sillyness :rolleyes5:. Now the code works perfectly. Thanks people!