Thread: Instance?
View Single Post
  #7  
Old 05-26-2007, 01:05 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by theHAWKER View Post
i dont understand how to use that stuff, could you use it in a script?
say ur trying to make an npc move called "rupert"
You can't name level-npcs like that, you need some way of finding it.
Edit: Oh my, nevermind, you can set up a global reference to the object.
PHP Code:
//The script of "rupert"
function onCreated() {
  
NPCRupert this;

Then you could reference that object using NPCRupter.variable. Of course there are other things to consider, global vars are cleared on a restart of the environment, for clientside that would be if you restarted Graal or changed server. And for serverside, that would be when the server restarts.

Something I did on Aeon was to add a new global var Control pointing to Control-NPC.

There is an array npcs representing all npcs in the current level.
__________________
Reply With Quote