Page 1 of 1

Spawned NPCs Are Not Animating

Posted: Thu Jun 23, 2016 5:29 pm
by Sambo
I have an NPC which uses custom graphics and has a changed number of frames. By default, it has 4 frames, the custom one only has 2. For some reason, instances of this NPC created using NPC.spawn() don't have an animation. They just stay on the first frame. Why is this happening, and how can it be fixed?

Re: Spawned NPCs Are Not Animating

Posted: Thu Jun 23, 2016 6:37 pm
by Quantix
Maybe it has something to do with the type of NPC you're using?

Re: Spawned NPCs Are Not Animating

Posted: Thu Jun 23, 2016 7:11 pm
by PixelPest
Would you please say what NPC it is and upload the graphics that you are using?

Re: Spawned NPCs Are Not Animating

Posted: Sat Jun 25, 2016 8:08 pm
by Sambo
I just uploaded this screen of the level's directory:
Image
The problem is with NPCs 33, 88, 103, and 138.
All the text files have the same codes:

Code: Select all

width=32
frames=2
As I said, the problem only occurs with NPCs spawned with the NPC.spawn() function. If I place the NPC in the editor, the animation works fine.

Re: Spawned NPCs Are Not Animating

Posted: Sat Jun 25, 2016 9:12 pm
by Willhart
Sambo wrote:

Code: Select all

width=32
frames=2
You might need to set both width and height. I remember that causing trouble sometimes.

Re: Spawned NPCs Are Not Animating

Posted: Sat Jun 25, 2016 9:15 pm
by PixelPest
Willhart wrote:
Sambo wrote:

Code: Select all

width=32
frames=2
You might need to set both width and height. I remember that causing trouble sometimes.
Also try gfxwidth and gfxheight

Re: Spawned NPCs Are Not Animating

Posted: Sun Jun 26, 2016 8:52 pm
by Sambo
Neither of the things you suggested helped. There is still no animation. Also, wouldn't there be animation problems with ALL the NPCs, not just those created with NPC.spawn() if this was the issue?