Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-10-2006, 03:07 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
$ vars for display account instead of nick/lights/weather/particles?

These aren't on the Wiki. Anyone want to clue me in?

I also forget the command to get Graal to show script functions or something.

Hmm... well it seems that lighteffectsenabled, weathereffectsenabled, and all that are just flags. I find that a little bit disappointing because I like the $pref names for these types of values. It lets me know that I'm dealing with default user preferences.

Still would like to know if I could use the displayplayeraccountinsteadofnick thing.
Reply With Quote
  #2  
Old 03-10-2006, 03:24 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The Windows-only player list options are not accessible by script
Reply With Quote
  #3  
Old 03-10-2006, 03:38 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Stefan
The Windows-only player list options are not accessible by script
Ooooh, they're only Windows? That's a shame . Would be interesting to implement that into the nick name system as well
Reply With Quote
  #4  
Old 03-11-2006, 02:59 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
Ooooh, they're only Windows? That's a shame . Would be interesting to implement that into the nick name system as well
I think your nickname system is too processor-intensive as it is
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 03-11-2006, 03:05 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by ApothiX
I think your nickname system is too processor-intensive as it is
It doesn't take 30% CPU anymore !!!!!!!!! This would only add as much lag as adding the " (paused)" after the nick.
Reply With Quote
  #6  
Old 03-13-2006, 07:41 PM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by jake13jake
It doesn't take 30% CPU anymore !!!!!!!!! This would only add as much lag as adding the " (paused)" after the nick.
I'm doubting that very much since adding " (paused)" is built into the client and therefore runs at a lower level than gscript itself. If you have a nickname system that uses 30% of the CPU...
__________________
Who has time for life these days?
Reply With Quote
  #7  
Old 03-13-2006, 08:47 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Projectshifter
I'm doubting that very much since adding " (paused)" is built into the client and therefore runs at a lower level than gscript itself. If you have a nickname system that uses 30% of the CPU...
I just wrote an entire post explaining this, but now I'm pissed because it got deleted because the internet sucks.

It used 30% of the CPU on a gmap with an extremely large number for npcs.size(). I had rid of all the lag problems for myself and any of my testers, but a few players got hit by it. I reduced the amount of CPU greatly by using findareanpcs. I believe a findareaplayers would be helpful but not quite as much as findareanpcs was. It would also be quite helpful if you could attach showimgs to players[i] on a strictly local level of interpretation.
Reply With Quote
  #8  
Old 03-21-2006, 10:18 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Quote:
Originally Posted by jake13jake
I just wrote an entire post explaining this, but now I'm pissed because it got deleted because the internet sucks.

It used 30% of the CPU on a gmap with an extremely large number for npcs.size(). I had rid of all the lag problems for myself and any of my testers, but a few players got hit by it. I reduced the amount of CPU greatly by using findareanpcs. I believe a findareaplayers would be helpful but not quite as much as findareanpcs was. It would also be quite helpful if you could attach showimgs to players[i] on a strictly local level of interpretation.
I have a similar system, but showing NPC nicknames was still causing quite a bit of lag on gmaps. So I just disabled NPC names from gmaps.
Reply With Quote
  #9  
Old 03-22-2006, 02:18 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Yen
I have a similar system, but showing NPC nicknames was still causing quite a bit of lag on gmaps. So I just disabled NPC names from gmaps.
Well, if you haven't done this. if (obj.nick && !(obj in players))
---without the !(obj in players) it will make the player's nick invisible if set to 0.
---might be a more precise move to try if ("nick" in obj.getvarnames()), but I don't know if nick might be a static var for NPCs.

What I do for npcs on gmaps is something like findareanpcs(mapx(0,0),mapy(0,0),screenwidth/16,screenheight/16)
I do this on normal levels too. In the same sense I do it for players by checking the range of coordinates-- it might be faster if there was a findareaplayers function, but I can't honestly say.

My nick system continues showimgs in a timeout loop, and uses hideimgs on the very last indeces only by the amount of nicks that will no longer be displayed. If you hide all of the images and then redraw them all, it can make a lot more lag.

I'm pretty sure that the only way I can try to make my nick system less laggy now, though each way I think of could possibly make it laggier, is to incorporate the default nick system, which it wouldn't match quite precisely, keep track of precisely which indeces to hide and then let them fill up, or keep track of every single player to see if they've moved and only change the showimg if they have.

I can't really tell if incorporating the built-in nicks system is faster or slower because my computer isn't extremely affected by lag (unless it's really bad), and to add on that you can't measure the CPU time of the built-in nicks system.

Keeping track of precisely which indeces to hide and then let them fill themselves up would probably be the most likely to reduce lag, but probably wouldn't reduce it significantly, if at all.

Keeping track of every single player's coordinates could possibly create more lag... but I can't really say because I haven't tried it. Something like this would probably make more sense in the state script.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:37 AM.


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