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 02-01-2004, 08:59 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
Order of operation of npc loading

Ok here is something odd i just found
Ok here is the first instance of the problem im having.
When you enter a level normaly the npcs in your inventory do the "if(created || playerenters)" and in level non serverside npcs next then the server npcs usualy catch up after a small lag thats hardly noticable on most servers. However!!!
If you change to fullscreen mode (alt + enter) Then -Weapons load their if(playerenters) script after clientside level npcs load their if(created). Ive tested this on my server only can someone else verify this? you can do it with an easy setplayerprop #c,first; and so forth in a weapon and a clientside npc and then try it in both screen modes. Is this an error ? or is there no order of operation? if it is an error can it be fixed in the next version?
It is quite vital to some of my npcs that there be an order of operations and i was hoping weapon npcs first then db npcs but I guess that can be worked around.
Thanks
__________________

To the sun of your age, I arise
Reply With Quote
  #2  
Old 02-02-2004, 07:03 PM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
*bump and hopes for an answer*
__________________

To the sun of your age, I arise
Reply With Quote
  #3  
Old 02-02-2004, 10:55 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
1. The npc server program consist of following instructions:

- load options
-- connect to gserver
if connection can be established:
--- load levels
----load npcs from database
----- while the connection to the gserver is up:
------ get data from gserver;
this contains following type of data:
--player attributes
--temporary level data (bombs, explosions, bush removing, items, ...)
-- PMs
-- game time
-- levels to update/reload
-- server. flags added/deleted
---------- run all npc scripts
------------ send changed npc attributes to the players
--------------- send changed player attributes to the gserver & players
--------------------- wait till 0.1 seconds are over
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #4  
Old 02-03-2004, 04:13 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
? He means the order of scripts sent to the client

Possibly try to use the weaponorder= option in the server options, where you can list weapon scripts that should be sent first. I think the weapons are not sent all at once if you have several big scripts, so some of them might come after the local npcs are sent. If you need data in the local npcs then you can use client strings or serverr. strings, those should be sent first, or you add some sleep 1 or so in the necessary npcs although that is making the scripts look ugly. It could also be possibly to add a server options to enforce sending the weapon scripts before the npcs.
Reply With Quote
  #5  
Old 02-03-2004, 06:15 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
Quote:
Originally posted by Stefan
? He means the order of scripts sent to the client

Possibly try to use the weaponorder= option in the server options, where you can list weapon scripts that should be sent first. I think the weapons are not sent all at once if you have several big scripts, so some of them might come after the local npcs are sent. If you need data in the local npcs then you can use client strings or serverr. strings, those should be sent first, or you add some sleep 1 or so in the necessary npcs although that is making the scripts look ugly. It could also be possibly to add a server options to enforce sending the weapon scripts before the npcs.
Yeah I was hoping for either the level npcs or the weapons to load in sequence that wouldnt change
It seems that if you change screen mode it changes order that it loads around odd I didn't think that would do something like that but it does.

A server option that enforces , and or a change that forces scripts in weapons such as playerenters to run before level npcs or visa versa would be wonderfull
__________________

To the sun of your age, I arise
Reply With Quote
  #6  
Old 02-03-2004, 07:38 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Quote:
Originally posted by Stefan
? He means the order of scripts sent to the client
Stefan posts alot lately

Heh i just posted that in the hope it was useful. I thought he was meaning database NPCs and weapon scripts (if they're not the same -_-)
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #7  
Old 02-03-2004, 11:37 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally posted by GoZelda

Stefan posts alot lately
Yesh, he should do this daily. His posts are very educational, in the sense that I learned a lot more about gscript...(not that theres much more ways of using educational hehe)
__________________
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 04:02 AM.


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