Just whipped up a quick little putnpc3() function to make it easier on folks who'd rather not make an npc in a level in the level editor etc. then upload etc.
PHP Code:
/**** Notes ****\
PARAMS:
levelname - The level you wish for the npc to be placed at.
x - The x coordinate the npc will be placed at.
y - The y coordinate the npc will be placed at.
classes - Supports both arrays and single strings. List of classes joined to the npc.
vars - Supports both arrays and single strings. Variables you wish set to the npc.
vals - Supports both arrays and single string. Values for the variables.
\***************/
public function putnpc3(levelname, x, y, classes, vars, vals) {
with (findlevel(levelname)) {
with (putnpc2(x, y, "")) {
if (vars.type() == vals.type()) {
if (vars.type() == 3) {
if (vars.size() == vals.size()) {
for (v = 0; v < vars.size(); v++) {
this.(@ vars[v]) = vals[v];
}
}
}
else {
if (vars.type() == 1) {
this.(@ vars) = this.(@ vals);
}
}
}
this.joinedclasses = classes;
}
}
}