Thread: 718 rsps. regionbuilder worldtile **global information**

Results 1 to 5 of 5
  1. #1 718 rsps. regionbuilder worldtile **global information** 
    Registered Member
    Join Date
    Sep 2013
    Posts
    242
    Thanks given
    14
    Thanks received
    7
    Rep Power
    11
    heya, i need some information how the getworldtile works in copying regions.

    everytime if we copy a region over to the chosen tiles we need. so lets say 8 by 8.
    then i will look for free spots to copy the region to.

    alright now comes the part that i need clarification on.

    everytime if the player gets ported to the copyed region.
    which will have different coordinates everytime.

    but the getworldtile will stay the same.
    the start tile at the very left bottem corner will be worldtile 0, 0, 0

    so.. the thing that go's wrong is. if i have a controler which copys a region.
    and if i forcewalk a npc to a specified worldtile. then the forced npc will not always walk to my specified spot.
    lets say it does it correctly 10% of the time. 90% it's walking way off to the forced location.

    as example.

    if the player is at stage 1

    i want npc 1 to move to my specified location.

    walkto = a specified location
    walkto2 = another specified location for the npc itself.

    if i do the controler 5 times in a row.
    the npc only walk to the correct spot for the first time.
    if the region gets copyd again the npc is way off the specified location.

    Code:
            WorldTile walkTo = getWorldTile(24, 29, 0);
            WorldTile walkTo2 = getWorldTile(26, 26, 0);
            WorldTasksManager.schedule(new WorldTask() {
                int loop;
    
                @Override
    public void run() {
                    if (loop == 0) {
                        player.addWalkSteps(walkTo.getX(), walkTo.getY());
                        npc1 = new NPC(19068, getWorldTile(27, 20, 0), -1, true, true);
                        npc1.faceEntity(player);
                        npc1.addWalkSteps(walkTo2.getX(), walkTo2.getY());
                    }
                    loop++;
                }
            }, 0, 1);
        }
    
    }
    and the thing i dont know is. how can i specify a getworldtile for only getting the player his x or coordinates in a copyyd region.like.
    Code:
    else if (stage == your entry && player.getX() == your entry);
    the x and y coordinates change per copyed region.i tried making a getworldtile getx code but it failed badly.so i need a getworldtilex code aswell.i hope i explained it a bit right. i could make a giff and upload it about what i mean.ty in advance for all the help.
    Reply With Quote  
     

  2. #2  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    getWorldTile(0, 0, 0).getX()
    Reply With Quote  
     

  3. #3  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Are you sure your regions coords aren't static?
    Project thread
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Sep 2013
    Posts
    242
    Thanks given
    14
    Thanks received
    7
    Rep Power
    11
    heya, thanks for the information.

    I got it a bit to work. if I add walksteps to the npc's they wont move to their destination if there is a obstacle in their way.

    so if I move a npc from x 0 to y 15 without any obstacles then the npc will gladly do as I say.
    but if there is an obstacle between tiles x0 and y 15 it will stop at the obstacle and wont move.
    Code:
    npc1= new NPC(yourid, getWorldTile([COLOR=rgb(0,0,255)]0[/COLOR], 15, 0), -1, true, true);
    
    WorldTile tile3 = getWorldTile(0, 15, 0)
    
    npc1.addWalkSteps(tile3.getX(), tile3.getY());
    for forcewalking its a different story.if a npc cant get to its destination with forcewalking since there is a obstacle in the way he gets set to the destinated world tile.

    Code:
    if (!hasWalkSteps()) { setNextWorldTile(new WorldTile(forceWalk)); forceWalk = null;
    it's okey for some cases.but what I need is proper pathfinding for the npc.so when there is a obstacle in the way the npc needs to navigate around it.
    Reply With Quote  
     

  5. #5  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by artizana View Post
    heya, thanks for the information.

    I got it a bit to work. if I add walksteps to the npc's they wont move to their destination if there is a obstacle in their way.

    so if I move a npc from x 0 to y 15 without any obstacles then the npc will gladly do as I say.
    but if there is an obstacle between tiles x0 and y 15 it will stop at the obstacle and wont move.
    Code:
    npc1= new NPC(yourid, getWorldTile([COLOR=rgb(0,0,255)]0[/COLOR], 15, 0), -1, true, true);
    
    WorldTile tile3 = getWorldTile(0, 15, 0)
    
    npc1.addWalkSteps(tile3.getX(), tile3.getY());
    for forcewalking its a different story.if a npc cant get to its destination with forcewalking since there is a obstacle in the way he gets set to the destinated world tile.

    Code:
    if (!hasWalkSteps()) { setNextWorldTile(new WorldTile(forceWalk)); forceWalk = null;
    it's okey for some cases.but what I need is proper pathfinding for the npc.so when there is a obstacle in the way the npc needs to navigate around it.
    You need to implement a similar pathfinding system as players have then. NPCs don't have intelligent route finders, not even in RS. If there's an obstacle directly in the way, it ain't gonna go any further. Seems like an overkill at this point though, writing several difficult methods just so NPC will navigate around a rock, lol.
    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. 718 rsps Graphics worldtile understanding.
    By artizana in forum Help
    Replies: 4
    Last Post: 09-13-2016, 02:59 PM
  2. Replies: 0
    Last Post: 08-01-2016, 07:39 PM
  3. Replies: 7
    Last Post: 10-11-2013, 10:19 PM
  4. Buying 718+ RSPS Coded To My Preference
    By RuneTools in forum Buying
    Replies: 2
    Last Post: 12-22-2012, 07:41 PM
  5. 718 rsps cache help needed!
    By twisk flow in forum Help
    Replies: 2
    Last Post: 12-08-2012, 06:52 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
  •