Thread: Barricades

Results 1 to 6 of 6
  1. #1 Barricades 
    Donator


    Join Date
    Mar 2010
    Age
    28
    Posts
    637
    Thanks given
    50
    Thanks received
    82
    Rep Power
    189
    Hey guys.

    I'm trying to add barricades to my minigame, but i don't know how to make them not able to walk through them

    Any help is appreciated.

    This is how I spawn the Barricades

    ClickItem class
    Code:
    switch(itemId) {
    			case 4053:
    				c.getItems().deleteItem(4053,c.getItems().getItemSlot(4053),1);
    				Server.npcHandler.spawnNpc2(1532, c.absX, c.absY, 0, 0,200,0,0,100);
    				c.sendMessage("You setup a barricade.");
    			break;
    		}
    I've tried looking through a released barricades to see how they did it, but didn't get it to work.
    Reply With Quote  
     

  2. #2  
    Registered Member fl3x's Avatar
    Join Date
    Aug 2010
    Posts
    168
    Thanks given
    52
    Thanks received
    45
    Rep Power
    0
    walking method. loop through all barricades. if barricade, dont walk. put an object barricade there too so the client can navigate around it.
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Mar 2010
    Age
    28
    Posts
    637
    Thanks given
    50
    Thanks received
    82
    Rep Power
    189
    Quote Originally Posted by fl3x View Post
    walking method. loop through all barricades. if barricade, dont walk. put an object barricade there too so the client can navigate around it.
    Barricades are NPC's
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    Not sure if something like this would work, unsure as to how PI's walking is actually handled:

    Code:
    	if (MinigameClassHere.inGame(c)) { //if player is in the minigame, so it doesnt loop through this everytime they walk.
    		for (NPC n : NPCHandler.npcs) {
    			if (n != null && n.npcType == ### && c.walkToX == n.absX && c.walkToY == n.absY) //### = barricade npc
    				return;			
    		}
    	}
    Reply With Quote  
     

  5. #5  
    Donator

    Thock321's Avatar
    Join Date
    Jul 2011
    Posts
    1,804
    Thanks given
    706
    Thanks received
    363
    Rep Power
    416
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Mar 2010
    Age
    28
    Posts
    637
    Thanks given
    50
    Thanks received
    82
    Rep Power
    189
    Quote Originally Posted by iRageQuit2012 View Post
    Not sure if something like this would work, unsure as to how PI's walking is actually handled:

    Code:
    	if (MinigameClassHere.inGame(c)) { //if player is in the minigame, so it doesnt loop through this everytime they walk.
    		for (NPC n : NPCHandler.npcs) {
    			if (n != null && n.npcType == ### && c.walkToX == n.absX && c.walkToY == n.absY) //### = barricade npc
    				return;			
    		}
    	}
    Works somewhat, it stops me from walking completely once there's a barricade, but I'm sure I can fix that.

    Repped
    Reply With Quote  
     


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. [PI] Barricades
    By I Am Kacey in forum Help
    Replies: 10
    Last Post: 09-08-2011, 07:33 PM
  2. barricades
    By mige5 in forum Help
    Replies: 1
    Last Post: 02-18-2009, 05:11 PM
  3. barricades
    By mige5 in forum Help
    Replies: 1
    Last Post: 02-14-2009, 02:24 PM
  4. Making barricades
    By bradster in forum Tutorials
    Replies: 18
    Last Post: 07-28-2008, 05:24 PM
  5. Barricades and more to go with them.
    By Outcast in forum Tutorials
    Replies: 10
    Last Post: 05-15-2008, 05:12 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •