Page 1 of 1

NPC frames

Posted: Thu Dec 24, 2009 2:18 pm
by agentorangeguy
Hello, I was messing around with the wounded man shape in BG (Shape # 447 I think?) and making an NPC with that shape. The NPC just lays there in the first frame, not cycling through all the wounded frames as the shape itself does if you just lay it there. I tried playing around with the flags for the NPC, giving it different schedule types, but nothing happens except for the npc moving around like it was floating or something.

Can the wounded man shape be viable for NPC's and function properly if you do some kind of code in the NPC's usecode where it will cycle through all the frames randomly? How would I go about doing that? Thanks!

Re: NPC frames

Posted: Thu Dec 24, 2009 5:13 pm
by Donfrow
You should be able to make a proximity call to cycle through the frames of the shape.

In one of my NPC's I have the below usecode that works (though it was a bit slow to cycle through each frame):

else if (event == PROXIMITY)
{
script item
{
frame 0;
repeat 32
{
next frame cycle;
};
}
}

Where PROXIMITY is 0.

I believe I butchered the original code for the loom from found at seventowers to make that.

Re: NPC frames

Posted: Sat Dec 26, 2009 2:21 am
by agentorangeguy
Hmm, I'll have to try this.