View Single Post
  #1  
Old 04-05-2012, 02:51 AM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
WallBlocking Serverside??


I don't understand why there does not have to be anything blocking in the way, yet it keeps returning blocking...
Does onwall not work serverside / in a class?

Currently I have it commented off as shown below or it would just keep turning around.

PHP Code:
function onTimeout(){
  if (
this.mode == WALK) {
    if (
players.size() > 0) {
      
setTimer(.1);
    }
    else {
      
setTimer(0);
    }
    
this.to_check findnearestplayer(this.xthis.y);
    
temp.newx this.vecx(this.dir) * this.mov_speed;
    
temp.newy this.vecy(this.dir) * this.mov_speed;
    
//this.chat = this.x SPC this.y SPC "New is" SPC new_x SPC new_y;
    
this.count--;
    if (
this.count 0) {
      if (
this.ani != "sl_animal_cow-walk") {
        
setcharani("sl_animal_cow-walk",null);
      }
      
temp.testx newx 1.5 vecx(this.dir);
      
temp.testy newy vecy(this.dir);  
      
/*
      if (checkBlockedTile(testx,testy)){
        this.dir = (this.dir + 2) % 4;
      }   
      */      
      //else {
        
this.newx;
        
this.newy;
      
//}
    

PHP Code:
function checkBlockedTile(xValueyValue) { //Check if tile is not walkable 
  
if (onwall(xValueyValue) || onwater(xValueyValue)) {
    
this.chat "test";
    return 
true;
  }
  else {
    
//this.chat = "not blocking";
    
this.chat "yesy";
    return 
false;
  }

__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote