collapse

Author Topic: how to have two animation in changeanim  (Read 612 times)

0 Members and 1 Guest are viewing this topic.

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
how to have two animation in changeanim
« on: May 22, 2015, 03:45:23 AM »
I would like to have two different animation randomly displayed when player's life goes under 800 lp, i already tried using a vriable but nothing I wrote this in statedef 0

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = life <= 800 && Animtime = 0
trigger1 = 1
value = ifelse(var(21)!=0,1,3)

but mugen display only the anim number 1



Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: how to have two animation in changeanim
« Reply #1 on: May 22, 2015, 05:02:36 AM »
The variable isn't set by anything. I don't think that code is going to work anyway but

value = ifelse(random < 500, 1,3)

Will do something at least.

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
Re: how to have two animation in changeanim
« Reply #2 on: May 22, 2015, 06:27:40 AM »
I tried your code but not work as I wanted

Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: how to have two animation in changeanim
« Reply #3 on: May 22, 2015, 06:45:05 AM »
Not entirely surprised. You have to do a much longer form of it to make it function how you'd expect.

As such


[State 0, 1]
type = ChangeAnim
triggerall = Life > 800
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 1]
type = ChangeAnim
triggerall = Life <= 800
trigger1 = (Anim != 0 || anim != 3) && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
trigger3 = (anim = 0 || anim = 3) && animtime = 0
value = ifelse(random < 500, 0,3)

And i'm not entirely positive about this one either. Basically you need to tell mugen exactly what to use and when. You could set up a randomly set variable that bounces between 0 and 3 when animtime = 0 in either of those animations and use anim != var(21) value = var(21) which might be easier to do tbh.

varset
triggerall = life <= 800
trigger1 = anim = 0 || anim = 3
trigger1 = animtime = 0
v = 21
value = ifelse(random < 500, 0,3)

changeanim
anim != var(21)
value = var(21)

Possibly. I'd need to play round with it to perfect it, so you will too.

Offline Demongorne

  • Initiate
  • **
  • Posts: 81
  • Last Login:March 19, 2022, 06:22:07 AM
    • Email
Re: how to have two animation in changeanim
« Reply #4 on: May 22, 2015, 06:58:36 AM »
If can be useful i  post the link with char

the state in question is statedef 0 the animations are 1 & 3
« Last Edit: May 23, 2015, 03:35:38 AM by Demongorne »

Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: how to have two animation in changeanim
« Reply #5 on: May 22, 2015, 10:09:46 PM »
I'm not doing it for you. I've given you 2 options so far. To get it right i would have to code the whole thing, testing it at each step to make sure it was working. You should follow this process too. It's a method of learning. The code is there, it just needs to be tested and tweaked. You don't truly even need the ifelse if you use the variable method. You can just set up a second changeanim and use the variable for it. There are about 4 ways to do this.

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

* IMT Calendar

May 2024
Sun Mon Tue Wed Thu Fri Sat
1 2 [3] 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

SimplePortal 2.3.5 © 2008-2012, SimplePortal