Rivals of Aether

Rivals of Aether

Chao
This topic has been locked
Bar-Kun  [developer] 29 Oct, 2023 @ 6:18am
Chao Compatibility Guide
CHAO TYPE
The chao will most likely have compatibility with your character, so you might want to check out the Chao Alignment Spreadsheet[docs.google.com].
But in case you want to add/change the type of chao you need to add chao_type to your character.
Possible chao types include:
0 = neutral chao (default if you don't have the compatibility) 1 = hero chao 2 = dark chao 3 = omochao (comes with his own voice) 4 = SSL chao (comes with it's own sound effects) 5 = custom chao (has normal chao noises by default)


CUSTOM CHAO SPRITES SETUP
For custom chao, you need to add chao_custom_spr to your character, feel free to use the template chao[imgur.com] too, but to elaborate:
frames 1-6 = idle frames 7-8 = turn animation frames 9-13 = upset (when you die) frames 14-20 = happy (when you secure a kill/taunt)
The frame count can't be changed.
It should be noted that the chao uses small_sprites all the time, even if your character doesn't,
so custom chao should be exported with x1 the size.
This offsets used by chao normally are 14, 27
You may also set chao_uses_alts to true if you want your chao to be recolorable by alts.


ADVANCED CHAO COLOR COMPATIBILITY
If you have alts that change colors (like a rainbow alt of some sort) or you want the chao to use the outline colors of your character, the chao WILL break your character, so to fix it, use this code below in the character's update.gml to fix it:
if (instance_exists(pet_obj) && "chao_type" in pet_obj) { for (var a = 0; a < array_length(pet_obj.chao_colO); a++) { if (a % 4 < 3) static_colorO[a] = pet_obj.chao_colO[a]; //RGB values else static_colorO[a] = 1; //controls transperency } for (var a = 0; a < array_length(pet_obj.chao_colB); a++) static_colorB[a] = pet_obj.chao_colB[a]; }

Note: try to avoid reloading in practice mode with this piece of code if you have more than 2 of the character using the chao buddy,
as it will mess with the colors. If you do, be sure to also pause the game as it reloads the character.


CHAO VOICE SETTING
Chao can also have different voice options (useful for custom chao).
To change the sounds your chao makes, you need to add chao_sound_type
to your character.
Possible sound options:
0 = mute 1 = regular chao voices (used by neutral, hero and dark chao by default) 2 = omochao voice 3 = chiptune sounds (used by the SSL chao by default)

If the chao's position looks weird on your character you can change the dist_from_player array to fit your values.
It is set up like so:
dist_from_player = [x offset, y offset];
the x offset takes a number of how many pixels away horizontally the chao is (higher number = behind), and the y offset does the same but vertically (higher number = more up)



Almost of the variables above (chao_type, chao_custom_spr, dist_from_player and chao_sound_type) should be changable
on the fly, but you most likely won't need to do that unless you're extra like that.
chao_uses_alts can only be set in init.gml
Last edited by Bar-Kun; 1 Nov, 2023 @ 5:23am