Thread: NPCs don't walk

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 NPCs don't walk 
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    I'm using http://www.rune-server.org/runescape...n-release.html and there is problem that NPCs doesn't move anywhere even if I attack them.


    I have changed "0" to "1" in spawn-config.cfg


    Here is NPCHandler.java

    Code:
    /**
    				* Random walking and walking home
    				**/
    				if (npcs[i] == null) continue;
    				if((!npcs[i].underAttack || npcs[i].walkingHome) && npcs[i].randomWalk && !npcs[i].isDead) {
    					npcs[i].facePlayer(0);
    					npcs[i].killerId = 0;	
    					if(npcs[i].spawnedBy == 0) {
    						if((npcs[i].absX > npcs[i].makeX + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absX < npcs[i].makeX - Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY > npcs[i].makeY + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY < npcs[i].makeY - Config.NPC_RANDOM_WALK_DISTANCE)) {
    							npcs[i].walkingHome = true;
    						}
    					}
    
    					if (npcs[i].walkingHome && npcs[i].absX == npcs[i].makeX && npcs[i].absY == npcs[i].makeY) {
    						npcs[i].walkingHome = false;
    					} else if(npcs[i].walkingHome) {
    						npcs[i].moveX = GetMove(npcs[i].absX, npcs[i].makeX);
    			      		npcs[i].moveY = GetMove(npcs[i].absY, npcs[i].makeY);
    						npcs[i].getNextNPCMovement(i); 
    						npcs[i].updateRequired = true;
    					}
    					if(npcs[i].walkingType == 1) {
    						if(Misc.random(3)== 1 && !npcs[i].walkingHome) {
    							int MoveX = 0;
    							int MoveY = 0;			
    							int Rnd = Misc.random(9);
    							if (Rnd == 1) {
    								MoveX = 1;
    								MoveY = 1;
    							} else if (Rnd == 2) {
    								MoveX = -1;
    							} else if (Rnd == 3) {
    								MoveY = -1;
    							} else if (Rnd == 4) {
    								MoveX = 1;
    							} else if (Rnd == 5) {
    								MoveY = 1;
    							} else if (Rnd == 6) {
    								MoveX = -1;
    								MoveY = -1;
    							} else if (Rnd == 7) {
    								MoveX = -1;
    								MoveY = 1;
    							} else if (Rnd == 8) {
    								MoveX = 1;
    								MoveY = -1;
    							}
    										
    							if (MoveX == 1) {
    								if (npcs[i].absX + MoveX < npcs[i].makeX + 1) {
    									npcs[i].moveX = MoveX;
    								} else {
    									npcs[i].moveX = 0;
    								}
    							}
    							
    							if (MoveX == -1) {
    								if (npcs[i].absX - MoveX > npcs[i].makeX - 1)  {
    									npcs[i].moveX = MoveX;
    								} else {
    									npcs[i].moveX = 0;
    								}
    							}
    							
    							if(MoveY == 1) {
    								if(npcs[i].absY + MoveY < npcs[i].makeY + 1) {
    									npcs[i].moveY = MoveY;
    								} else {
    									npcs[i].moveY = 0;
    								}
    							}
    							
    							if(MoveY == -1) {
    								if(npcs[i].absY - MoveY > npcs[i].makeY - 1)  {
    									npcs[i].moveY = MoveY;
    								} else {
    									npcs[i].moveY = 0;
    								}
    							}
    								
    
    							int x = (npcs[i].absX + npcs[i].moveX);
    							int y = (npcs[i].absY + npcs[i].moveY);
    							if (VirtualWorld.I(npcs[i].heightLevel, npcs[i].absX, npcs[i].absY, x, y, 0))
    								npcs[i].getNextNPCMovement(i);
    							else
    							{
    								npcs[i].moveX = 0;
    								npcs[i].moveY = 0;
    							} 
    							npcs[i].updateRequired = true;
    						}
    					}
    				}
    This is checked:

    Code:
    public static final int NPC_RANDOM_WALK_DISTANCE = 5;
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    Any?
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    Also NPCs stopped working when this got added. I removed it but still doesn't work. :/


    http://www.rune-server.org/runescape...-clipping.html
    Reply With Quote  
     

  4. #4  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Quote Originally Posted by Grand View Post
    Also NPCs stopped working when this got added. I removed it but still doesn't work. :/


    http://www.rune-server.org/runescape...-clipping.html
    "npcs stopped working" what does that mean? And after you removed the clipping, the bug when you added it still happens?

    Also the code you just copy pasted is the exact same as mine, so i would recommend checking config.java for this:

    Code:
    						if((npcs[i].absX > npcs[i].makeX + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absX < npcs[i].makeX - Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY > npcs[i].makeY + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY < npcs[i].makeY - Config.NPC_RANDOM_WALK_DISTANCE)) {
    							npcs[i].walkingHome = true;
    Maybe NPC_RANDOM_WALK_DISTANCE is just nothing?
    Attached image
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    Quote Originally Posted by Olinice View Post
    "npcs stopped working" what does that mean? And after you removed the clipping, the bug when you added it still happens?

    Also the code you just copy pasted is the exact same as mine, so i would recommend checking config.java for this:

    Code:
    						if((npcs[i].absX > npcs[i].makeX + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absX < npcs[i].makeX - Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY > npcs[i].makeY + Config.NPC_RANDOM_WALK_DISTANCE) || (npcs[i].absY < npcs[i].makeY - Config.NPC_RANDOM_WALK_DISTANCE)) {
    							npcs[i].walkingHome = true;
    Maybe NPC_RANDOM_WALK_DISTANCE is just nothing?
    I meant I'm sure that before NPC Clipping NPCs did move normally but now they doesn't move anywhere.
    Reply With Quote  
     

  6. #6  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Quote Originally Posted by Grand View Post
    I meant I'm sure that before NPC Clipping NPCs did move normally but now they doesn't move anywhere.
    Recopy from the original source whatever you changed while adding the clipping? by inversing your guide, if you can't do it right, better copy paste the old file again ( Totally if you didn't do other modifications since then in those files or partially getting back only what you changed?)
    Attached image
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Feb 2013
    Posts
    264
    Thanks given
    145
    Thanks received
    34
    Rep Power
    0
    make sure you have a map folder in the world directory

    src > server > world > map

    and there should be b.java
    c.java
    i.java
    Virtualworld.java
    z.java

    Reply With Quote  
     

  8. #8  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    Quote Originally Posted by Olinice View Post
    Recopy from the original source whatever you changed while adding the clipping? by inversing your guide, if you can't do it right, better copy paste the old file again ( Totally if you didn't do other modifications since then in those files or partially getting back only what you changed?)
    Don't have old files. :/

    Quote Originally Posted by Raphiel View Post
    make sure you have a map folder in the world directory

    src > server > world > map

    and there should be b.java
    c.java
    i.java
    Virtualworld.java
    z.java

    Yup, everything is there. This is getting really weird..
    Reply With Quote  
     

  9. #9  
    Donator
    Darkness's Avatar
    Join Date
    Nov 2012
    Age
    26
    Posts
    876
    Thanks given
    121
    Thanks received
    75
    Rep Power
    47
    Quote Originally Posted by Grand View Post
    Don't have old files. :/



    Yup, everything is there. This is getting really weird..

    Redownload your source? always keep a backup :O
    Attached image
    Reply With Quote  
     

  10. #10  
    Donator

    Join Date
    Feb 2013
    Posts
    446
    Thanks given
    91
    Thanks received
    87
    Rep Power
    45
    Quote Originally Posted by Olinice View Post
    Redownload your source? always keep a backup :O
    It's this packet which I'm using and I asked if Angerfirst would have files before he added the NPC Clipping but he doesn't have.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. NPC Don't Walk Thru NPC
    By netzo in forum Requests
    Replies: 2
    Last Post: 09-19-2009, 11:57 AM
  2. npc's dont walk?
    By austin_gct in forum Help
    Replies: 6
    Last Post: 06-30-2009, 06:20 PM
  3. [delta] npc stand and walk emotes?
    By goldinfern0z in forum Help
    Replies: 0
    Last Post: 06-08-2009, 09:14 PM
  4. NPCS don't noclip (Cheap hax!)
    By Concious in forum Show-off
    Replies: 6
    Last Post: 02-27-2009, 04:45 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •