Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:05 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.