Thread: door won't listen -.-

Results 1 to 3 of 3
  1. #1 door won't listen -.- 
    ZRPS
    Guest
    Okay.. so i'm trying to open this door the normal way
    woot for the replacedoor method
    but then WTF it doesn't work.

    it's a randor door, possibly like a side object.
    idontreallyknow.

    someone help plz ;D will rep.

    will definitely rep :O
    Reply With Quote  
     

  2. #2  
    Icy Realm Owner
    Icy Whip's Avatar
    Join Date
    May 2007
    Posts
    1,419
    Thanks given
    30
    Thanks received
    35
    Rep Power
    213
    Damn door I demand you to listen.....

    I'm thinking this might make it

    under your firstclick object void usually called
    Code:
    ObjectClick(), ObjectClick1(), ClickObject(), ect.. 
    or yours all might just be under case 132:
    anyways, add this little bit of coding with the rest of your objects

    messing around with the 0 at the end of the void will change its face direction

    Code:
    					case objectID here:
    						changeDoor(objectId, objectX, objectY, 0);
    					break;
    changeDoor void from Palidino's battlescape server.

    Code:
            public void changeDoor(int objectId, int objectX, int objectY, int faceId)
    	{
    		for (int i = 1; i < Server.s.playerHandler.maxPlayers; i++)
    		{
    			client p = (client) Server.s.playerHandler.players[i];
    			if (p != null)
    			{
    				if (WithinDistance(objectX, objectY, p.absX, p.absY, 60))
    				{
    					p.replaceObject(objectX, objectY, -1, -1);
    					p.replaceObject2(objectX, objectY, objectId, faceId, 0);
    				}
    			}
    		}
    	}
    
    	public void replaceObject(int objectX, int objectY, int NewObjectID, int Face) {
    		outStream.createFrame(85);
    		outStream.writeByteC(objectY - (mapRegionY * 8));
    		outStream.writeByteC(objectX - (mapRegionX * 8));
    		outStream.createFrame(101);
    		outStream.writeByteC(0);
    		outStream.writeByte(0);
    		if (NewObjectID != -1)
    		{
    			outStream.createFrame(151);
    			outStream.writeByteS(0);
    			outStream.writeWordBigEndian(NewObjectID);
    			outStream.writeByteA(Face);
    		}
    	}
    
    	public void replaceObject2(int objectX, int objectY, int NewObjectID, int Face, int ObjectType)
    	{
    		outStream.createFrame(85);
    		outStream.writeByteC(objectY - (mapRegionY * 8));
    		outStream.writeByteC(objectX - (mapRegionX * 8));
    		outStream.createFrame(101);
    		outStream.writeByteC((ObjectType<<2) + (Face&3));
    		outStream.writeByte(0);
    		if (NewObjectID != -1)
    		{
    			outStream.createFrame(151);
    			outStream.writeByteS(0);
    			outStream.writeWordBigEndian(NewObjectID);
    			outStream.writeByteS((ObjectType<<2) + (Face&3));
    			//FACE: 0= WEST | -1 = NORTH | -2 = EAST | -3 = SOUTH
    			//ObjectType: 0-3 wall objects, 4-8 wall decoration, 9: diag. walls, 10-11 world objects, 12-21: roofs, 22: floor decoration
    		}
    	}
    I included both replace objects incase you don't have them.
    [Only registered and activated users can see links. ]

    Signature made by Mr. Ervis

    Any questions, MSN me; [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Icy Realm Owner
    Icy Whip's Avatar
    Join Date
    May 2007
    Posts
    1,419
    Thanks given
    30
    Thanks received
    35
    Rep Power
    213
    If this does not work let me know.
    [Only registered and activated users can see links. ]

    Signature made by Mr. Ervis

    Any questions, MSN me; [Only registered and activated users can see links. ]
    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
  •