![]() |
Serverside Joining of Clientside Player Functions
Joining classes to the Player Clientside is a useful feature that cuts down on replicate coding and makes important actions/data retrieving more easily accessible, however you have to use player.join("classname"); Clientside rather than whatever Clientside parts of the class script loading when joined Serverside and it seems as if your client has to retrieve the class script from the server before loading on the client, this causes a delay in the script being accessable which while possible to work around can be frustrating.
Would it be possible for Serverside player.join(""); (if not a seperate function) to also join Clientside functions to the player object, and as a result enabling these functions to be accessable as soon as the player logs in? On a side note, it's annoying that you have to completely restart your client whenever a Clientside player class script is updated in order for it to kick in, this seems to be the case even if you unjoin and re-join the class to the player after updating. |
I agree at the annoyance of restarting the client. It'd be nice if the delay was fixed as well. On Era we do:
PHP Code:
|
Quote:
|
Quote:
PHP Code:
|
Quote:
Weapon/NPC - PHP Code:
PHP Code:
|
Bump.
|
What about...
PHP Code:
|
Quote:
|
Eventually use onClassDownloaded(classname), or after joining you call a function, which will automatically wait until the classes are downloaded and then call the function.
|
Quote:
|
This seemed to work for me:
wNPC A: PHP Code:
PHP Code:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
|
What he means is that you do one weapon which is using all needed classes, since it's preloading the classes for weapons.
|
I've set this up as:
PHP Code:
First signs indicate this is indeed working having added new class functions and logged into a level containing these functions clientside onCreated. |
Unfortunately there still seems to be a problem when it comes to Observer Mode.
onCreated is sometimes (it's pretty random, maybe down to lag) not occurring within weapons for players logging on while entering OM, whereas it is within level npcs, which would then result in an error for where Systems and player classes aren't found. The problem then is that these functions aren't occurring in the npcs once you exit OM (may be down to being on a gmap). So lets say you have a baddy having its object added to a damage system onPlayerEnters, this problem would be preventing this process and resulting in the baddy being unable to harm you. My hope is to remove the need for a lot of different initialisation checks. |
| All times are GMT +2. The time now is 10:25 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.