Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   callnpc 'index' ? (https://forums.graalonline.com/forums/showthread.php?t=21999)

nyghtGT 01-25-2002 07:28 AM

callnpc 'index' ?
 
Uhh, I have been using callnpc quite
a bit lately ... And I wanted to know
if there is a way to find the NPC index
without using something like:
NPC Code:

NPC Code:

for (i=0;i<npcscount;i++) {
callnpc i,event;
}




I understand how everything works, I
just would like to know if there is a
way to get the index of an NPC ...

Loriel 01-25-2002 07:55 PM

Uhm.
testnpc(x,y)?
I guess there isn't...

LiquidIce00 01-26-2002 03:24 AM

depends what you are looking for .. if you are looking for a certain npc in a lvl u can browse thru the npc array and stuff .. but like u cant set ne properties in a npc in which you will be able to view thru there..

nyghtGT 01-26-2002 03:26 AM

Quote:

Originally posted by LiquidIce00
depends what you are looking for .. if you are looking for a certain npc in a lvl u can browse thru the npc array and stuff .. but like u cant set ne properties in a npc in which you will be able to view thru there..
well, I mean I was just wondering if there
was a way to test for the index sorta like
on images ...

Gohan43331 01-26-2002 08:55 AM

Quote:

Originally posted by nyghtGT

well, I mean I was just wondering if there
was a way to test for the index sorta like
on images ...

Look in the debugger (there's numbers beside the name of the image and other npcs...It's not always right, but it should be within 2 numbers)

Gohan

LiquidIce00 01-26-2002 09:09 AM

Quote:

Originally posted by nyghtGT

well, I mean I was just wondering if there
was a way to test for the index sorta like
on images ...

u can check the npc's image now i believe

BocoC 01-26-2002 10:36 AM

You mean only call the event on a certain NPC? Try setting a special number to one of the npc's save variables, then looping through all the NPC's in the level looking for the NPC with the certain save variable:
NPC Code:

for (i=0;i<npcscount;i++) {
if (npcs[i].save[3]==11) callnpc i,event;
}


entravial 01-27-2002 09:53 AM

~AlphaFlame~

Well if you have the npc with a certain image...

#f(i)

:asleep:


All times are GMT +2. The time now is 04:36 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.