collapse

Author Topic: Help with Super Armour  (Read 1321 times)

0 Members and 1 Guest are viewing this topic.

Offline -Whiplash-

  • Prince of Latis
  • RMM Contributor
  • ****
  • Posts: 1754
  • Country: Canada ca
  • Last Login:December 25, 2021, 12:18:48 AM
  • Destroy the Core!
    • Email
Help with Super Armour
« on: August 19, 2015, 04:02:35 PM »
So I'm making a character with super armour in one of his hypers.

Basically I have a hitoverride that looks like this in the hyper states:

Code: [Select]
[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AT, AP
stateno = 3004
time = 1

Then state 3004 looks like this:

Code: [Select]
;---------------------------------------------------------------------------
;Super Armour
[Statedef 3004]
type = U
movetype = H
physics = U

[State 9000, ChangeAnim]
type = ChangeAnim
trigger1 =1
value = Anim
elem  = var(41)

[State 9000, End]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 9000, End]
type = ChangeState
triggerall = Alive
trigger1 = Time >= floor(gethitvar(hittime) * 0.8)
value = var(42)
Var 41 and 42 are in state -2.

Code: [Select]
;--------------------------
;Super armour vars

[State 0, VarSet]
type = VarSet
trigger1 = movetype !=H || stateno!= 3004
v = 41    ;fv = 10
value = animelemno(0)
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = Life > 1
trigger1 = StateNo != 3004
var(42) = StateNo
ignorehitpause = 1
var 41 keeps track of the anim elem the character is at and var 42 keeps track of the stateno before they got hit

However. when I use this method instead of returning the properstate when hit the character gets sent to state 0 and loses control. what am I doing wrong here?



Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: Help with Super Armour
« Reply #1 on: August 20, 2015, 04:30:00 AM »
It's not how i would do it, but it is technically right otherwise.

So what you have to do now is establish the fault. Lets see what the value of var(42) actually is

[State -2]
type = displaytoclipboard
trigger1 = 1
params = var(42), var(41)
text = "%d anim, %d frame"

Chuck that in, turn on debug mode. Watch what the values do. If they never change, or change to the wrong things, you know when code is breaking.

Also, although i believe you about the "in state -2" bit, there is nothing in that code to indicate it's state -2ness. So they're under the line [Statedef -2]? I don't see it there and well, they aren't labeled as state -2 states (although that bit's not actually required)

Offline -Whiplash-

  • Prince of Latis
  • RMM Contributor
  • ****
  • Posts: 1754
  • Country: Canada ca
  • Last Login:December 25, 2021, 12:18:48 AM
  • Destroy the Core!
    • Email
Re: Help with Super Armour
« Reply #2 on: August 20, 2015, 11:11:09 AM »
Yeah, I don't tend to label my states (just insert from FF3's insert thingy...)

but yes they are definitely in statedef -2.

anyway, var(42) works correctly up until when he gets hit is coming up as "-1" which is... odd to say the least.

Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: Help with Super Armour
« Reply #3 on: August 21, 2015, 02:06:23 AM »
Uh, you must be re-using it somehow. It should be going to 5000 or what have you in that situation assuming it's broken. -1 is not at all what i would expect.

Search for duplicates of it, it could be dizzy code or something?

Otherwise i'm a bit lost and would need to see the whole character to work out what's going on at this point. I mean, you could get into prevstateno, but generally you want the var in case the super armour can get hit into itself.

Offline -Whiplash-

  • Prince of Latis
  • RMM Contributor
  • ****
  • Posts: 1754
  • Country: Canada ca
  • Last Login:December 25, 2021, 12:18:48 AM
  • Destroy the Core!
    • Email
Re: Help with Super Armour
« Reply #4 on: August 21, 2015, 11:45:03 PM »
no it's not in any other states...

Also, using prevstateno gets me sent to state 5000 almost instantly, and setting the var inside the state doesn't work either... it's weird, also var(41) isn't being read in that state either. It's like it stoping reading/calculating it there. maybe it's my hitoveride?

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = SCA, AA, AT, AP
stateno = 3004
time = 1

It's weird, feels like somehow being put in that state causes mugen to forget everything.
« Last Edit: August 22, 2015, 12:15:54 AM by -Whiplash- »

Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: Help with Super Armour
« Reply #5 on: August 22, 2015, 03:42:06 AM »
Are you OK to pastebin your whole CNS file so i can take a look at everything? I would expect the var to hit 5000. Your hitoverride obviously functions because you are winding up in state 3004. If you weren't then the super armour code you have would outright not work. Which we can confirm is not the case. It's not working all the way, but it is working.

Offline -Whiplash-

  • Prince of Latis
  • RMM Contributor
  • ****
  • Posts: 1754
  • Country: Canada ca
  • Last Login:December 25, 2021, 12:18:48 AM
  • Destroy the Core!
    • Email
Re: Help with Super Armour
« Reply #6 on: August 22, 2015, 01:38:56 PM »
okay. I've PMed you though since this isn't my character, I'm just coding it for someone else and they want it kept private for now.

Offline Cyanide

  • MUGEN Content Architect
  • *****
  • Posts: 813
  • Last Login:March 29, 2019, 06:52:34 AM
    • Mugen Obscurity
Re: Help with Super Armour
« Reply #7 on: August 22, 2015, 08:45:59 PM »
You have a lot of debug spam, you should attempt to fix that.

You ARE using var(42) elsewhere. It is being initialised at -1. I searched through the files (basic search) and didn't find it being set specifically. However i did find that it is mentioned in one line regarding sparks. Both 42 and 41. And as they're attached to stuff like ground.front.dist it's totally not related to what you're trying to use it for.

pos= (enemynear,const(size.ground.front) + var(42)) * (enemynear,facing) * (-facing), floor(pos y-enemynear,pos y) + var(43)

That line. Now, this said to me, it is being set, i don't know how, i'm not working it out, lets try a different variable. So i have plugged in var(31) and var(32) and the displaytoclipboard NOW correctly displays the animation i am in (i made some other changes to prove this to myself)

With var(32) in place he now stays locked in state 3000 or something, he doesn't go into any hit states. You may still want to work on it a bit, you hitting him reset's the bounce on the bouncing thing which i wouldn't have thought was wanted.

tl;dr: Var(42) is used, used var(32) problem went away.

Offline -Whiplash-

  • Prince of Latis
  • RMM Contributor
  • ****
  • Posts: 1754
  • Country: Canada ca
  • Last Login:December 25, 2021, 12:18:48 AM
  • Destroy the Core!
    • Email
Re: Help with Super Armour
« Reply #8 on: August 23, 2015, 12:40:52 AM »
Oh. I didn't think to check the cmd. my bad.

Thanks a lot. Now I can finally finish this character. it was pissing me off.

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

April 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

SimplePortal 2.3.5 © 2008-2012, SimplePortal