Basically what I need is for one of my characters to be able to summon a helper and be able to control that helper with its own moveset simultaneously. To put it another way; essentially I need to be able to summon a completely separate character. I know I can accomplish this through projectiles and explods and such, but if I can avoid this method i would much prefer to do it another way.To be more clear, both characters would be on the stage at once, attacking in tandem with the summoned character attacking and walking along side on a slight (5 to 10 frame) delay.How would I go about doing this?
When creating your helper, you can always give it the parameter keyctrl=1 so it will be able to read all your commands, though it can be safer to have the helper constantly check for "parent,command=" and then do just the same as for a regular character.Making the helper respond with a slight delay will be a little different, though. I suppose you can instead check for the parent's state and send the helper to the same state as the parent when the parent is at time = 5, and make sure the parent isn't getting hit and you have control... Then work some more from there.
Ok so let's say I maintain the keyctrl=1 method. I've tested this and while it does work, as soon as I start to walk the helper's graphic changes from that of its intended to the actual character's walking graphic. How do I tell the helper to access a different animation for its walking anim?If I don't go with the keyctrl=1 method how else would I do it?
In statedef -1 (since keyctrl=1 gives the helper access to statedef -1 - but still not -2 and -3), you can add a changeanim triggered by ishelper.Either you make the helper's animations have the same number as the parent's + 10000 and in the changeanim, put anim = anim + 10000or change the animations one by one depending on the statedef the helper is in.... The helper is another "thing" (like, an animal or a robot) that isn't a clone of the character, I gather ? So the helper isn't actually going to use the same statedefs as the parent, right ? You said that as if the helper wasn't supposed to have the same animations as the parent. Are the states still the same or does the helper go in his own states ?In that latter case it'll probably be simpler to use the second method I described, which is, check the parent's commands and have the helper go to his own state accordingly. Of course, the pieces of code that send the helper to the right states will have to be put in all the states the helper can access.Now if the helper does go to the same statedefs as the parent but simply use a different animation, then you can go into each statedefs he can access and add a changeanim triggered by ishelper.Anyway I'm not completely sure i understand what exactly you want to have. Is the helper a simple clone ? If it has its own animations, does it still use the same statedefs as the parent ? Please explain more.
This is the characterThis is the helperYou were correct in assuming that they are two completely separate characters. I imagine it would be easier for the wolf to have its own statedef. He would have his own near complete moveset; being able to walk, run, attack etc. The real issue here is I am unaware of how to use the parent,command or how to modify a helper in general. If you could give me a quick example of how I could change his actions that would be great. By the way, thanks for being so helpful
Quotehow to use the parent,command...[state helper]type = changestatetrigger1 = parent,command = "F"value = [dog walks forward]??Profit !For more info, look for "trigger redirection" in the cns docs.Again, for each statedef of the dog, you would need to put all the changestates he can currently access. Like, while standing, he can walk forward, back, jump, attack etc., and when walking, he can stop, walk back, jump, attack etc.The thing is that helpers can't access any of the negative statedefs, that's why you ned to put them everywhere.However, if you set keyctrl = 1 when summoning the helper, he can read the statedef -1 and read the changestates found there triggered by command inputs, so you only need to put the dog's changestates in statedef -1. But what you then need to do is, for all your changestates in your statedef -1 that should only be used by the character, add triggerall = !(isHelper) so that the helper can't do these changestates. Then, add the dog's changestates still in statedef -1 with triggerall = isHelper added.Both possibilities should give the same result. It just depends on how many states the dog can access through command inputs (walk, attack and so on). Putting the changestates in the dog's states without giving it keyctrl could be faster, but it would require to duplicate all the walk changestates and so, since you need to put each changestate in each state (all the walks and attack changestates in all the states that have control)..... AlternativelyMake one base state for the dog, and only use changeanims in it, triggered by "parent,command = whatever". Still in the same state, add the velsets and physic changes and anything you need triggered by the current animation, for the basic movements. Then you can put the changestates for the attacks and send it to a different state, that will come back there when it's done. This is basically a simple shortcut of the method without keyctrl.
Ok so I went with the keyctrl=1 method and everything has been going great up until I got to crouching. Basically the dog will crouch but as soon as I release down, his animation changes to the girl's crouch to stand animation and then immediately to her standing animation. Every other command in the -1 state definition has the !(ishelper) thing, but nothing in my command list contains basic commands. I imagine there's no way to alter them in any case, but there must be some work-around, right?
The basic commands are in the data/common1.cns files, as this is the file all characters use and where all the common states are defined.either you copy that file into your characte (and check that your .def file points to the right place for it) and then you open it to change it thereor you go with the last method I described in my previous post : remove the keyctrl, make one big base state for the dog where it changes its own animations-velocities-etc. as it needs, and so on.
Oh I think I was being too vague again. When I said basic commands I was referring to the code that tells the game what states to refer to when holding down or holding forward or back. I think I need some way to override those, though I'm not sure that's possible.
... Yeah that's what I was talking about too. Look. At. Your. data/common1.cns. Statedef 0, statedef 10-11 (crouch), statedef 100 (run), statedef 40+ (jump)... are in it. They have changeanims and all.To override those states, just copy them into your own cns file and then modify them. Since Mugen reads the files one by one and the common1.cns is usually declared last in your .def file, it will first find the states you copied to your own file before finding them in common1.cns. That's how you override them.Here, when you copy them into your file, you can add triggerall = !ishelper to the changeanims you'll find there.Like I said, the last possibility I described is an alternate solution. It's what you can do if you don't go with the keyctrl = 1 method : you give the dog a base state to start at, that has its own animations, changeanims and velsets and everything when the parent inputs certain commands, and changestates when the parent uses the dog's attacks.
One last question and I'm set; or rather two.Question one: The helper wont stay on the screen like a normal character would. He's able to walk outside the stage's wall boundaries; how do I fix this?Question two: The helper doesn't face the opponent, but will only face the direction he was created in. How do I fix this?And kind of a wide question concerning the two; is there a way to fix both of these issues by adding something in the -2 or -3 statedef?
QuoteQuestion one: The helper wont stay on the screen like a normal character would. He's able to walk outside the stage's wall boundaries; how do I fix this?Question two: The helper doesn't face the opponent, but will only face the direction he was created in. How do I fix this?Look at this person's "Golden Gash Bell" characters. They're the perfect example.http://www.geocities.jp/my_memuu/dairi_html/vs.html
I've actually looked at his before, but unfortunately those characters aren't using controlled helpers. His is a similar method, but not the same thing I'm doing.
No, his characters control the helper. You're Gash and Kyo is the helper. If you walk forward he'll walk forward (While staying at a specific distance). If you jump he jumps. That's controlling the helper. If it's different then what exactly are you trying to do?You mean like a command and some vars to change the control over to the dog?
Like I said, it's similar but it doesn't function the same way that mine needs to. Mine is essentially two characters that you control separately while the Zatch characters are are two that behave as one. As far as I can tell you cant break one from the other and control them independantly. That is what mine needs to do. I've already accomplished all that though, but what I need to know is how to keep the helper from leaving the screen and how to make him constantly face the opponent. I couldn't figure that out simply by looking at Gash's code.
On the helper being able to walk out of the screen :[mcode]type = ScreenBound[/mcode]On the facing issue :[mcode]type = Turn[/mcode]Notice that it says it doesn't play a turn animation. So first, check the position of the opponent, when you can turn (i.e. when you have control) and the opponent is behind you, play the turn animation (if you're not already playing it), and when you're displaying the turn animation and it finishes, use type = Turn.