Thread: 718 rsps removing global object spawns

Results 1 to 3 of 3
  1. #1 718 rsps removing global object spawns 
    Registered Member
    Join Date
    Sep 2013
    Posts
    242
    Thanks given
    14
    Thanks received
    7
    Rep Power
    11
    heya.

    I'm having some trouble with the removing global objects.
    original post of author: https://www.rune-server.ee/runescape...l-objects.html

    What the snippet allows is to use a delete object method via npcspawning.
    which worked completely fine.


    Untill i started on a new source which did not have npcspawning.
    So i added everything in from my old source including the npcspawning method.

    and everything required from the snippet.
    After initiating everything, the npcs get spawned but the objects do not get removed.

    npcpspawn.java

    Code:
    package com.rs.utils.spawning;
    
    import com.rs.game.World;
    import com.rs.game.WorldObject;
    import com.rs.game.WorldTile;
    
    public enum NPCSpawning {
    
       //meiyerditch Storekeepers
    test(1, 1, 1, 0, false),
    
    private int npcId;
    private int posX;
    private int posY;
    private int height;
    private boolean spawned;
    
    NPCSpawning(int id, int x, int y, int z, boolean spawned) {
       this.npcId = id;
       this.posX = x;
       this.posY = y;
       this.height = z;
       this.spawned = spawned;
    }
    
    public static void spawnNpcs() {
       for (NPCSpawning spawn : NPCSpawning.values()) {
          World.spawnNPC(spawn.npcId, new WorldTile(spawn.posX, spawn.posY, spawn.height), 0, spawn.spawned);
          World.deleteObject(new WorldTile(1, 1, 0));//test
           }
          
       }
    }
    as i said the npcs do get spawned but it does not read the deleteobject method.
    and i could just spawn -1's on all the required locations but that will not handle the clipping logic.

    all help is appreciated.
    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
    Show the deleteObject method..?
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2013
    Posts
    242
    Thanks given
    14
    Thanks received
    7
    Rep Power
    11
    same as the snippet.

    World.java
    Code:
    public static void deleteObject(WorldTile tile){
        restrictedTiles.add(tile);
    }
    public static List<WorldTile> restrictedTiles = new ArrayList<WorldTile>();
    region.java
    Code:
    public void addObject(WorldObject object, int plane, int localX, int localY, boolean original) {
       if(World.restrictedTiles != null){
          for(WorldTile restrictedTile : World.restrictedTiles){
             if(restrictedTile != null){
                int restX = restrictedTile.getX(), restY = restrictedTile.getY();
                int restPlane = restrictedTile.getPlane();
    
                if(object.getX() == restX && object.getY() == restY && object.getPlane() == restPlane){
                   World.spawnObject(new WorldObject(-1, 10, 2, object.getX(), object.getY(), object.getPlane()), false);
                   return;
                }
             }
          }
       }
    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. Replies: 6
    Last Post: 10-31-2014, 12:41 AM
  2. [508] working global Object spawn
    By Richard1992 in forum Tutorials
    Replies: 80
    Last Post: 08-24-2009, 08:58 AM
  3. Global object spawning help
    By linkey in forum Help
    Replies: 0
    Last Post: 04-29-2009, 11:46 PM
  4. Global Object Spawning
    By linkey in forum Help
    Replies: 0
    Last Post: 04-29-2009, 10:14 PM
  5. [Tut] Adding/Moving/Removing Global Objects
    By XxMixTheMusicxX in forum Tutorials
    Replies: 17
    Last Post: 09-07-2007, 08:44 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
  •