Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Order of operation of npc loading (https://forums.graalonline.com/forums/showthread.php?t=50763)

TB3 02-01-2004 08:59 AM

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 :)

TB3 02-02-2004 07:03 PM

*bump and hopes for an answer*

GoZelda 02-02-2004 10:55 PM

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

Admins 02-03-2004 04:13 AM

? 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.

TB3 02-03-2004 06:15 AM

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 :)

GoZelda 02-03-2004 07:38 PM

Quote:

Originally posted by Stefan
? He means the order of scripts sent to the client
Stefan posts alot lately :eek:

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 -_-)

ZeLpH_MyStiK 02-03-2004 11:37 PM

Quote:

Originally posted by GoZelda

Stefan posts alot lately :eek:

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)


All times are GMT +2. The time now is 05:04 PM.

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