NPCServer updates (6)
There are new versions of gserver and npcserver, they are uploaded to all machines, but might need to be restarted manually. There are a few updates for the new scripting engine:
- Fixed Switch-in-switch commands, before the switch command was eating the case label that was in front of it - new onInitialized() event for database npcs when the server has been restarted - You can create scriptable objects now (besides players and npcs): this.item1 = new TStaticVar(); this.item1.join("itemfunctions"); ... this.item1.destroy(); Differences to normal objects: - they are never copied, they are only linked - same behaviour like with GUI objects and players or npcs, if you do pl = player then pl will not recreate the player, if you access pl.account then it will actually access player.account - they are scriptable, which means they can join classes and run scripts (think of living inventory objects) - they are destroyed once no variable is linking to it anymore (e.g. if you do this.item1 = NULL; this is using a garbage collector system like in Java), or if you call destroy() for the object - they can have a name, you can do this.item1 = new TStaticVar("MyFirstItem") and then also access it directly by name, e.g. MyFirstItem.subvar = 123 |
Wahoo! Stefan added my suggestions!
This makes me very happy. :) |
Quote:
Quote:
MAYBE. ;) |
Would it be possible to do:
new TStaticVar("Test123") { h = 3; } and then use Test123.h to get 3? I'm basing this off of the Gui Controls... |
It seems that Aeon didn't go up after the update ...
|
I really can't see any use for this.. Can someone give me an example?
Why not just use something like whatever.huh = 3? Unless I'm mislead on how it functions.. |
You would need to do this.h = 3
Like I said, it can join classes, then you can define public functions in the class and then you can do stuff like object.functionname(). Also it can use timeouts and such. I guess it's good for inventory systems, and for complex data. |
Oh, sorry, I was being an idiot.
For some reason, I thought it could only hold variables.. And then I read it again and I'm like.. Wow.. |
This works fine, thanks for help.
Having its own timeout is very nice. It would be useful if it was possible to call public functions without an object like you do with normal functions. |
What doesn't work with those functions ?
|
When you do call a public function you have to put the weapon name before it, i'd like to be able to call it without using the weapon object:
addItem() instead of: weaponname.addItem() I'd also like to be able to call functions clientside<->serverside. It would help greatly in my inventory system. |
Quote:
Quote:
|
Quote:
I have in a database NPC: NPC Code:function onInitialized() { But when I restart the NPC server, it doesn't work. |
All times are GMT +2. The time now is 07:29 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.