[Project Catch 'Em All - Developer Reference:]
This sole purpose of this document is to help define the developing bounds of this game. The system is 100% custom and has some rules to follow if you want everything to work properly.
In order to follow this without too much confusion, it's assumed that you have knowledge of MUGEN CNS and basic programming concepts.
This isn't an intro to mugen coding or a tutorial by any means.
----------------------------------------------------------
[Variables]
Variables can be split into two groups: system and user.
System Variables:
System variables are used by the system and shouldn't be modified unless otherwise stated.
var(0) = ATB Gauge Max
- This is the maximum value that the ATB bar is at any time.
- This changes and is set at the very beginning of a move.
var(1) = ATB Gauge Current Value
- This is the current value the ATB bar has at any time.
- DON'T modify this at all. The system handles it all times.
var(2) = ATB Gauge Modifier
- This value can be set within a move to change the recovery rate of the ATB Gauge.
- For example, Scyther's Agility sets this value to increase the rate of recovery for 3 moves. After those three moves are up, it is set back to 0.
- Don't set this to a ridiculously high number because it's used like this:
- current_value := current_value + 1 + var(2)
var(3) = Used for AI
- Don't modify this value.
var(4) = Reserved
var(5) = Reserved
var(6) = Reserved
var(7) = Reserved
var(8) = Reserved
var(9) = Reserved
fvar(0) = Player position.
- At the beginning of the round, this value is recorded so the pokemon always return to their spots after behing hit away from them, or moving away during an attack.
- Don't modify this.
fvar(1) = Reserved
fvar(2) = Reserved
fvar(3) = Reserved
fvar(4) = Reserved
fvar(5) = Reserved
fvar(6) = Reserved
fvar(7) = Reserved
fvar(8) = Reserved
fvar(9) = Reserved
User Variables:
User variables are variables that you can use for anything in your character. There's no much restriction here. You can use these for whatever you want. In most cases, for advanced attacks, you'll
need these.
var(10+)
fvar(10+)
----------------------------------------------------------
[Attacks]
Attacks are the bulk of each pokemon. They have 4 each that can be anything you want, within reason.
ATB Gauge:
At the beginning of each attack, you need to set the ATB value for that attack:
[State 5xx, Set ATB]
type = Null
trigger1 = !time
trigger1 = var(0):=100
You're setting the maximum value here to 100. The system resets the current ATB value to 0 when you choose an attack. So, at the beginning of this move, you'll have an ATB of 0/100, in this case.
Set ATB higher for a longer recovery time and smaller for a shorter recovery time.
State Numbers:
500,510,520,530 are reserved for attacks. It's imperitive that you keep true to these values. The select menu uses them explicitly. If you use anything else, the system
won't be able to perform your attack.
The menu has four attacks that you choose from. Each state corresponds to a move:
1st move = 500
2nd move = 510
3rd move = 520
4th move = 530
Attacks can span over multiple states too. As long as your attack is within 10 states (all should be), you'll be fine.
For example, 500 can be the start of Attack 1, that leads into 501, 502, and ends at 503. That's perfectly fine.
Ending states:
In order to return to your character to their spot, all you have to do is send them to State 0. For example:
[State 5xx, Stand State]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
If the system detects that the character is not in their spot, it will force them into their "run back" state. You don't have to worry about that ever. Just send them back to State 0 when done.
Damage:
We code damage values to match that of the actual attack from the game. For example:
Flamethrower:
http://bulbapedia.bulbagarden.net/wiki/Flamethrower95 damage. Since a flamethrower would be particle based (spawn many helpers that each does its own damage), we'd split 95 by the number of flame particles we're spawning. If you're spawning 5 flame particles, then
each one would do 19 damage each.
If the move is only going to hit once, then it would do the full damage of 95.
Attack Clash:
Most, if not all attacks clash in some sort of way. Most elemental, particle type effects have this ability. For example: Bubblebeam vs Flamethrower. They could cancel each other out or nullify damage.
All attacks involving lauching some sort of projectile (helpers only) at the enemy are required to be hitable and cancelable. You will use HitOverride to make this happen.
In some cases, those attacks have "lives," or a specific number of times they can be hit before dying. For example: X-Scissor can take about 5 hits before being killed. Flame Wheel can take 3.
This is done with a variable that controls the life of the attack. HitOverride will send the helper back to its current state. At the top of the state, you check to see if prevstateno has a value and then
decrease your "lives" var by 1. When it's less than or equal to 0, you send the helper to a die state.
Example of single-life HitOverride:
[State 531, Hittable]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AT,AP
slot = 0
stateno = 532 ; Death State
time = 1
ignorehitpause = 1
Example of multiple-lives:
[State 531, Init Vars]
type = null
trigger1 = prevstateno && !time
trigger1 = var(10):=var(10)-1
[State 531, Hittable]
type = HitOverride
trigger1 = 1
attr = SCA,AA,AT,AP
slot = 0
stateno = 531
time = 1
ignorehitpause = 1
[State 531, Die State]
type = ChangeState
trigger1 = var(10)<=0 || FrontEdgeDist < -40
value = 532
----------------------------------------------------------
[Getting Hit]
In order to keep things natural, I kept the default common states with some slight modifications here and there.
When adding your "get hurt sprite(s)" to the sff, all you need to do is set 5000,0 and/or 5000,1 to your pokemon's get hit sprites.
All the others should stay as KFM sprites because they're required by MUGEN, not by the system. If we didn't get debug flood from
removing them, I would. But, just follow this rule to avoid it.
Animations are handled like you would with any other character.
Wall bounce, red hurt PalFX, and "squishiness" are all handled by the system.
----------------------------------------------------------
[Lifebars]
This is more of a note than anything else. The lifebars are coded into the system and as a result: per character. They're not standard lifebars by any means.
You can still access "life" and "lifemax" triggers like you would in any character.
----------------------------------------------------------
[Stats]
At the top of every character's primary CNS file, there's a [Data] block. Values for Life, Attack, and Defense are set here, but note that they're accurate to the source. For example:
To accurately set your character's stats, go here:
http://bulbapedia.bulbagarden.net and search for your character.
Find the section that says "Stats" and then underneath "Base Stats." Look at the area that says "At lvl. 100."
There's a range of numbers for HP, Attack, and Defense. Choose the maximum value in that range for each stat.
For example, here are Skarmory's stats:
http://bulbapedia.bulbagarden.net/wiki/Skarmory#Base_statslife = 334
attack = 284
defence = 416
power = 0 ; Set to 0, because it's never used.
----------------------------------------------------------
[Affinities]
This section will be embellished upon once the system allows for affinities. Currently, it does not.