Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Ok, i used your script and checked the names of the sprites again.

But had the same result.

To be sure, i made an extra sprite, named NPC01.


I think i will try it later with a decoration that has no numbers in the name. maybe that´s the problem?

(1 edit)

my states file i copied this from was torch1.states

so number shouldn't matter

did you reimport the four frames from the editor to make sure that NPC01 has the correct frames declared for the entity?

you are usually better off reimporting images in the editor than just putting graphics in the folder yourself

Wait, i´m confused. Import the 4 frames for the Idle animation?

How can i import 4 frames just for Idle?

(2 edits)

no. do this.



image NPC01 0 3

this loads frame0 frame1 frame2 and frame3 (aka idle, death 1 2, corpse from the entity "NPC01" into memory

state IDLE NONE 0

frame 0 0.25 0 0 0 NONE

frame 1 0.25 0 0 0 NONE

frame 2 0.25 0 0 0 NONE

frame 3 0.25 0 0 0 READY

this declares that when the state "IDLE" happens, the entity should display the 4 frames (0 to 3) from "NPC01" and that each frame should be display for a quarter of a second, and finally that when the frame 3 is finished, the entiy is "READY" so it can become a new state (or repeat it's same state, so IDLE state will just run in a loop if you don't kill the NPC.



oh and also make sure your file in /States/ is "DecorationName.states" so NPC01.states

it is states with s at the end, not .state

i fucked that up when i first started using states

Ok, i´m so dumb.

You know what? I had everything right  but the file extension.

I had NPC01.script in the States folder. XD

Thank you man!

happy dev

You can import only 1 idle sprite and then paste the other sprites into Enemies folder. Then you can suggest them in states. 

oh so you could have an npc with way more animations that way. never thought of that.

NPC01.states

image NPCEnemy 0 12