Thread: getx gety?
View Single Post
  #5  
Old 06-06-2007, 09:47 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
it's spelt fine in the script, Stefan, I do have the block checks in there but I have to have the this.x += temp.newx or else the baddy just keeps moving from the original positions, __-__ just figured the problem i had temp.x instead of temp.newx in the tiletype check haha, thanks guys :P

EDIT : grr... well it doesnt walk if the newx and newy are blocking but if the player walks in front and stops the baddy it still screws up. Here's a part of the script

PHP Code:
function onTimeOut() {
  
temp.rx   = int(random(-5, 5));
  
temp.ry   = int(random(-5, 5));
  
temp.rs   = random(0, 5);
  
temp.rt   = random(0, 7);
  
temp.newx = this.x + temp.rx;
  
temp.newy = this.y + temp.ry;

if (
tiletype[ temp.newx, temp.newy] != 22 && tiletype[ temp.newx, temp.newy] != 11) {
    
move(temp.rx, temp.ry, temp.rs, 4 + 8 + 16);
    
setcharani( "nir_baddy_walk", this.baddy.nick, this.baddy.hp, this.baddy.fullhp, this.baddy.aggressor);
  }

  else 
    
setTimer(temp.rt);

  
sleep(temp.rs);
  
setcharani( "nir_baddy_idle", this.baddy.nick, this.baddy.hp, this.baddy.fullhp, this.baddy.aggressor);
 
  
this.x += temp.rx;
  
this.y += temp.ry;

  
setTimer(temp.rt);
} 
__________________
Deep into the Darkness peering...
Reply With Quote