Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2011, 04:53 AM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 670
Default

Well I figured out how to make the lever, ropes and platform work all at once. There appears to be an error in doors.cpp.

default doors.cpp
Code:
void Doors::ForceOpen(Mob *sender)
{
    EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
	MoveDoor_Struct* md=(MoveDoor_Struct*)outapp->pBuffer;
	md->doorid = door_id;
	md->action = OPEN_DOOR;
	entity_list.QueueClients(sender,outapp,false);
	safe_delete(outapp);

    if(!isopen) {
        close_timer.Start();
        isopen=true;
    }
    else {
        close_timer.Disable();
        isopen=false;
    }
}

void Doors::ForceClose(Mob *sender)
{
    EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
	MoveDoor_Struct* md=(MoveDoor_Struct*)outapp->pBuffer;
	md->doorid = door_id;
	md->action = OPEN_DOOR;
	entity_list.QueueClients(sender,outapp,false);
	safe_delete(outapp);

    if(!isopen) {
        close_timer.Start();
        isopen=true;
    }
    else {
        close_timer.Disable();
        isopen=false;
    }
}
The above sections are identical which is why Doors::ForceClose() doesn't work properly.
Now changing md->action = OPEN_DOOR; to md->action = CLOSE_DOOR; as it is below allows Doors::ForceClose() to work a little better

changed doors.cpp
Code:
void Doors::ForceOpen(Mob *sender)
{
    EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
	MoveDoor_Struct* md=(MoveDoor_Struct*)outapp->pBuffer;
	md->doorid = door_id;
	md->action = OPEN_DOOR;
	entity_list.QueueClients(sender,outapp,false);
	safe_delete(outapp);

    if(!isopen) {
        close_timer.Start();
        isopen=true;
    }
    else {
        close_timer.Disable();
        isopen=false;
    }
}

void Doors::ForceClose(Mob *sender)
{
    EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct));
	MoveDoor_Struct* md=(MoveDoor_Struct*)outapp->pBuffer;
	md->doorid = door_id;
	md->action = CLOSE_DOOR;
	entity_list.QueueClients(sender,outapp,false);
	safe_delete(outapp);

    if(!isopen) {
        close_timer.Start();
        isopen=true;
    }
    else {
        close_timer.Disable();
        isopen=false;
    }
}
That single change didn't completely fix the problem. I think the isopen() and the associated timers are causing a weird bounce effect when used with opentype 40. I changed the database to use opentype 58 so that a click is required to open and close the lever and then the lift and ropes worked as they should have but obviously the lever is frozen in place.
If anyone can see a better way to fix the odd bounce effect besides changing opentype I am all for it otherwise I will keep looking for a better solution.
Reply With Quote
  #2  
Old 05-02-2011, 06:30 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Nice catch. I think the issue may be again with those commands being copies of each other. This section here probably needs to be adjusted for the ForceClose:

Code:
	if(!isopen) {
		close_timer.Start();
		isopen=true;
	}
	else {
		close_timer.Disable();
		isopen=false;
	}
It probably needs to be set something like this (untested):

Code:
	if(isopen) {
		close_timer.Disable();
		isopen=false;
	}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 05-02-2011, 05:20 PM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 670
Default

I tried the suggested change and got mixed results. It will work fine one minute and then it goes back to its random behavior. It seems like it is getting confused.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:39 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3