Thread: [Delta 2.7] Fixing the creatObj method

Results 1 to 5 of 5
  1. #1 [Devo 2.7] Fixing the creatObj method 
    Registered Member Dezzan's Avatar
    Join Date
    Oct 2009
    Age
    30
    Posts
    409
    Thanks given
    2
    Thanks received
    6
    Rep Power
    30
    Well.. I'll post pictures of my problem:

    This is where I spawn an object:




    It shows up where I spawned it, but then It pops up multiple times around the world. :




    Heres the createobject code:

    Code:
    	public void CreateObj(int x, int y, int id, int face, int type)
    	{
    		outStream.createFrame(85);
    		outStream.writeByteC(y - (mapRegionY * 8));
    		outStream.writeByteC(x - (mapRegionX * 8));
    		outStream.createFrame(151);
    		outStream.writeByteA(0);
    		outStream.writeWordBigEndian(id);
    		outStream.writeByteS((type << 2) + (face & 3));
    	}
    And heres an example of a server that has an unglitched CreateObject method:

    Code:
    	public void createObject(int x, int y, int typeID, int orientation, int tileObjectType){ //Makes Global objects
    		for (Player p : GameEngine.playerHandler.players) {
    			if (p != null) {
    				clientHandler person = (clientHandler)p;
    
    				if ((person.playerName != null || person.playerName != "null")) {
    					if (person.distanceToPoint(x, y) <= 60) {
    						person.createNewTileObject(x, y, typeID, orientation, tileObjectType);
    					}
    				}
    			}
    		}
    	}


    Any help on getting this to work on my server would be great.. I'm just inexperienced and don't know where to start.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Rock_Gyo's Avatar
    Join Date
    Oct 2009
    Posts
    505
    Thanks given
    27
    Thanks received
    35
    Rep Power
    104
    EXAMPLE

    Try this in your client.Java from your source...

    Code:
    public void NewObjects(){
    		/* Use as : addObject(x, y, id, face, type)
    		   Example: addObject(3333, 3333, objectId, 0, 10) */
    		//CreateObj(3007, 3383, 8553, 0, 10);
    	}
    repp if helped
    Reply With Quote  
     

  3. #3  
    PokeNation! Xaves's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    3,476
    Thanks given
    356
    Thanks received
    788
    Rep Power
    646
    Quote Originally Posted by Rock_Gyo View Post
    EXAMPLE

    Try this in your client.Java from your source...

    Code:
    public void NewObjects(){
    		/* Use as : addObject(x, y, id, face, type)
    		   Example: addObject(3333, 3333, objectId, 0, 10) */
    		//CreateObj(3007, 3383, 8553, 0, 10);
    	}
    repp if helped
    dont ask for rep.. --'

    you can rip the code from the server where you say that works and its done
    Reply With Quote  
     

  4. #4  
    Emmure
    Guest
    what is delta 2.7?...lol
    Reply With Quote  
     

  5. #5  
    Registered Member Dezzan's Avatar
    Join Date
    Oct 2009
    Age
    30
    Posts
    409
    Thanks given
    2
    Thanks received
    6
    Rep Power
    30
    Quote Originally Posted by Emmure View Post
    what is delta 2.7?...lol
    Lul I meant Devo 2.7

    Hell I was tired.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •