View Single Post
  #1  
Old 05-17-2009, 02:36 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Joining classes first

There's an annoying delay between the time the onActionPlayerOnline function in the Control-NPC is called and when the classes are joined. That, or the level NPCs are called first (onPlayerEnters).

The problem is that this kind of thing happens in level NPCs that have an onPlayerEnters() function:

Quote:
Originally Posted by NC
Script: Function cbk1994.onStaffTag not found at line 7 of jail_level in script of npcs[16] (in level era_jail.nw at pos (29, 36))
Script: Function cbk1994.isStaff not found at line 7 of jail_level in script of npcs[16] (in level era_jail.nw at pos (29, 36))
Script: Function cbk1994.unstick not found at line 8 of jail_level in script of npcs[16] (in level era_jail.nw at pos (29, 36))
This is the onActionPlayerOnline function.

PHP Code:
function onActionPlayerOnline() {
  if (! (
player.account in serveroptions.staff.tokenize(","))) {
    
player.addWeapon("Temp/Server Warp");
    return; 
// goodbye, global news team
  
}
  
  
clientr.serversideReady false;
  
  
player.join("player_itemfunctions");
  
player.join("player");
  
player.join("player_staff");
  
player.join("player_hpfunctions");
  
  
player.loadPlayer();

As you can see, the player class is being joined almost at once.

I think that the server should wait up to five seconds for onActionPlayerOnline to complete and for all of the classes to join, and then trigger onPlayerEnters to level NPCs. This could also be extended to weapons so that they are not called before their items and such have been loaded.
__________________
Reply With Quote