Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Bug Report (https://forums.graalonline.com/forums/forumdisplay.php?f=193)
-   -   npcs[0].id (https://forums.graalonline.com/forums/showthread.php?t=83944)

Tyhm 01-30-2009 02:45 PM

npcs[0].id
 
ask a bunch of npcs what their id is (npcs[0].id).
Offline, they'll all give different answers.
Online, they'll all say 1.
Has this been secretly deprecated and nobody told me? -_-

xXziroXx 01-30-2009 05:59 PM

Quote:

Originally Posted by Tyhm (Post 1461308)
ask a bunch of npcs what their id is (npcs[0].id).
Offline, they'll all give different answers.
Online, they'll all say 1.
Has this been secretly deprecated and nobody told me? -_-

The first entry in the npc's array obviously have the id of 1, since it's the first npc in that level to be initialized. :oo:

Admins 01-30-2009 06:48 PM

It's possible that npcs[0] was always the current npc (this), but it has been changed, now npcs[] is actually level.npcs[]. On the other hand players[0] on client-side is still the current player when I remmember correctly.

Tyhm 01-30-2009 11:24 PM

Alright, so for an NPC to get its own ID it has to go level.npcs[0].id? Or does it have to search through level.npcs[] until it finds itself? :-P

Loriel 01-30-2009 11:56 PM

Quote:

Originally Posted by Tyhm (Post 1461365)
Alright, so for an NPC to get its own ID it has to go level.npcs[0].id? Or does it have to search through level.npcs[] until it finds itself? :-P

I would kind of assume it has to do this.id, at most.

Tyhm 01-31-2009 12:33 AM

Oh, gosh, that's loads easier.

Now if I can just figure out how to get a nonzero value returned for npcscount, level.npcscount, npcs[i].x, level.npcs[i].x....

Admins 01-31-2009 01:05 AM

npcscount should normally work fine, otherwise use npcs.size() or level.npcs.size(). If those don't exist then the npc is probably not in a level (control-npc timeout ?)

Tyhm 01-31-2009 01:33 AM

chompy taught me with(findareanpcs(etc)), thx all. :-D


All times are GMT +2. The time now is 02:31 AM.

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