Thread: [PI] Object help

Results 1 to 8 of 8
  1. #1 [PI] Object help 
    Registered Member
    Join Date
    Nov 2011
    Posts
    275
    Thanks given
    60
    Thanks received
    5
    Rep Power
    22
    how could i check if an object still exists? for example 2 players are mining a rock, once one player gets the ore and the rock changes id the other player could still mine it if they started before it changed. i want to check if the original rock is still there before giving them ore and xp.



    the source i am using is: [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member
    Fredo Santana's Avatar
    Join Date
    Apr 2013
    Age
    27
    Posts
    727
    Thanks given
    28
    Thanks received
    85
    Rep Power
    87
    Uh, I don't know if this is my ADHD. But, could you please elaborate more?
    FU Tooka Gang
    FU FBG
    FU JojoWorld
    FU D-Block
    #GDK #600 #065th #OTF #ScrewLilJay #BDN
    Reply With Quote  
     

  3. #3  
    Registered Member
    jordan641's Avatar
    Join Date
    Apr 2010
    Posts
    1,809
    Thanks given
    70
    Thanks received
    128
    Rep Power
    189
    This comes with most PI's object handlers
    Code:
        /**
         * Does object exist
         */
        public Objects objectExists(int objectX, int objectY, int objectHeight) {
    	for (Objects o : globalObjects) {
    	    if (o.getObjectX() == objectX && o.getObjectY() == objectY
    		    && o.getObjectHeight() == objectHeight) {
    		return o;
    	    }
    	}
    	return null;
        }
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2011
    Posts
    275
    Thanks given
    60
    Thanks received
    5
    Rep Power
    22
    Quote Originally Posted by Cobalt. View Post
    This comes with most PI's object handlers
    Code:
        /**
         * Does object exist
         */
        public Objects objectExists(int objectX, int objectY, int objectHeight) {
    	for (Objects o : globalObjects) {
    	    if (o.getObjectX() == objectX && o.getObjectY() == objectY
    		    && o.getObjectHeight() == objectHeight) {
    		return o;
    	    }
    	}
    	return null;
        }
    it always returns null for some reason, so it always thinks the ore has been mined, even if it hasn't
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2011
    Posts
    275
    Thanks given
    60
    Thanks received
    5
    Rep Power
    22
    bump

    with this:

    Code:
      /**
         * Does object exist
         */
        public Objects objectExists(int objectX, int objectY, int objectHeight) {
    	for (Objects o : globalObjects) {
    	    if (o.getObjectX() == objectX && o.getObjectY() == objectY
    		    && o.getObjectHeight() == objectHeight) {
    		return o;
    	    }
    	}
    	return null;
        }
    using this:
    Code:
    objectExists(rockX, rockY, p.heightLevel)!= null

    console says
    Code:
    ./Data/cfg/global-objects.cfg
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jul 2013
    Posts
    24
    Thanks given
    0
    Thanks received
    7
    Rep Power
    11
    The objects need to be smoothed.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2011
    Posts
    275
    Thanks given
    60
    Thanks received
    5
    Rep Power
    22
    Quote Originally Posted by MikeTheProgrammer View Post
    The objects need to be smoothed.
    can you explain what this means?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Nov 2011
    Posts
    275
    Thanks given
    60
    Thanks received
    5
    Rep Power
    22
    bump
    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]Object Help
    By Slawth Baws in forum Help
    Replies: 2
    Last Post: 09-26-2012, 08:49 AM
  2. [PI]Object Help
    By Pakku in forum Help
    Replies: 14
    Last Post: 07-21-2011, 10:02 PM
  3. [PI]Object help
    By Queer in forum Help
    Replies: 7
    Last Post: 06-05-2011, 06:38 PM
  4. [PI] Object Help [PI]
    By D R O in forum Help
    Replies: 2
    Last Post: 05-22-2011, 10:00 PM
  5. -PI- Object Help!!
    By savior I in forum Help
    Replies: 2
    Last Post: 08-26-2010, 03:32 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
  •