EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   finding doors (https://www.eqemulator.org/forums/showthread.php?t=29759)

nightsta69 10-10-2009 09:53 AM

finding doors
 
is there an easier way to find out a door id other then just lookin in the db, and messin with them 1 by 1?

So_1337 10-10-2009 11:36 AM

Yes.

Add a player.pl file to the zone you're working with and put this code into it:

Code:

sub EVENT_CLICKDOOR {
    $door = $doorid - 256;
    $client->Message(13, "This is door number $door.");
}

Then clicking the doors will show you the proper ID.

ChaosSlayerZ 10-10-2009 12:10 PM

ingenious script! but whats with the -256 part?

So_1337 10-10-2009 01:01 PM

$doorids for some reason increment the number by 256 automatically. That's why most of the sub EVENT_CLICKDOOR scripts you see automatically account for it by accepting both say door 1 and door 257. Even while using this script you may see an erroneous number, since it'll display the real door ID less 256 (so -255 instead of 1, for example). Just a quirky thing, apparently. KLS originally explained that it was quirky when she introduced player.pl files, but I don't recall any explanation for why it was so.

So_1337 10-10-2009 01:04 PM

Quote:

Originally Posted by KLS
Also I mentioned this in the wiki article but due to a bug somewhere in the door code sometimes the $doorid will return 256 greater than the id the door has in the DB you see I circumvented it by doing if($doorid == x || $doorid == (x+256)) I hope to go back and fix it soon enough though, shouldn't be a huge deal though.

Lots of other stuff on her plate, of course, so the work-around is easy enough to use for now.

nightsta69 10-10-2009 02:15 PM

awesome, ty for the script.

Irreverent 05-17-2010 10:48 AM

Ok, got a weird one. Mine are 256 x 2?!

Any thoughts on that? I used this script to debug, found out its +512!

So my door 24 in the database was really 536!
(was happening in PoTimeB)

Shin Noir 05-17-2010 12:13 PM

If you check out http://www.eqemulator.org/forums/showthread.php?t=29697 you'll notice my $d_id = ($doorid % 256);
This code can be used e.g.
Code:

sub EVENT_CLICKDOOR {
    $door = ($doorid % 256);
    $client->Message(13, "This is door number $door.");
}


Kayen 05-17-2010 02:29 PM

I have also noticed that if you set a script to specific door with sub EVENT_CLICKDOOR ect where a player clicks it and something happens you need to make sure you use both possible doorid's in an or statement ect

Code:

sub EVENT_CLICKDOOR {

if (($doorid == 1) || ($doorid == 257)) { quest::say("This door is locked"); }

}

Otherwise you will run into odd instances where some players can not open it because it gives them one id instead of the other. I don't know why, but it certainly happens.


All times are GMT -4. The time now is 10:43 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.