I have a gani script and I'm trying to load archetype variables. But it doesn't work.
PHP Code:
SCRIPT
function onCreated() {
this.baddyname = "Default";
getBaddy();
onTimeOut();
}
function getBaddy() {
this.baddy.loadVars(
format("archetypes/baddies/%s.arc", this.baddyname));
}
function onTimeOut() {
showtext( this.index, this.x+2, this.y+3,"Verdana", "c",
this.baddy.nick);
showtext( this.index+1, this.x+2, this.y,"Verdana", "c",
this.baddy.hp @ "/" @ this.baddy.fullhp);
changeimgzoom( this.index, 0.75);
changeimgzoom( this.index+1, 0.75);
if (this.baddy.hp > this.baddy.hp/3)
changeimgcolors( this.index+1, 0, 1, 0, 0.99);
if (this.baddy.hp < this.baddy.hp/3)
changeimgcolors( this.index+1, 1, 1, 0, 0.99);
if (this.baddy.hp < this.baddy.hp/6)
changeimgcolors( this.index+1, 1, 0, 0, 0.99);
if (this.baddy.aggressor == 0) changeimgcolors( this.index, 0, 1, 1, 0.99);
if (this.baddy.aggressor == 1) changeimgcolors( this.index, 1, 1, 0, 0.99);
if (this.baddy.aggressor == 2) changeimgcolors( this.index, 1, 0, 0, 0.99);
setTimer(0.05);
}
SCRIPTEND