What the actual fuck

It’s simple. I give a showcharacter NPC the following line:
say2 #v(npcs[7].width);
7 being its index number as the debugger says.
I get 0… I don’t with any other index that’s not a blank NPC.

I tried restarting my computer.
I tried deleting it and putting back another NPC with the same code in it.

Right now my code to show an image under it shows the image under another NPC (the one with the index number increment down by one).
It makes no sense… anyone has experienced that before or has an idea?

Your method of troubleshooting is questionable. The index the debugger shows is probably wrong. You can just do #v(width), but if you insist on having the index try to find out what it actually is.

for (i=0;npcs[i].width==0;i++) message #v(i), #v(npcs[i].width);

showcharacter width is 3, btw

I’ll use width… thanks. I didn’t know that.
It actually finds the NPC’s index programmatically but in the process of simplification I dumbed it down to directly using the index the debugger shows.
It’s probably a problem of an NPC referring to itself.

Is there a way to get an NPCs own index?


o right yeah thanks