Jump to content
  • 0
Sign in to follow this  
Gawdz

Help removing objects?

Question

I know u can remove objects but how do u remove them so u can still walk in that area?

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0
What exactly do you mean? Invisible objects?

Share this post


Link to post
Share on other sites
  • 0
No i have bushes at my home and i know how to remove them but then u wont be able to walk in that area it will just make them invisible but u still cant walk there.

Share this post


Link to post
Share on other sites
  • 0
Before i get started, lolking Use google next time bro lolking

In World.java, import this if you haven't already:

[QUOTE]import java.util.ArrayList;[/QUOTE]

Next in World.java, add this:
[QUOTE]public static List<WorldTile> restrictedTiles = new ArrayList<WorldTile>();

public static void deleteObject(WorldTile tile){
restrictedTiles.add(tile);
}[/QUOTE]

Now, in Region.java, directly under:
[QUOTE]public void addObject(WorldObject object, int plane, int localX, int localY) {[/QUOTE]

Add:
[QUOTE]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;
}
}
}
}[/QUOTE]

How to use: Just as you would spawn world objects in the NpcSpawning class, you can now use the new deleteObject method like so:
[QUOTE]World.deleteObject(new WorldTile(3085, 3504, 0));[/QUOTE]


Tips: If you want to delete a row(s) of (for an example) 10 tiles, you can utilize for loops and speed up the process. Example:
[QUOTE]for(int i = 0; i < 10; i++){
World.deleteObject(new WorldTile(3333, 3333 + i));
}[/QUOTE] Edited by im4ever12c

Share this post


Link to post
Share on other sites
  • 0
already tried this last source i was using it worked but the object was still clipped now i cant get it to delete the objects at all...

Share this post


Link to post
Share on other sites
  • 0
Did you use this code? make sure everything is there and correct inside the method compared to the tutorial i just posted.

Share this post


Link to post
Share on other sites
  • 0
yeah everything is correct i think its a problem with the npcspawning class it wont allow me to spawn objects either i can only pack them

Share this post


Link to post
Share on other sites
  • 0
That is strange. The code is probably not supported on the source? Im not to sure, iv never had this problem.

Share this post


Link to post
Share on other sites
  • 0
Im not sure what the problem is guessing it has something to do with my npcspawning class cuz im not able to add objects there either im using citellum's source.

Share this post


Link to post
Share on other sites
  • 0
Cant really think of anything that would cause this. If i find a solution though, i will contact you again :).

Share this post


Link to post
Share on other sites
  • 0
I still need help with this im using [MENTION=152696]Citellum[/MENTION] 's source the npcspawning.java class doesn't work and there is also a "objectremoval.txt" file in data and it doesn't work either if someone could help me with this it would be much appreciated. Edited by Gawdz

Share this post


Link to post
Share on other sites
Sign in to follow this  

×