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 12-08-2010, 02:34 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
obj.scriptdone();

It tells the server that the object is not needed on serverside (Static Objects) and still display it clientside.

Pretty simple, but comes in handy for repeated NPCs. (Era Trees or Shrubs etc)
__________________
Reply With Quote
  #2  
Old 12-08-2010, 02:43 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Oh cool, what's the difference between that and letting the script finish itself?
Reply With Quote
  #3  
Old 12-08-2010, 02:44 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
It's not storing it on the serverside once it's finished haha.
(On each update etc)
__________________
Reply With Quote
  #4  
Old 12-08-2010, 08:53 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Yes, this is used on GK for our trees.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #5  
Old 12-10-2010, 07:19 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Could there perhaps be a server option to do this by default where any level NPC has no serverside script or set variables?
Reply With Quote
  #6  
Old 12-10-2010, 07:43 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by ffcmike View Post
Could there perhaps be a server option to do this by default where any level NPC has no serverside script or set variables?
It should automatically do this- but the NPC-Server was out of date (was checking for "if (created) {}". Stefan updated it though, you may need to restart NPC-Server
__________________
Reply With Quote
  #7  
Old 12-10-2010, 09:02 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by xAndrewx View Post
It should automatically do this- but the NPC-Server was out of date (was checking for "if (created) {}". Stefan updated it though, you may need to restart NPC-Server
Actually yeah just noticed this was already happening, surprised it's doing it by default as it also seems to be happening with npcs that have a serverside image, you'd now have to always set a shape on things you'd want to block things like serverside baddy or projectile movement.

Would also be nice if Stefan would publish these efficiency related updates when they become available rather than having to wait on enlightenment from somebody he has told individually, appreciate it though.
Reply With Quote
  #8  
Old 12-10-2010, 11:01 PM
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
This was already in the server for 5-6 or more years The only problem is that it's only detecting if (created) {} scripts by default, while npcs with function onCreated() are not 'optimized away' right now. So you have to call this.scriptdone(); yourself on those objects.
The big advantage is that those npcs don't appear in level.npcs[] anymore, which speeds up findareanpcs() or scanning levels.npcs[].
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 12:25 AM.


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