Home Community projects (in development & updates) Added -> random avatar actions / Twich chat color as chat color

Added -> random avatar actions / Twich chat color as chat color

by BlushyFace

+ Twitch chat color can now be used as the chat color that avatars use as their chat color
Avatars have a new property called ChatColor -> Avatar.ChatColor, this contains the chat color of the user that chats on twitch. If it’s not set then the color is default.

+ Random avatar actions + example

Below is an example how avatars can do random action.
Avatar actions are defined in the avatar text file and ideally you want the avatar do something more intelligent than random stuff.

imgur.com/a/klIVVhf

if (avatarItem.Action.CurrentFrame >= avatarItem.Action.Frames) {
	var currentAction = avatarItem.Action; // keep current X/Y
	avatarItem.Action = avatarItem.Actions[Math.floor((Math.random() * avatarItem.Actions.length) + 0)]; //get a random action
	avatarItem.Action.IsReverse = Math.floor((Math.random() * 50) + 1) <= 25; //random direction 
	avatarItem.Action.CurrentPosX = currentAction.CurrentPosX;
	avatarItem.Action.CurrentPosY = currentAction.CurrentPosY;
}

+ Avatar variations
Added support for avatar variations meaning if you have multiple avatars but with slight differences like color etc, you don’t need to create a new data file with the same actions. For examples, I have a bunch of jellybean avatars with different color variations but otherwise they are the same. To do this you need to add the variation names in the main file like this:

name=Jellybean
defaultaction=walk
variations=jellybean_purple,jellybean_red,jellybean_orange

.. and then define the avatar actions that work on all variations. Don’t forget to put the variations in the Assets/avatar directory for it to load automatically.

https://cdn.discordapp.com/attachments/523261318183124992/559537163646271498/unknown.png