Pikmin Fanon will close on September 1st (see here for details and discussion).
A full-history page and file archive is available for download here (mirror).
Wayback Machine archive can be found here. Partial Wikia archive here.

Difference between revisions of "Pikifen/Quick creator guides"

From Pikmin Fanon
Jump to: navigation, search
(Update for 0.17.)
(Version 0.18!)
Line 47: Line 47:
 
* Your object may also need a [[#Scripts|script]]; check if it does in the [[Pikifen/Creating object types#List of object categories|list of object categories]].
 
* Your object may also need a [[#Scripts|script]]; check if it does in the [[Pikifen/Creating object types#List of object categories|list of object categories]].
 
* The "Custom" category is for fully custom objects. These too need a script.
 
* The "Custom" category is for fully custom objects. These too need a script.
 +
* In order for your object to attack or be attacked, you need to specify its <code>target_type</code>, <code>can_hunt</code>, and <code>can_hurt</code> properties.
  
 
''Full object type guide: [[Pikifen/Creating object types|Creating object types]]''
 
''Full object type guide: [[Pikifen/Creating object types|Creating object types]]''
Line 96: Line 97:
 
* For an enemy to eat, it must first set how many Pikmin can be grabbed at max, and which body parts will do the grabbing. After some Pikmin are grabbed, it must then swallow them, which is what really kills them.
 
* For an enemy to eat, it must first set how many Pikmin can be grabbed at max, and which body parts will do the grabbing. After some Pikmin are grabbed, it must then swallow them, which is what really kills them.
 
* When an enemy dies, it should run the <code>start_dying</code> and later, <code>finish_dying</code> actions.
 
* When an enemy dies, it should run the <code>start_dying</code> and later, <code>finish_dying</code> actions.
* An enemy can keep a list of variables with any name you wish, and these variables can contain any value you want.
+
* An enemy can keep a list of variables with any name you wish, and these variables can contain any value you want. You can refer to a variable's value in an action with <code>$variable_name</code>.
 
* When switching states, the action that switches the state should be the last one run on the event's code.
 
* When switching states, the action that switches the state should be the last one run on the event's code.
  

Revision as of 12:32, 8 February 2020

This page contains quick guides that teach you the basics on how to create content for Pikifen. Read this for a list of more in-depth and complete guides.

Areas

Concepts

An area's physical geometry is made up of neighboring polygons, which represent floors when seen from above. Their height can also be changed, and a polygon with a higher height than its neighbor creates a wall.

How to make an area

Making a ramp with the area editor.

Feel free to check or copy the existing areas for references and ideas.

  1. Open the game, enter the area editor.
  2. Use the big button on the right to create your area.
  3. Use the "Info" mode to give it a name.
  4. Use the "Layout" mode to create and edit the polygons (also called sectors).
    • Drag a polygon's vertexes around to give it shape.
    • Double click a polygon's lines to create a new vertex.
    • Use the "+" button on the panel to start drawing a new sector.
    • Drag a vertex into another to merge the two. Connect edges to stitch them.
    • Edges between higher sectors to lower ones make walls.
  5. Use the "Objects" mode to create and edit the level's objects.
  6. Use the "Paths" mode to create and edit the Pikmin's paths, by drawing the path stops and links between them.
  7. Use the "Details" mode to create and edit tree shadows.

Further info

  • On the area editor, right-click-drag moves the camera.
  • Objects will walk up floors within 50 units of each other. Use this for ramps and staircases.
  • Bridges need to be inside sectors of the "Bridge" type. Neighboring "Bridge"-type sectors will be used for the finished bridge's layout.
  • Don't overlap lines or create non-simple polygons.

Full area guide: Creating areas

Object types

Concepts

Red Pikmin is a type of Pikmin, Wollywog is a type of enemy, Captain Olimar is a type of leader, and wood bridge is a type of bridge. You then place in an area several instances of Wollywog, several instances of wood bridge, (hopefully) one instance of Captain Olimar, etc. Each type has its own properties (color, health, script, etc.)

How to create an object type

Feel free to check or copy the existing object types for references and ideas.

  1. Create a folder for your object's type in Game_data/Types/<category>.
  2. Inside, create Data.txt.
  3. Inside, write the necessary attributes, which take on the format attribute = value, one per line.
    • name, height, max_carriers, max_health, move_speed, pushable, pushes, radius, rotation_speed, weight.
  4. Depending on the category, you must also add some more attributes; check the corresponding category article in the list of object categories.
  5. Create and set up the animations for it.

Further info

  • Your object may also need a script; check if it does in the list of object categories.
  • The "Custom" category is for fully custom objects. These too need a script.
  • In order for your object to attack or be attacked, you need to specify its target_type, can_hunt, and can_hurt properties.

Full object type guide: Creating object types

Animations

Concepts

Animations are made up of frames that are displayed in rapid succession. Each frame has a sprite, and info about how long it lasts. The engine reads sprites from sections of one or more images (called spritesheets). Besides the image, each sprite has hitboxes, which are connected to body parts (e.g. body, head, tail, etc.), and define whether that body part is currently damageable, causing damage, or being ignored. These hit"boxes" are actually cylinders.

How to create animations

Feel free to check or copy existing animations and images for references and ideas.

  1. Create the images that will be used for the object's sprites. In every sprite's image, the object must be facing the right.
  2. Open the game, enter the animation editor.
  3. Use the big button on the right to load the object type whose animations you want to edit. Create its folder in Game_data/Types/<category> if it doesn't exist.
  4. Use the "Edit body parts" mode to create and edit the list of relevant body parts.
  5. Use the "Edit sprites" mode to create and edit the sprites to be used in future animations's frames.
    • Use the big button at the top to select a sprite or create a new one.
    • Use the "Edit hitboxes" button to specify where each body part's hitbox is and what it does. They can be dragged around and resized with the left mouse button.
  6. Use the "Edit animations" mode to create and edit the animations.
    • Use the big button at the top to select an animation or create a new one.
  7. Create the necessary animations for the type of object. To know which ones you need, check the corresponding category article from the list of object categories.

Further info

  • On the animation editor, right-click-drag moves the camera.
  • When making animations for Pikmin, use the "Edit Pikmin top" button on an animation's data to specify where the leaf/bud/flower is on that frame.

Full animation guide: Creating animations

Scripts

Concepts

Scripts use an event-driven finite-state machine. An object is always in one of several states (e.g. sleeping, going home, biting). In this state, it can respond to a series of events (e.g. when it sees a Pikmin, when it reaches its home, when it loses health). Its response consists of a list of actions (e.g. changing animation, changing state, swallowing Pikmin in its mouth, walk somewhere). Only enemies and custom objects use the scripting feature.

How to create a script

Feel free to check or copy existing scripts for references and ideas. It is recommended to create the object you want before writing the script.

  1. Go to Game_data/Types/<category>/<type>.
  2. Inside, create a file called Script.txt.
  3. Inside, add a script block. This means one line has script {, and another has }.
  4. Inside the script block, create a block for the name of a state.
  5. Inside a state's block, create a block for an event. See here for a list of events.
  6. Inside an event's block, write one action per line. See here for a list of action.
  7. In the same file, add the first_state attribute, which specifies what the starting state is, and death_state, which is the state to go to when the health reches zero.
  8. In Data.txt in the same folder, next to the existing object attributes, add the following attributes:
    • territory_radius.
    • reaches, which is a block with named "reaches". Each reach uses the format <pie-slice 1 radius> <pie-slice 1 angle> <pie-slice 2 radius> <pie-slice 2 angle> (the latter two are optional).

Further info

  • To chase after an object, it must first be focused on.
  • For an enemy to eat, it must first set how many Pikmin can be grabbed at max, and which body parts will do the grabbing. After some Pikmin are grabbed, it must then swallow them, which is what really kills them.
  • When an enemy dies, it should run the start_dying and later, finish_dying actions.
  • An enemy can keep a list of variables with any name you wish, and these variables can contain any value you want. You can refer to a variable's value in an action with $variable_name.
  • When switching states, the action that switches the state should be the last one run on the event's code.

Full script guide: Object script