Quote:
Originally Posted by Kiwi27
[9:56:33 AM] Vinka: Could you tell fp4 that whenever u edit an npc script within a level with olne and click apply, the line where image name is inserted turns to "-".
From Vinka.
|
Fixed. Either re-download the entire script from my post above or replace the function at the bottom with this one:
PHP Code:
function onApplyScript(obj) {
if (!this.active) {
obj.parent.destroy();
return;
}
temp.npc_id = obj.parent.npc_id;
temp.npc_script = obj.parent.scriptctrl.getlines();
temp.npc_img = obj.parent.imgctrl.text.trim();
obj.parent.destroy();
with (findimg(temp.npc_id)) {
image = temp.npc_img;
image = fileexists(image) ? image : PLACEHOLDER;
temp.npc_x = x % 64;
temp.npc_y = y % 64;
}
setNPCImage(temp.npc_id, temp.npc_img);
setNPCScript(temp.npc_id, temp.npc_script);
if (temp.npc_id > 0) {
changesMade();
updateNPCImage(temp.npc_id, temp.npc_img, temp.npc_x, temp.npc_y, temp.npc_script);
}
}