Question on this code (Read 658 times)

Started by cake-kun, July 19, 2018, 12:36:16 am
Share this topic:
Question on this code
New #1  July 19, 2018, 12:36:16 am
  • avatar
  • *
So im working on trying to make a character have multiple transformations so i mostly use  Type = changeanim but takes to long to change every hit animation and moving etc.  i noticed some characters created by mikel888  have this code
[State -3, VarSet, Golpeado]
type = VarSet
trigger1 = var(2) = 5
v = 10
value = 13000
this makes the form have different being hit animations from the normal form but he didnt change them one by one  he just has this code how does this work? how could i code this myself dont really understand how he made his character have different being hit animations with just this code
Last Edit: July 25, 2018, 04:06:18 am by cake-kun
Re: Question on this code
#2  July 19, 2018, 05:26:15 am
  • ****
  • Robotics Engineer
    • USA
Do a search for "var(10)" and you'll probably find that it is factored into the "anim" parameter of every ChangeAnim.
anim = (default anim #) + var(10)
So if var(10) gets set to 13000.... well it will add 13000 and use that anim instead

Re: Question on this code
#3  July 19, 2018, 09:42:26 am
  • avatar
  • *
okay thanks i got it i just have one more question about this whole thing so the  value = 13000 the 13000 is the new anim that replaces the old cause of the var(10)  but  where is he setting the sprites to be in 13000 don't see it anywhere  not in air. file or anywhere not even in group and just with that code it switches all the hit sprites
Last Edit: July 19, 2018, 09:49:35 am by cake-kun
Re: Question on this code
#4  July 21, 2018, 11:43:22 pm
  • *****
  • Shame on you!
    • USA
So if I'm understanding this correctly, the person hasn't set up a standardized Anim method. He's probably got random Anim numbers for each special and for each transition/mode he has individual states that call those specific numbers.
Because he's adding 13000 to the "beaten" states, you'd probably be adding 13000+5000. Look for animations in the 18000 to 18300 range. Those should be hit reactions.
Also if you check out the hit reaction Statedefs you may see the math altoiddealer described. It may not be exactly the same because there's always different ways math can be written.
vVv Wheat Stage Released vVv