amethyst/evoli

Add a new creature (repeatable)

erlend-sh opened this issue · 3 comments

See our documentation on Creature Designs and How to make a new Evoli creature.

New creatures

I looked into implementing Blin as specified in @erlend-sh's post.

Every new pair of blins will be randomly assigned one of 9 available styles.

I was wondering what would be the best way to implement this. The quick & dirty way, I guess, would be to just create nine creature-prefabs and then chose one randomly when a new Blin pair is spawned. Is there a more elegant way, for example allowing "graphics" in CreaturePrefabData to be an array of materials? Or using a single sprite sheet for all styles? (Sorry, if there is an really obious way to approach this with amethyst, but i'm very new to it)

One of the core devs might have something cleaner in mind but we’re usually very much in favor of quick & dirty for a first iteration ;) You can use the placeholder art asset provided in that post to make a proof of concept using your proposed prefabs method.

@kastenbutt You should be able to create one prefab where you exclude the sprite. In the DebugSpawnTriggerSystem you can set the sprite based on a random number using creature_entity_builder.

This would be quick and dirty since the DebugSpawnTriggerSystem should not know specifics about the creatures.

Your solution of declaring an array of materials could be to implement by custom PrefabData called RandomSprite that contains an array of sprites. In the add_to_entity method you pick one randomly and assign it to the entity.
This is a little bit harder, as I find prefabs to be unintuitive and documentation a little bit lacking, so if you encounter any issues I'd recommend to ask the Amethyst community on Discord or on the Forums