Quote:
Originally Posted by DustyPorViva
I think the bigger problem people should be considering is the fact that you have to showcharacter() in order to get it to take damage.
Let's see the script.
|
sorry, was trying to avoid a wall of text in first post. it takes damage it's just that the npcs won't attack it unless i have "showcharacter" in it's script. it's like they can't see it unless i add that bit in, i find that a bit strange since i didn't have to do that with other npcs... but here's the script anyway, maybe someone could just tell my why the npcs don't attack it.
this is for the offline editor.
sorry about it not being neat, and i know some things may be scripted strangely.. but everything i learned about scripting i learned from pressing random buttons. didn't know about the forums until a few years after i got the editor.
PHP Code:
// NPC made by John
if (created) {
showcharacter;
setcharani wall,;
hearts = 1;
this.hp = player_carpentry_lv*100;
}
if (timeout){
message #v(this.hp);
}
if (actionattack && this.hp>0) {
this.sdamage = random(player_weaponpower,player_weaponpower*10);
this.stdamage = random(player_strengthlv,player_strengthlv*5);
i = random(0,100);
if (i<10) this.hp -= (player_weaponpower*20 + player_strengthlv*10);
if (i<10) play critical.wav;
else if (i<100) this.hp -= this.sdamage + this.stdamage;
}
if (actionshot && this.hp>0) {
i = random(0,100);
if (i<10) this.hp -= bulletpower*10;
if (i<10) play critical.wav;
else if (i<100) this.hp -= bulletpower;
shot = 3;
}
if (actionfire2 && this.hp>0) {
this.hp -= firepower2;
}
if (actionwater2 && this.hp>0) {
this.hp -= waterpower2;
}
if (actionearth2 && this.hp>0) {
this.hp -= earthpower2;
}
if (actionlightning2 && this.hp>0) {
this.hp -= lightningpower2;
}
if (actionlight2 && this.hp>0) {
this.hp -= lightpower2;
}
if (actiondark2 && this.hp>0) {
this.hp -= darkpower2;
}
if (actionmana2 && this.hp>0) {
this.hp -= manapower2;
}
if (actionattack2 && this.hp>0) {
this.hp -= attackpower;
}
if (this.hp<=0 && timeout){
play explode1.wav;
play explode2.wav;
play explode3.wav;
destroy;
}
timeout = 0.05;
if anyone knows how to change the size/shape of a gani (if it's possible) or why the npcs won't attack it if it doesn't have "showcharacter" the help would be appreciated
