.[B] MUGEN Study Files
Download Offline version HERE by Byakko

Top What's MUGEN Basic structure Process Elements Coding Format Ethic Links

MUGEN's elements


Show / hide all
 
THE CHARACTERS (Show/hide)
There's player 1, and there's player 2. Occasionally, players 3 and 4 in simul mode. No big secret here. All characters have a playerID - Helpers also get one of those. PlayerID can be a direct reference to any of the "objects" on the screen during the fight, which you can use for trigger redirection (something we will see in a moment).
 
HELPERS (Show/hide)
So, let's say you want to create a second object beside your character. A bomb, or a striker, a dagger you want to throw, or anything that is just an object standing there with no connection to the player. I've named them a few times already, but here they are : Helpers will often be very useful.
One thing to note is about projectiles - fireballs and such. Normally, there is a Type = Projectile available, but it has fallen out of use because Helpers can be manipulated with a lot more freedom. The only thing projectiles have over helpers is that projectiles keep track of the same juggle points as the character itself, while helpers... don't. Anyway, despite that, helpers are easily preferred over projectiles.
When you create the helper, you give it a position to be created at, and a statedef number to start at. This will simply create a second object on the screen, that can move and act independently from your character ; it will do what you coded in the statedef you sent it to, use all the velsets, all the explods, all the hitdefs you coded in it, even all the changestates, and it will navigate in your code, in your states, exactly as if it was the character itself. Eventually, you need to remove the helper, at which point you use a Type = DestroySelf with the appropriate triggers.
Keep in mind that there exists some sort of hierarchy between the helper and the character that create it : the character is always the "root" of all helpers, and the "parent" of the helper he creates. Notice that a helper can create another helper in turn : the character is the root of both helpers, the parent of only the first helper, and the first helper is the parent of the second.
The one thing that sums up the helper is that it can behave exactly like the character itself, reading the states and activating the state controllers all the same as the character. You can manipulate helpers just as freely as you can manipulate your character. The only thing they don't have is access to states -2 and -3 as mentionned previously, and also not to -1 if you don't give the helper KeyCtrl.
One last trick to know about helpers is that they can also use variables - and they have their own set of variables. As we have seen earlier, the character has 60 + 40 variables available - but just create a helper, and the helper has his own 60 + 40 variables which you can use just as well. The method to use these extra variables efficiently is trigger redirection, which we will see later on in this overview.

[State 1000, 1]
type = Helper
trigger1 = AnimElem = 4
ID = 1010 ; a unique identifier for the helper, so the parent can look at it later as longas it's here
name = "KoOhken" ; a name for the helper, just to look good and feel pretty
pos = 65,-75
Stateno = 1010 ; the helper starts with the code at that state and then reads it just as the character would
ownpal = 1

In this example, a helper is created as a new object on the screen. That object will start at StateDef 1010, and then proceed with the code written in it, until it finds a Type = DestroySelf.

[State 1010, End]
type = DestroySelf
trigger1 = !AnimTime

Straight to the point. Get lost once you have outlived your usefulness. By the way, a DestroySelf does nothing if you are not a helper. No, you can not destroy your character. Sorry.
 
EFFECTS (Show/hide)
Graphic effects (explods) and sound effects have no lasting existence ; since they can't directly interact with either character, the only thing they do is being here. That's about all that really needs to be known about these.
One trick that may one day be useful is that, if you give your explod an ID, it's possible to make use of the fact that it is here to set up elaborate detection methods : with the right triggers, you create an invisible explod, and then the character can detect if the explod with the ID you chose is still there. This is slightly more advanced coding, and it will probably be useful only in pretty specific situations, but it's a trick that can be nice to think of. You could even use that trick to spare a variable, playing around with the ID and removetime, just for fun. Hey, it can easily serve as an invisible timer ! Well, as long as you only need to check if you are still within the time set as the explod's removetime, you couldn't check if you just got out. Of course, that's not something you really need to remember, it's just a random example of the kind of things you can come up with in Mugen.

Code examples will be found in the following "Coding" section.
 

Back to top
Powered by PHP         Powered by Engrish        Valid XHTML 1.0 Transitional        Valid CSS        Get Firefox        Scal hosted