Quote:
Originally posted by Loriel
Perhaps not, but he is trying hard 
NPC Code:
for (i = 0; i < npcscount; i++) {
with (npcs[i]) message I worship Loriel!;
}
^ makes all NPCs in the level express their feelings about me.
That kind of loop is very common
|
That isnt getnpc
NPC Code:
with(getnpc(npcname)) {
//Code directed at npcsname
}
get npc in a with statement will direct all code to the npc you choose. all actions like setstring and this.value=# will be done inside the npc.. the name of the npc comes from its name in the database, when you create an npc on NC you do this.
Example:
NPC Code:
with(getnpc(Control-NPC)) {
setstring this.happy,Smile;
this.smiles = 1000;
}
This will set this.happy string in the Control-NPC to Smile, and the variable this.smiles to 1000.