Modding V1.2.2: Character Add-on


So you want to know how to add your own kooky character(s) to Expandyssey: The Elastic Modulus? There are a few easy steps to add a wide variety of characters to the game. And with the V1.2.2 update, this process is not made slightly easier!

Step 1: Draw some sprites
So far the game takes in 6 different files to allow your character to run around. These are: idle right facing, idle left facing, moving right, moving left, belly with varying sizes, and a tail (optional). When making these files, make sure that:

  • Your character is centered in each of their frames
  • When doing frames, make sure that each frame is of equal size and they are laid out horizontally
  • The Belly by default is drawn 17 pixels above the sprites' center (for a 32x32, that would be 16:31)
  • The part of the tail that connects to the character is on the right side
  • If your making a symmetrical character, you just need to make the right side of the character.

The orange pixel is where the belly sprite's centered on the character sprite (top left of pixel), and the blue pixel is where the sprite's overall center is for the game. If you would like a character template, you can download the Gene Whicon DLC and observe how that character is put together. By default, character frames are typically 32x32.

Step 2: Make a Mod Pack
Now that you have the character drawn up, it's time to add them to the game. Start up the game and go to the Workshop. There, you can get the file path to the sandbox environment. The copy button will only work on Windows computers, and it will copy the address to your clipboard so you can paste it into your file directory.

If you haven't added the Thine First DLC, create a folder named "Content". In that folder make another folder and name it however you want. Typically name it the same as the "mod" your adding. In your "mod" folder create one last folder and give it the name of your character your adding. This folder is where you copy and paste your character images. Go back to your "mod" folder and create a .txt file named "Start.txt". The file structure should look something like this:

>ExpandysseyTEM
--options.ini
->Content
-->"mod"
----Start.txt
--->"character"
-----image files of said "character"

Step 3: Code the Mod Pack
Now that you have all the files you need, open the "Start.txt" file in a basic .txt file editor like Notepad or Notepad++. You should first write and describe in general what your mod pack does, you can use the "//" comment lines or "/* */" comment block. However, if you use the comment block, the character "*/" MUST be on a new line.

Your next line should declare for what version this mod is intended for. It's not necessarily required, but it's used as a safety measure and to let the program know how to handle the mod if it's outdated. The line you should write is "version = 1.2.1" or something similar.

Next is where we start importing your character. Write this line, filling in the parameters with quotes when indicated:

v = newCharacter("Name","Title","Fill Types",Belly Size (Max, optional),Height (in inches, optional),Weight (in lbs, optional));

  • "Name" is a string (requiring quotes) that is the name of the character.
  • "Title" is a string that is the title of the character.
  • "Fill Type" is a string list written as "00,01,02" with pairs of numbers representing the types of substances they can consume. A list will be provided later in the document.
  • Belly Size is an integer (a whole number, these must be positive in this case) that dictates how big the character's belly can get. This is optional with the default being 8.
  • Height is an integer that tells how tall the character is in inches. This is optional with the default of 64" (5'4").
  • Weight is an integer that tells how heavy a character is in pounds (lbs). This is optional with the default of 150lbs.

Now assigning newCharacter() to "v" is important, as this integer dictates the index/id of your character. You must complete all your editing with that character before adding a new one with the newCharacter() function again!

Now you can import the images from the character folder in this format using the sprite_add() function. Before you had to directly access the global sprite double array g.draw, but now you can just use v.draw.<variable> to access it by name:

v.draw.<variable> = sprite_add("<foldername>/file.extension",number of frames,remove background?,smooth?,x origin,y origin);

  • v.draw.<variable> is a mod friendly access to the global double array that holds all the character's sprites. A list for these variables will be provided later in the document.
  • <foldername> should be the name of the character folder you wish to import. File.extension should be the entire name of the image file, including its extension, that your assigning to that index. The .PNG format is recommended. NOTE: the directory is in the scope of your mod folder, so you cannot access outside that folder!
  • number of frames is an integer that indicates how many frames of animation the sprite has. This is optional, and its default is 1.
  • remove background? is a boolean (1 is true, 0 is false, a simple yes/no, true/false parameter) that asks if the background to the sprite should be removed or not. This is optional and is defaultly 1.
  • smooth? is a boolean that asks if it should smooth the edges of the sprite or not. This is optional and is 0 by default.
  • x origin is an integer that places the x origin of the sprite. This is optional and is defaultly 16. This should be changed when importing the belly, to the value of 0.
  • y origin is an integer that places the y origin of the sprite. This is optional and is defaultly 31. This should be changed when importing the belly to 0, and to 8 when importing your tail (assuming your tail is a 16x16 sprite, otherwise make the value half of the sprite's height).

Lastly, to make it so the player can access your new character, let's add them to the roster. Use this line to add them into the game and to be usable:

g.roster[e,0] = v;

This just adds your current character to the end of the global double array g.roster.

Since 1.2.1, we can edit the character's stats before we are done with them. However instead of accessing the double array, we can access the character's stats by using this:

v.<variable> = <value>;

A list will be provided later in the document for the variables you can access with this.

A new feature which allows for alternates in the roster makes it so you can make alternates of your character. To do so, first before we declare a new character, we need to assign it to a variable as such:

num <variable> = get_roster_number(v);

  • num is the declaration variable to assign a number to the <variable> you made.
  • <variable> is the keyword to access your variable. It can be anything except one of the system's variables. NOTE: This is case-sensitive!
  • get_roster_number() is a function that searches g.roster for the location that your character is placed in. This returns the first index position in the roster.
  • To change the value of this variable, declare it again as such.

Now if you wish to add an alternate to your character or group them into one slot, declare it as such:

g.roster[var(<variable>),e] = v;

  • var() is the accessor for the variable, to let the interpreter know that your trying to access a user made variable.
  • The e sets the slot to be at the end of the alternates. Setting this to a number is asking for trouble.

Step 4: Enjoy!
Now boot up the game and have fun with your 20+ belly sized kangaroo with super jump and cheetah speed, or whatever character you come up with! Happy gaming/modding!

Closing thoughts
Though there might not be a lot to play with right now, and some (if not most) practices will need to be revised after a future update, I still recommend having a separate file that has your character in parts, as a future update will require the character to be more sliced up for a paper doll like system.

FAQ:
Question: What if I don't have photoshop to make a transparent background? Answer: You don't necessarily need a fancy art program like that, a simple program like MSPaint is fine. Just make the color that you want removed from the background be different from your character. However make sure that the bottom right pixel is the color you want removed.

Features planned for character creation:

  • Built in workshop feature to allow players to create their characters easier with an array of templates and premade options.
  • Option to add more parts to character such as "Halo"s and Wings.
  • Auto detect parameter so strings do not always need quotes
  • Add array syntax variant (so it could support arrays written like arr[#,#])

Reference to Fill Types:
Those that have a strike through them are currently unimplemented but are (hopefully) planned for in later updates. Not all fillings are listed.

00 = Air
01 = Helium
02 = Food
03 = Fire
04 = Object "Vore"
05 = Magic
06 =Candy
07 = Vore
08 = Water
09 = Cotton
10 = Data
11 = Electricity
12 = Slime

Reference to the v.<variable>:

  • v.bellymax - Sets the max size of how much the belly can hold. Is 8 by default. Reminder, when making the belly sprite, add a frame at the start for the "Empty" state!
  • v.height - Sets the height of the character for jumping vertical collisions. Is 65 (5'5") by default.
  • v.filltype - Sets the filltypes that the character can consume. Is "Filltype" by default.
  • v.jumpspeed - Sets the jump speed of the character. Is -7 by default. Reminder, this needs to be a negative or else they are unable to jump!
  • v.name - Sets the name of the character. Is "Name" by default.
  • v.scalesize - Sets the scaling size of the character. Is 2 by default. Reminder, this is a float, but it's recommended if you choose a floating number, 0.5 is the only one that will work with the screen resolution at the recommended setting. Otherwise choose a while number.
  • v.symmetrical - Sets the symmetry of the character. Is True by default.
  • v.title - Sets the title of the character. Is "Title" by default.
  • v.walkspeed - Sets the movement speed of the character. Is 7 by default.
  • v.weight - Sets the weight of the character for pressure buttons. Is 150(lbs) by default
  • (!) v.width - Sets the width of the character for horizontal collisions. Is 32 by default. NOTE: Not implemented yet!

Reference to the v.draw.<variable>:

  • v.draw.<variable>
  • v.draw.idle_R - Sets the Right idle animation.
  • v.draw.idle_L - Sets the Left idle animation.
  • v.draw.move_R - Sets the Right movement animation.
  • v.draw.move_L - Sets the Left movement animation.
  • v.draw.belly - Sets the belly size change animation.
  • v.draw.tail - Sets the tail sprite to be animated.

Thank you for your time and support. Have a nice, safe, and fun day!

Files

Gene Whicon DLC (V1.2.2) 2 kB
Nov 15, 2020

Get Expandyssey: The Elastic Modulus

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.