Pikmin fangame engine/Creating object types

From Pikmin Fanon
Jump to: navigation, search

This page will instruct you on how to create new object types in the Pikmin fangame engine. This includes a new type of enemy, new type of Pikmin, etc.

General idea[edit]

In order for the engine to detect a type of object, it will check the "Game_data/Types" folder. Inside are several folders, one for each category of object (enemies, gates, etc.). Inside each category are folders for the different types of objects (the different types of enemies, different types of leaders, etc.). Finally, inside those are two text files: one is written manually and contains all the data about how the object works, while the other contains the object's animations, created by the animation editor.

Creating a new object type[edit]

To create a new object type, make a folder for it on the right category, and create two empty text files inside: one called "Data.txt", the other "Animations.txt". Inside Data.txt, you will write all of the object's parameters, like the name, its movement speed, etc. These take on the form of parameter = value, and there is one parameter per line. So for instance, to name Louie's object type, you'd have the line name = Louie on the file. Some parameters are mandatory, some are optional, some apply to all object types, and some only apply to certain categories of object type. Feel free to read the rest of this section and then jump straight to the section of the object category you want.

Naturally, instead of creating your own files from scratch, you may copy and paste an existing object's files and simply edit those. After you're done setting the parameters, you must create the animations for the object type. Use the animation tutorial for this.

Mandatory parameters[edit]

The following parameters must exist, regardless of category. Some object types might work just fine without you filling in some of these parameters, but it is very encouraged that you do fill them.

  • name: Name of the object type. e.g. Olimar, Red Pikmin, Cloaking Burrow-nit.
  • height: Object's height. This doesn't need to be very specific. For reference, leaders are usually 32, Pikmin are usually 24.
  • max_carriers: Maximum number of Pikmin that can carry this object, when it is made carriable.
  • max_health: The object's top health. For reference, leaders have 10, and something like a Red Bulborb has 750.
  • move_speed: Movement speed (in pixels per second). For reference, leaders move at 100.
  • pushable: true if this object can be pushed out of the way by other objects. false otherwise.
  • pushes: true if this object can push "pushable" objects out of the way. false otherwise.
  • radius: The object's size, represented by the circle's radius (in pixels). Leaders are 32 pixels wide, so their radius is 16. Pikmin have a radius of 10.
  • rotation_speed: How fast the object turns when moving, in degrees per second. For reference, leaders use around 6, Pikmin use around 8, and a Red Bulborb uses around 2.
  • weight: How much Pikmin strength does it take to carry the object.

Optional parameters[edit]

For all categories of object type, you may set these parameters, but they will still work if you don't.

  • main_color: A color to represent the object by. The format is R G B (values range from 0 to 255). Default is black.
  • health_regen: Passive health regeneration rate, in HP per second. Default is 0.
  • is_obstacle: If set to true, the object will be considered an obstacle.
  • show_health: If set to false, the object's health wheel will not appear on top of it. Default is true.
  • casts_shadow: If set to false, the object won't cast a shadow on the ground. Default is true.
  • spike_damage: If this object is meant to cause spike damage, specify the spike damage type's name here.
  • spike_damage_vulnerabilities: Normally, objects hit by a spike damage attack will receive the damage specified. If you want this mob type to take more or less damage (or even heal!), you can specify it here. This is a block, where every parameter inside has the spike damage type's name as a name, and the multiplier as a value. Example: poison = 0.5 will make this enemy take half the intended damage when ingesting a White Pikmin.

Creating a Pikmin type[edit]

To create a Pikmin type's parameters, follow the standard procedure written above. Then, you must also specify the following parameters:

  • icon_leaf: Name of the image with the Pikmin type's icon for when it is a leaf. This is displayed on the HUD, for the standby Pikmin bubble. The image should be in Game_data/Graphics, and the extension of the file name must be included.
  • icon_bud: Same as icon_leaf, but for a bud.
  • icon_flower: Same as icon_leaf, but for a flower.
  • top_leaf: Name of the image with the leaf sprite to use in-game. The image should be in Game_data/Graphics, and the extension of the file name must be included.
  • top_bud: Same as top_leaf, but for a bud.
  • top_flower: Same as top_leaf, but for a flower.

In addition, you may also specify the following, although they are optional:

  • attack_power: Every time the Pikmin attacks, it causes this much damage. For reference, standard-powered Pikmin have this set to 10.
  • throw_strength_mult: The strength of the throw arc will be multiplied by this. A standard Pikmin has this set to 1. For reference, a Yellow Pikmin has this set to 1.1.
  • carry_strength: The Pikmin is worth this much for carrying strength. Default is 1.
  • onion_starting_number: Number of Pikmin of this type inside the Onion, when the day starts.
  • has_onion: true if the Pikmin has an Onion, false otherwise (e.g. White Pikmin). Default is true.
  • sprout_evolution_time_1: How long a leaf Pikmin sprout must wait before they turn into a bud. 0 means it will never evolve into the next stage.
  • sprout_evolution_time_2: Same as the previous, but between a bud and a flower.
  • sprout_evolution_time_3: Same as the previous, but between a flower and the process of withering back into a leaf.

Then, you must create the Pikmin type's animations. Use the animation tutorial for this.

One thing to note when making Pikmin is that the movement speed parameter indicates the movement speed of a leaf Pikmin. Bud Pikmin move 110% faster, and flowers move 120% faster.

Creating a leader type[edit]

For a Pikmin, a Pikmin type is "Red", "Yellow", etc. For leaders, a leader type is the same thing: "Olimar", "Louie", "Alph", etc. Although yes, it does not make sense to have more than one "Alph" in the same area, each "person" is still considered a type. Plus, you could want a group of three "Giant Red Pikmin" leaders, and for that, we need a "Giant Red Pikmin" type.

For a leader type's parameters, first, follow the standard procedure written above, then add the following mandatory parameter:

  • icon: Name of the image file with the leader's icon. This icon is used on the HUD. The image should be in Game_data/Graphics, and the extension of the file name must also be included.

You can also specify the following parameters if you want:

  • dismiss_sfx: Name of the sound file to play when this leader dismisses. The sound should be in Game_data/Audio, and the extension of the file name must be included. If not set, no sound will play.
  • name_call_sfx: Same as dismiss_sfx, but the sound the leader makes when they are switched to.
  • pluck_delay: How much time it takes before the Pikmin comes out. Default is 0.6.
  • throw_strength_mult: When this leader is thrown, the strength of the throw arc will be multiplied by this. A standard Pikmin has this set to 1, but leaders normally have it set to 0.7.
  • whistle_range: Maximum range the whistle can cover. Default is 80.
  • whistle_sfx: Same as dismiss_sfx, but the sound the leader's regular whistle makes.

Then, you must create the leader type's animations. Use the animation tutorial for this.

Creating an enemy type[edit]

To create an enemy type, follow the standard procedure written above. If you want, you can also specify the following optional parameters:

  • allow_ground_attacks: false makes it so that Pikmin cannot attack it with grounded attacks; the only way to hurt it is by throwing Pikmin and letting them attack latched on.
  • drops_corpse: true if this enemy drops a corpse, false otherwise. Default is true.
  • pikmin_seeds: How many seeds this enemy gives when the corpse is returned to the Onion. Default is 0.

Afterwards, you need to create the enemy type's animations and also its script. Use the animation tutorial and script tutorial for this.

Creating an Onion type[edit]

To create an Onion type, simply follow the standard procedure above, and then specify the following parameter as well:

  • pikmin_type: Name of the type of Pikmin this Onion belongs to.

Then, you must create the Onion type's animations. Use the animation tutorial for this.

Creating a pellet type[edit]

To create a pellet type, follow the standard procedure written above, and then specify the following parameters:

  • match_seeds: How many seeds it gives to the Onion when the pellet's Pikmin type matches the Onion's.
  • non_match_seeds: How many seeds it gives to the Onion when the pellet's Pikmin type does not match the Onion's.
  • number: The number written on the pellet (e.g. 1, 5, 10). This will set the weight to the same thing.
  • number_image: Name of the image with the number. The image should be in Game_data/Graphics, and the extension of the file name must be included.
  • pikmin_type: Name of the type of Pikmin the pellet matches with.

Then, you must create the pellet type's animations. Use the animation tutorial for this.

Creating a ship type[edit]

To create a type of ship (Hocotate ship, S.S. Drake, etc.), follow the standard procedure written above. Then, simply specify the following parameter:

  • can_heal: If true, that means that leaders can heal their spacesuits using this ship, like the S.S. Dolphin. Default is false.

Then, you must create the ship type's animations. Use the animation tutorial for this.

Creating a treasure type[edit]

To create a type of treasure (or ship part, fruit, or what have you; they're all considered "treasure"), follow the standard procedure written above. At the moment, there are no other parameters that can be added.

Then, you must create the treasure type's animations. Use the animation tutorial for this.

Creating a gate type[edit]

To create a type of gate, follow the standard procedure above. At the moment, there are no other parameters that can be added.

Then, you must create the gate type's animations. Use the animation tutorial for this.

Creating a bridge type[edit]

To create a type of bridge, follow the standard procedure above. Then, simply specify the following parameters:

  • main_texture: File name of the texture to use for the bridge's main floor, extension included. This texture should be in Game_data/Graphics/Textures/<code>.
  • <code>rail_texture: Same as above, but the texture to use for the railing.

Then, you must create the bridge type's animations. Use the animation tutorial for this.

Creating a fully custom object type[edit]

If you want, for instance, a rubber ball that bounces around when a Pikmin is thrown at it, but is not meant to do anything else, like be carried, be hurt, etc., what category would you put it in? It's not an enemy, since that would make it appear on the list of enemies (e.g. Piklopedia), and it's not something Pikmin should be targeting. It's definitely not a leader, or a Pikmin. Well, you can use the "Custom" category to place any object that works completely custom. These use a script, like enemies, to control their behavior. This category is also where you'd place simple obstacles, like fire geysers.

To create one, follow the standard procedure above. Afterwards, you need to create its animations and also its script. Use the animation tutorial and script tutorial for this.