YesNoOk
avatar

making an edited character attack (Read 1599 times)

Started by mysterious gamer, November 15, 2007, 07:31:03 am
Share this topic:
making an edited character attack
#1  November 15, 2007, 07:31:03 am
  • avatar
  • *
This is for my own personal use and not distribution. I'm trying to do a character setup where you fight massive enemies at once, something like the strength training bonus. In fact I used it as a base. I was successful in replacing the sprite that appears in battle, and it moves, but getting it to attack won't work.

What should I do? I've integrated some of the files together. So the cmd contains the commands for both characters, in addition I've switched the cns and animation files with the one of the character I'm integrating. What else can I do?
Re: making an edited character attack
#2  November 15, 2007, 05:21:30 pm
  • ******
  • [E]
    • Mexico

  • Online
it sounds a bit weird; do you only want to sprite swap, or do you want to add more enemies ?
Re: making an edited character attack
#3  November 16, 2007, 01:28:30 am
  • avatar
  • *
Sprite swap essentially. I'm assuming I can add more enemies later. I switched the sprites, got them moving, but failed to get them to use their original attacks...
Re: making an edited character attack
#4  November 16, 2007, 04:12:16 am
  • ******
  • [E]
    • Mexico

  • Online
that's weird, it should not get broken if you only switch the sprites, you might have messed up something else in the other files.
Re: making an edited character attack
#5  November 16, 2007, 08:17:17 am
  • avatar
  • *
Simply switching the sff files will allow it to work? Sounds odd, but I was going to originally try it anyway...

EDIT: Starting over, I swapped the air and sff of the character I wanted to have replace the strenght training men, but I still can't get them to attack, they only follow me. What regulates character's attack states. I previously edited the cns, cmd, and st files but with no luck. Will I actually have to recode everything to get this to work?
Last Edit: November 16, 2007, 08:54:58 am by mysterious gamer
Re: making an edited character attack
#6  November 16, 2007, 04:50:40 pm
  • ******
  • [E]
    • Mexico

  • Online
the cmd is what regulates; though i still don't get why are you changing any code if you are only sprite swapping.
Re: making an edited character attack
#7  November 17, 2007, 01:56:40 am
  • avatar
  • *
Well if the sprites wont attack I'm assuming I'll have to recode. The weird thing is that they move, but they don't attack. Is there any way to verifiy that the commands in the cmd are being used by the cpu, or a cpu only?
Last Edit: November 17, 2007, 02:15:40 am by mysterious gamer
Re: making an edited character attack
#8  November 17, 2007, 03:51:25 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Erm, isn't this an AI only character? Fight against it in arcade (with just an sff and air swap and see what happens.


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.
Re: making an edited character attack
#9  November 17, 2007, 04:10:10 am
  • avatar
  • *
Generally, in any mode Strength training will work. Even if it's 2p it just starts working. Instead of using it as a base though, I'm thinking of altering the other character's original file. Is there any code I could possiblly use to create a large amount of helpers with the same appearance, movements, attacks, ect?

EDIT: I played around with the character's original file and added helpers (or at least the helper codes from the strenght training character's). Apparently something in that code is preventing it from attacking, but I can't figure what. Would anyone know?
Last Edit: November 17, 2007, 05:32:12 am by mysterious gamer
Re: making an edited character attack
#10  November 17, 2007, 06:42:05 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Quote
EDIT: I played around with the character's original file and added helpers (or at least the helper codes from the strenght training character's). Apparently something in that code is preventing it from attacking, but I can't figure what. Would anyone know?

I grant you the cryptic comment award.

We don't really know what you're doing. See the thing is. If you take the original character and swap the sprites over. Then take the original everything else and put it with that sff, MAYBE correcting the animations. It should work. Can't give you more than that without knowing what you've changed and how.


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.
Re: making an edited character attack
#11  November 17, 2007, 07:04:04 am
  • avatar
  • *
Quote
EDIT: I played around with the character's original file and added helpers (or at least the helper codes from the strength training character's). Apparently something in that code is preventing it from attacking, but I can't figure what. Would anyone know?

I grant you the cryptic comment award.

We don't really know what you're doing. See the thing is. If you take the original character and swap the sprites over. Then take the original everything else and put it with that sff, MAYBE correcting the animations. It should work. Can't give you more than that without knowing what you've changed and how.

I see, sorry about that I'm trying my best to explain... Initially I was swapping the sff and air files between characters as you've suggested. It worked, however the edited character would not attack it simply moved towards the opponent. I thought adding the cmd and cns (the one of the transferred sprite) to the edited character would allow the character to access its original attacks and movements, but that also didn't work. I even merged the characters st and cns files together with those of the strength training's.

Starting over, I attempted to add the helper codes (all lines with helper in them) of the strength training's states file, to the other character's cns. I duplicated the character like I wanted, but I found that it could not move or attack when I added those codes. So I'm now assuming that it's the coding of the other character that's preventing me from making the sprite attack.
Re: making an edited character attack
#12  November 17, 2007, 10:00:26 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
You shouldn't be merging or anything. All you should do is copy paste the strength training's folder, rename it, and all the files in it, then swap the sff file.

If it still doesn't work at that point, i imagine strength training uses animelemtime and your new animations don't go high enough or something. Sorry this is all guess work right now.


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.
Re: making an edited character attack
#13  November 17, 2007, 04:54:21 pm
  • ******
  • [E]
    • Mexico

  • Online
don't bite more that you can chew. as cyanide said, first get it working JUST swapping sprites. step by step you will be abe to add thousands of charcters to it.
Re: making an edited character attack
#14  November 17, 2007, 05:39:58 pm
  • ******
You're taking sprites from a character A and adding it to a character B, but you still want your character A to do his own attacks even if he's in character B's files, do I get that right ? B does not originally have the move at all, not even the coding, is that it ?
In that case, then yes, only having the sprites and animations is not enough if B did not originally have the move. The animation alone is nothing, it's just a sequence of pictures. You do need to copy the corresponding statedef from A's files, as well as the command part that tells A to go to that corresponding statedef.

cmd tells the character to go to a given statedef upon command input
cns says exactly what happens during the move, and tries to display an animation from the air ; it goes from the start of the animation until it gets back to its statedef 0 (standing state)
the air file is a suite of numbers that refer to sprites in the sff.

Given that, if you're trying to add the whole move of A into B, including the movement, animation, effects, then yes, you need to add all the bits that make up the movement : cmd, cns, air, sff corresponding parts.

Don't forget that the statedef numbers must be unique. Meaning, if in A the statedef number used is 1650, then when adding that statedef into B, you need to make sure that number isn't already used. If it is, you have to change it for a unique one. Ditto for the animations.

But once again, as Cyanide and [E] said, it's a lot, and it takes time to understand each part of it. But if you want to persevere, please make sure to point out in which part (of the list I gave) things go missing.
In fact, ideally, actually post exactly what you transfer from A to B - post the added code as well. We need as much information as you can provide.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Last Edit: November 17, 2007, 05:43:07 pm by Baiken
Re: making an edited character attack
#15  November 18, 2007, 04:16:55 am
  • avatar
  • *
You're taking sprites from a character A and adding it to a character B, but you still want your character A to do his own attacks even if he's in character B's files, do I get that right ? B does not originally have the move at all, not even the coding, is that it ?
In that case, then yes, only having the sprites and animations is not enough if B did not originally have the move. The animation alone is nothing, it's just a sequence of pictures. You do need to copy the corresponding statedef from A's files, as well as the command part that tells A to go to that corresponding statedef.

cmd tells the character to go to a given statedef upon command input
cns says exactly what happens during the move, and tries to display an animation from the air ; it goes from the start of the animation until it gets back to its statedef 0 (standing state)
the air file is a suite of numbers that refer to sprites in the sff.

Given that, if you're trying to add the whole move of A into B, including the movement, animation, effects, then yes, you need to add all the bits that make up the movement : cmd, cns, air, sff corresponding parts.

Don't forget that the statedef numbers must be unique. Meaning, if in A the statedef number used is 1650, then when adding that statedef into B, you need to make sure that number isn't already used. If it is, you have to change it for a unique one. Ditto for the animations.

But once again, as Cyanide and [E] said, it's a lot, and it takes time to understand each part of it. But if you want to persevere, please make sure to point out in which part (of the list I gave) things go missing.
In fact, ideally, actually post exactly what you transfer from A to B - post the added code as well. We need as much information as you can provide.

Thank you for your reply. I do realize I was very vague, but I believe it would be a simpler process. I actually replaced the Cns and cmd of character B (strength training) with those of character A. Actually, strength training's cns and cmd are very basic, and can be removed fairly easily; most of it's codes reside in its .st file. I'm having trouble understanding what in the st is preventing my character from attacking.

I copied certain codes with the word "helper(s)" from that particular st and placed them into character A's cns. I found that I generated helpers, but none of them could attack. I know that's a very crude way to go implementing helpers into a character, but do you think that it's possibly a sign that the helper codes could be preventing my character from attacking?
Re: making an edited character attack
#16  November 18, 2007, 07:18:27 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Ok, so you've included some of your own stuff in what should have been a simple sprite swap.

None of your "own code" please. Make use of the current characters EVERYTHING, except SFF file.


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.
Re: making an edited character attack
#17  November 18, 2007, 12:03:53 pm
  • ******
Quote
I copied certain codes with the word "helper(s)" from that particular st and placed them into character A's cns. I found that I generated helpers, but none of them could attack. I know that's a very crude way to go implementing helpers into a character, but do you think that it's possibly a sign that the helper codes could be preventing my character from attacking?
Hm... When you want to generate a helper, you give it a state number to start at. If you copied a piece of code that was like
Code:
[state blah, blah]
type = helper
...
stateno = numberhere
...
then did you also look for the statedef corresponding to that "numberhere" ? You have to copy that state, since it's what tells the helper what to do.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: making an edited character attack
#18  November 18, 2007, 04:48:27 pm
  • ******
  • [E]
    • Mexico

  • Online
actually once you get the sff swap working; you are not going to exchange the cmd and cns files; but rather add the new character's st file to the old's st file; while doing edit to the cmd and air files.
Re: making an edited character attack
#19  November 18, 2007, 08:03:52 pm
  • ******
Nobody talked about "switching" the files.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: making an edited character attack
#20  November 18, 2007, 09:56:09 pm
  • avatar
  • *
Quote
I copied certain codes with the word "helper(s)" from that particular st and placed them into character A's cns. I found that I generated helpers, but none of them could attack. I know that's a very crude way to go implementing helpers into a character, but do you think that it's possibly a sign that the helper codes could be preventing my character from attacking?
Hm... When you want to generate a helper, you give it a state number to start at. If you copied a piece of code that was like
Code:
[state blah, blah]
type = helper
...
stateno = numberhere
...
then did you also look for the statedef corresponding to that "numberhere" ? You have to copy that state, since it's what tells the helper what to do.

Oh, I found it, but the characters alread did that. It refers to "appearing" would I have to add the statedef for attacking to the characters?
Last Edit: November 18, 2007, 10:03:39 pm by mysterious gamer
Re: making an edited character attack
#21  November 18, 2007, 10:01:06 pm
  • ******
Check all cns or st files the character has. If you don't find anything, open his .def and look at which files are listed in it, it has to be in one of them. It could even be in the .cmd or the .def itself, technically, though it's doubtable if there's a .cns and .st at all.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: making an edited character attack
#22  November 18, 2007, 10:29:31 pm
  • avatar
  • *
It's in the .st, it was refering to "appearing", which the characters already did. How do I make it refer to attacking as well? can you add multiple statedefs to a stateno
Re: making an edited character attack
#23  November 18, 2007, 11:32:49 pm
  • ******
To have a character attack, you need a few things.
First, the animation needs to have clsn1 boxes (the red ones) ; then, the statedef needs to be have movetype = A (see docs for details) ; finally, you need a hitdef. Ycan have several hitdefs in a same stateno, just that only one is active at a time, so if you put several one after the other, they'll replace each other as they are triggered, so just make sure you time their triggers properly.

... Multiple statedefs to a stateno ? No. States need to have unique state numbers. How would Mugen know which it should pick if you have several ? (well, as Mugen reads from top to bottom, it'll pick the first one it finds and stop there)
Why would you want to give the same state number to several states ?
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: making an edited character attack
#24  November 19, 2007, 02:02:52 am
  • avatar
  • *
To have a character attack, you need a few things.
First, the animation needs to have clsn1 boxes (the red ones) ; then, the statedef needs to be have movetype = A (see docs for details) ; finally, you need a hitdef. Ycan have several hitdefs in a same stateno, just that only one is active at a time, so if you put several one after the other, they'll replace each other as they are triggered, so just make sure you time their triggers properly.

... Multiple statedefs to a stateno ? No. States need to have unique state numbers. How would Mugen know which it should pick if you have several ? (well, as Mugen reads from top to bottom, it'll pick the first one it finds and stop there)
Why would you want to give the same state number to several states ?

I'm placing in all of one character's values into another, so the hitdefs and clsn1s are there. But I need something that makes the helpers attack after they enter the screen. I don't know what triggers the helpers to attack, could I just create a line saying stateno= 200 (statedef value equal to attacks...)
Re: making an edited character attack
#25  November 19, 2007, 09:46:35 am
  • ******
Do you have the whole helper state controller ? Don't just write stateno=200 in the middle of your state with nothing else actually telling Mugen to create a helper, it won't understand.
Just post the statedef of your helper creation.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.
Re: making an edited character attack
#26  November 19, 2007, 05:20:18 pm
  • avatar
  • *
I got the character working in the crudest way, I have the helpers attack as they enter  the screen, then they just stand there. For now, that is satasfactory, I only care about having the character. My knowledge of mugen was only observational based, I've made edits before but not on a similar scale is this. Once I learn more about coding I will attempt to redo this edit. Thank you for all your help anyway.