Thread: PI proper object handling?

Results 1 to 6 of 6
  1. #1 PI proper object handling? 
    Banned
    Join Date
    Jun 2012
    Posts
    510
    Thanks given
    33
    Thanks received
    50
    Rep Power
    0
    So I have a woodcutting skill where i replace tree with stump object.
    Now...
    When entering the area of people woodcutting, you lagg and cannot move till all objects that have been sent are all sent.
    So if a player cut 100 logs.
    It'll load 100 stumps/trees when entering area. (also with custom spawned objects)
    PI object handling is crap. Anyone know a better way of handling?
    should i just remove all objects and reload on changeRegions?


    Whats the most proper way of spawning objects.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Jun 2012
    Posts
    510
    Thanks given
    33
    Thanks received
    50
    Rep Power
    0
    bump
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Nov 2013
    Posts
    1,015
    Thanks given
    240
    Thanks received
    265
    Rep Power
    0
    Quote Originally Posted by woof View Post
    bump
    you using cycle events?
    Reply With Quote  
     

  4. #4  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Post your code. I'll release something shortly that might help, it's kinda old though.
    Reply With Quote  
     

  5. #5  
    Banned
    Join Date
    Jun 2012
    Posts
    510
    Thanks given
    33
    Thanks received
    50
    Rep Power
    0
    Quote Originally Posted by Jason View Post
    Post your code. I'll release something shortly that might help, it's kinda old though.
    Currently just spawning the object through:

    Code:
    public void object(int objectId, int objectX, int objectY, int face, int objectType) {
    		////synchronized(c) {
    		if(c.getOutStream() != null && c != null) {
    			c.getOutStream().createFrame(85);
    			c.getOutStream().writeByteC(objectY - (c.getMapRegionY() * 8));
    			c.getOutStream().writeByteC(objectX - (c.getMapRegionX() * 8));
    			c.getOutStream().createFrame(101);
    			c.getOutStream().writeByteC((objectType<<2) + (face&3));
    			c.getOutStream().writeByte(0);
    			
    			if (objectId == -1) {
    				Region.removeClipping(objectX, objectY, 0);
    			}
    
    			if (objectId != -1) { // removing
    				Region.addObject(objectId, objectX, objectY, 0, objectType, face);
    				c.getOutStream().createFrame(151);
    				c.getOutStream().writeByteS(0);
    				c.getOutStream().writeWordBigEndian(objectId);
    				c.getOutStream().writeByteS((objectType<<2) + (face&3));
    			}
    			c.flushOutStream();
    		}	
    		//}
    	}
    c.getPA().object(Tree.getStumpId(), obX, obY, 0, 10); < in my spawntree method
    Reply With Quote  
     

  6. #6  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Quote Originally Posted by woof View Post
    Currently just spawning the object through:

    Code:
    public void object(int objectId, int objectX, int objectY, int face, int objectType) {
            ////synchronized(c) {
            if(c.getOutStream() != null && c != null) {
                c.getOutStream().createFrame(85);
                c.getOutStream().writeByteC(objectY - (c.getMapRegionY() * 8));
                c.getOutStream().writeByteC(objectX - (c.getMapRegionX() * 8));
                c.getOutStream().createFrame(101);
                c.getOutStream().writeByteC((objectType<<2) + (face&3));
                c.getOutStream().writeByte(0);
                
                if (objectId == -1) {
                    Region.removeClipping(objectX, objectY, 0);
                }
    
                if (objectId != -1) { // removing
                    Region.addObject(objectId, objectX, objectY, 0, objectType, face);
                    c.getOutStream().createFrame(151);
                    c.getOutStream().writeByteS(0);
                    c.getOutStream().writeWordBigEndian(objectId);
                    c.getOutStream().writeByteS((objectType<<2) + (face&3));
                }
                c.flushOutStream();
            }    
            //}
        }
    c.getPA().object(Tree.getStumpId(), obX, obY, 0, 10); < in my spawntree method
    You should have a better method of handling though. I've just released this if you're interested; http://www.rune-server.org/runescape...ml#post5039449
    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] Deleting Objects properly [PI]
    By hellp45 in forum Help
    Replies: 15
    Last Post: 11-13-2010, 11:42 PM
  2. [PI] Moving objects
    By ipkerzi in forum Help
    Replies: 2
    Last Post: 08-07-2010, 06:00 AM
  3. [PI]Renaming Objects [PI]
    By Redeeemer in forum Help
    Replies: 1
    Last Post: 08-06-2010, 11:20 AM
  4. [PI] Global Objects
    By Mrthunder23 in forum Help
    Replies: 5
    Last Post: 06-27-2010, 01:21 AM
  5. Item on Object, handled!!
    By kilermage in forum Tutorials
    Replies: 9
    Last Post: 11-22-2007, 04:30 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
  •