View Single Post
  #6  
Old 09-03-2011, 09:28 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
Quote:
Originally Posted by Gunderak View Post
is there any way to change another npcs variable by some command like findnpc("whatever").this.mode = ?
if i made it join to a class how would i change the class variables via a script?
The this prefix refers to the current object. If you did it as you proposed (which wouldn't work since you can't use findNPC for local NPCs (level NPCs)), you'd be setting this.this.mode. In the example I gave above,

PHP Code:
temp.npc.variableName value
As I said, temp.npc is the actual NPC object.

What do you mean by class variables? That doesn't make any sense, classes are joined to an object. They don't have separate sets of variables.
__________________
Reply With Quote