Skip to content

Commit

Permalink
creating charactesrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Frakits committed Sep 1, 2024
1 parent ad4e900 commit 0af5d6c
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion src/docs/Modding The Engine/Creating characters/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# Creating Characters

gggggggod there's fucking NOTHING to note here.
Creating characters thru the engine is not available yet, so you have to manually add the files yourself.<br>
All you need is the spritesheet and an XML file for the data.<br>
The spritesheet goes in ``./images/characters/`` and the XML file in ``./data/characters``.

Writing the XML file is pretty simple, here is what Dad's XML data looks like:
```xml
<character isPlayer="false" flipX="false" holdTime="6.1" color="#AF66CE">
<anim name="idle" anim="Dad idle dance" fps="24" loop="false" x="0" y="0"/>
<anim name="singUP" anim="Dad Sing note UP" fps="24" loop="false" x="-6" y="50"/>
<anim name="singLEFT" anim="dad sing note right" fps="24" loop="false" x="-10" y="10"/>
<anim name="singRIGHT" anim="Dad Sing Note LEFT" fps="24" loop="false" x="0" y="27"/>
<anim name="singDOWN" anim="Dad Sing Note DOWN" fps="24" loop="false" x="0" y="-30"/>
</character>
```
There's a lot to unpack, but we'll go over the ``character`` node's properties first:
- ``sprite`` determines which sprite to load, if you have a spritesheet with a different name.
- ``isPlayer`` determines whether your character is a player character or not *(for example, boyfriend is a player character)*.
- ``x`` and ``y`` determine the character's position in the stage. *(keep in mind that stages can override these values)*
- ``scale`` determines the scale of the character.
- ``camx`` and ``camy`` adjusts the character's camera point.
- ``flipX`` can be used if your sprite is facing the wrong direction.
- ``antialiasing`` determines if your sprite should use antialiasing or not.
- ``gameOverChar`` defines the separate character to be used on the Game Over screen *(for example bf-dead)*
- ``icon`` can be used if your character icon has a different name.
- ``color`` defines the color of it's Health Bar part.
- ``holdTime`` defines how many steps it should wait until resuming to it's idle.

These are about all properties you can apply to the character node.<br>
You can obviously apply more properties and access them in Scripts, see <a href="../Scripting/PlayState Scripts/Character or Stage Scripts.md">Character/Stage Scripts</a>.

As for animation nodes, they're pretty self-explanatory but here's a list of properties of them too:
- ``name`` defines the internal name of the animation *(used for scripting)*
- ``anim`` is the prefix for finding the animation in the spritesheet.
- ``indices`` indicates which frames to play from the previously found frames.
- ``type`` determines the type of the animation. either ``beat`` or ``loop``.
- ``fps`` is the framerate of your animation.
- ``x`` and ``y`` are the animation offset. *(offset is only applied when the animation is played)*
- ``forced`` whether or not to force animation playback while a different one is already playing.
- ``loop`` to make your animation loop.

0 comments on commit 0af5d6c

Please sign in to comment.