View Single Post
  #37  
Old 01-25-2005, 04:57 PM
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
The most important thing is that you are accessing npcscount before adding the npc, because accessing npcscount is causing the local npcs to be loaded, all local npcs in a radius of 1 level.
Most of the time the local npcs are already loaded, because several script commands have the side effect of the npcs being loaded, but in special cases it can happen that you are adding an npc into an area where there is no player and no npc activity. Before adding the npc the local npcs of the current level are loaded (radius 0), but not of the surrounding levels, may be I should change that.
It might sound simple, but I must keep care to not cause a chain reaction, e.g. a local npc putting an npc, the surrounding levels are loaded, the local npcs of the surrounding levels are putting new npcs, at the end the whole gmap is loaded into memory. With putnpc2 it should not be a problem though since I don't expect local npcs to use that command when they are loaded.

Ok will make putnpc2 load all surrounding levels before adding the new npc, then it should work better.
Reply With Quote