![]() |
How can I make clientside findareanpcs work reliably?
1 Attachment(s)
(I had posted all this, then it fixed itself for a bit, now it's broken again.)
Problem: See picture. The player's weapon: PHP Code:
the trouble is they keep updating the message - even with the timevar - serverside and clientside, no problem - but after they've been idling against a wall for long enough (hard to pin down exactly how long it needs to be; could be a few minutes, could be until a player re-enters the map, could be until a player re-logs, whatever) they Fall Off the findareanpcs results table. Until the player makes them move. Then they're back in the detection area. So do I just have to make the zombies move around every so often? :-P |
Patch:
message("Idle2 v<r "@1+tt@" ("@tx@", "@ty@")"SPC timevar); x=int(x-1+random(0,2)); y=int(y-1+random(0,2)); Horrible, but it works. I'm open to better suggestions... |
Maybe you have sleepwhennoplayers set to true in serveroptions?
|
Hmm, nope, don't see that in there. Would that do that though?
Mostly it just bugs me that movement, or the lack thereof, would cause findareanpcs to screw up...it's like, server, the NPC's either in the area or it isn't, whether or not the NPC's moving shouldn't affect things... |
Are they still in the 'npcs' array?
|
Maybe; is there a findnpcs (findallnpcs, findlevelnpcs, findgmapnpcs) command hidden somewhere? ;-D
|
Quote:
|
Thank you captain smarmypants, that's the same as an answer. I suppose then that I could say with(npcs) or for (npc:npcs) and it's a protected variable which always contains an array of all NPCs on the server in perpetuity? Or should I be doing an old fashioned for(temp.i=0;temp.i<npcscount;temp.i++) if(npcs[i].x... ?
|
Quote:
PHP Code:
|
Well shoot, I wish I'd known that a month ago, I coulda saved a lot of headache; I already run a specific scan on the NPCs in the area to make sure they're lined up with the player, above and beyond the findareanpcs' check to make sure they're in the right general box...
Works a bloody treat. Still ain't thrilled that findareanpcs is unreliable...but I'll live. |
Quote:
|
Yea, I'm using it on a rather large scale and it's working perfectly...
|
I just remembered reading this a while back, might be of help.
Quote:
|
Ahh. Good to know, thanks. I'm using the npc array and it's working swimmingly...which is good, because it'd be rather difficult to update an npc that wasn't saved anywhere at all ever...:-P
|
| All times are GMT +2. The time now is 08:59 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.