Character transformation (with random notepad - wordpad - ff discussion)

Started by Ssiimmee, November 16, 2010, 09:18:59 AM

Previous topic - Next topic

Ssiimmee

Ok so i got a guy that fights (duh). I wanna make it so that if he has 3 energy bars and a certain key combo is pressed (can do that) he transforms into a different character for like 30 secs to around a minute. I know i need the sprites for the transform and i got them. Just dont know how to do the coding (and the other stuff that might be involved).
Any help appreciated. :)
EDIT: The more detail, the better :o

Cyanide

The more detail?? This is a long convoluted process. It's not at all hard, but it is time consuming.

There are some details in the code library which would really be the right place for you to start here.

How much do you know about the following

Varset
varadd
changeanim
expressions for values like, anim + time*5?
statedef -2

If any of those give you problems right now, you are going to be spending a lot of time on this doing it, getting it wrong, and starting again.

It's not hard but it is a long process if you wanna do it properly.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Ssiimmee

Well, i checked bovery's variable tutorial on youtube, so i know the basics of varset and varadd.
Changeanim i've never used, i'll check the docs and try to figure something out.
I guess i just write time = whateveriwant, else i dont know anything about it.
And nope about the statedef -2.
Is it in the docs? if it is, could i get a link? Or in some tutorial?

Riptide

I want to know about this too. I may have to do something similar in the future. I've used changeanim, it's sort of like changestate.

Ricepigeon

Quote from: Ssiimmee on November 16, 2010, 10:42:32 AM
And nope about the statedef -2.
Is it in the docs? if it is, could i get a link? Or in some tutorial?

-2 is your negative states. It should be in the docs, but just to give you an idea of what they are: Negative states are pretty much what is always occuring. In most situations when you want the same piece of code to activate regardless of what state you are in, you would put it in your negative states.

Ssiimmee

Ok, so then we just gotta wait for an answer of how to do the framsformation ::)

Cyanide

TIPS AND TUTORIALS SECTION.

Start there, TRY IT, then come back and ask questions.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Ssiimmee

Yeah, i have a problem.
How do i get the common.cns file to pop up in the constants?
I heard copy the common.cns into the char folder, but i dont know where it is --;
So where is it? do i steal kfm's?

Riptide

It's in mugen/ data
you need to know what you're doing when you mess with it. I think you should copy it and save a copy to your characters folder just in case you mess up.

Ssiimmee

#9
Yeah, i read all over google in school so i found it, but thanks anyway.
And as i got the transform to work, but not the walking stuff, now i need help again :sugoi:
http://mugenguild.com/forumx/index.php?topic=50702.0
i use that.
So basically my code looks like this:
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, VarSet]
type = varset
trigger1 = time = 570
v = 0
value = 90

[State 0, 1]
type = ChangeAnim
Triggerall = var(0) != 90
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = var(0) = 90  ; This means that you need to be in var 0 and has to be value 90
trigger1 = Anim != 10000 && Anim != 10005    ;Means that it doesent activate when you already is in anim 10000 (SS stand) or in anim 10005 (ss turn anim)
trigger2 = Anim = 10005 && AnimTime = 0 ;Turn anim over
value = 10000 ;changes to anim 10000 (SS stand)

And yes i know that i put time in it, i can do a command too, but just for testing purposes.
And more code:
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

;Transformed
[Statedef 10020]
type    = S
physics = S
sprpriority = 0

[State 10020, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 10020, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 10020, 3]
type = ChangeAnim
triggerall = vel x > 0
trigger1 = Anim != 10020 && Anim != 10005
trigger2 = Anim = 10005 && AnimTime = 0
value = 10020

[State 10020, 4]
type = ChangeAnim
triggerall = vel x < 0
trigger1 = Anim != 10021 && Anim != 10005
trigger2 = Anim = 10005 && AnimTime = 0
value = 10021
That is in the common1.cns
And in the char's cns i have
;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
;Transform
[State -2, Trans]
type = ChangeAnim
trigger1 = Var(0) = 90
trigger1 = Anim < 10000
trigger1 = SelfAnimExist(Anim + 10000)
value = Anim + 10000
The part that's messed up is my walking, i got all the sprites in the correct groups, so i guess it's something with the walk code. So how do i fix it?
Oh and one more thing:
How do i make the transformation end after like 10 seconds? I'm afraid this might work like alarms in gamemaker, check if var = 90 then time = 600 and then change it. But it's 90 thru all transform so does it reset to 600 tichs for every game tick= making it neverending? i edited cuz im not gonna be working on transform further until i complete the char's ultimate im working on now. So i might get an answer eithout having to try (yay laziness) 

Cyanide

You don't and cannot do it that way. Each state needs to be overridden. It is only the animation that increases by 10000. You only increase the state if you need something different.

In terms of time limit. You need to use a variable counter. This means setting it to 60*number of seconds you want it to last then using varadd to decrease it. When it reaches 0 your transformation variable resets and everything should reboot to normal.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Ssiimmee

Ok, i got it to work by looking at one of the best transform chars i know of (yay)
I thought it had something to to with the override tab in the char's cns, but i had to paste the same code but with a change in the variable code. And i have no clue why i'm explaining this :P

And tomorrow at school i'll look into the setting time thingy.
Oh, and some more random writing, i deleted the changing animation to +10000 if it existed, dunno why tho. I'll add it back if i feel like it, just thought it might ruin something, as it was nothing like it in the char i "borrowed" code from.
Well, thanks and i'll post even more at further problems (you can be sure i will post more) --;
And no, the smileys does not seem to be working.
Oh, now they work. They didnt before ;P

Riptide

I'm a noob to but you should really learn to code. read the documentation and watch youtube.
then ask for help when you've screwed up something irreparably.

Ssiimmee

If it's irrepairably, it's a bit too late, right?
And at school after classes i watch youtube tutorials.
And when there's a piece of code i dont understand i take a look in the docs.
I just dont have much experience of using ff, but i think  my char turns out pretty well :sugoi:

Cyanide

FF is a glorified text editor. You could code mugen in notepad (and most people used to) there is nothing that says you must have FF to code in mugen, it's just that everything in the same place is easier to deal with.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Ssiimmee

I dont really have much experience using notepad either --;
I'm making an own website using my dad's old notes from like 1970's, but no, not much experience of notepad either.

Ssiimmee

Told ya i'd post again ;P
So i got the move stuff figured out, but how do i make it so he gets more life, power and attack when transformed?
i tried
[Data]
triggerall = var(0) = !90
life = 1000         ;Amount of life to start with
power = 3000      ;Amount of maximum power
attack = 100      ;attack power (more is stronger)
defence = 100      ;defensive power (more is stronger)
fall.defence_up = 50   ;Percentage to increase defense everytime player is knocked down
liedown.time = 60      ;Time which player lies down for, before getting up
airjuggle = 15      ;Number of points for juggling
sparkno = 2         ;Default hit spark number for HitDefs
guard.sparkno = 40   ;Default guard spark number
KO.echo = 0         ;1 to enable echo on KO
volume = 0         ;Volume offset (negative for softer)
IntPersistIndex = 60   ;Variables with this index and above will not have their values
FloatPersistIndex = 40
And i increased them when the variable was equal to 90.
Obviously it did not work :o
So how would i do it?

Riptide

Actually I like coding in FF it reminds me of using dreamweaver. What do you mean by using your own website with your dads notes from the 70's.

Good lord don't do that code the XHTML way and stop using tables.....70's that doesn't even make any sense.

Ssiimmee

I was just talking about not beaing familiar with notepad ::)
And i kinda put the website thing on ice for now.
Dad thought it'd be fun if i made a website so i used his old notes, didnt feel like looking up tutorials on the internet  :P
And i know a guy that's designing websites, he uses notepad plus.

Cyanide

Do you know how to type words out? Then you know how to use notepad. I can't believe i'm typing this.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.