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 10-31-2008, 12:05 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default Popup Quest response

Not a big deal but...

I am working on the TutorialB tasks/quests to match live. Well I ran into a little issue. During the tutorial a few windows popup while talking to a NPC. I can get the popups working but I cannot figure out a way to make the NPC wait to respond until the OK button is clicked. Any thoughts?
Reply With Quote
  #2  
Old 10-31-2008, 01:02 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I need to alter the popup code so you can pass an ID number, then add a new sub EVENT_POPUPCLOSED, which passes back the ID number of the popup. If I get time, I'll look into it this weekend, otherwise it will be sometime next week. I also need to enhance it so that you can select whether the popup has just an OK button, or YES/NO buttons.
Reply With Quote
  #3  
Old 10-31-2008, 05:19 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Try Rev167. I extended quest::popup, so there are three variants:

Code:
quest::popup(<Window Title>, <Window Text>)

quest::popup(<Window Title>, <Window Text>, <PopupID>)

quest::popup(<Window Title>, <Window Text>, <PopupID>, <Buttons>)
Where Buttons = 0 means just display an OK button, or Buttons = 1 means display Yes/No buttons.

If PopupID > 0, clicking on OK or Yes will call sub EVENT_POPUPRESPONSE:

Code:
sub EVENT_POPUPRESPONSE {

        quest::say("Popup response");
        if($popupid eq "10") {
                quest::say("You clicked OK/Yes to popup with id 10");
        }

}

sub EVENT_SAY {
  if ($text=~ /Hail/i){
    quest::popup("Test Popup", "Test popup with ID 10", 10);
  }
}
If you lose focus on the NPC, e.g. by hitting Escape while the popup is up, EVENT_POPUPRESPONSE won't be called. Not sure if it is like this on live. The ID of the NPC that produced the popup could be stored, if this is deemed to be an issue.

Edit: There is a new Opcode, so copy the patch*conf files from the utils directory.

Last edited by Derision; 11-01-2008 at 01:21 AM..
Reply With Quote
  #4  
Old 10-31-2008, 06:21 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

You don't even need a npc to call a popup, most of them if you were doing them for live like quests would be used in player quests not npc quests actually. So I'm not sure if that's a practical implementation.
Reply With Quote
  #5  
Old 11-01-2008, 12:08 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Derision,

Thank you

I will try this out tonight after I get off work.


KLS,

For the most part I think you are right that it will normally be used in the player.pl. However, there are a few quests on live that use the NPC namely this one http://everquest.allakhazam.com/db/q...tml?quest=3494 (basic training)

About mid way through the quest the toon is instructed to hail Prathun. Prathun has a bunch of popup windows that come in sequence. He does not progress to the next statement or popup window until OK is clicked on the last one.
Reply With Quote
  #6  
Old 11-01-2008, 04:55 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Yeah, and? I'm quite aware of the newbie quests, fact is there are a lot of popups that don't work that way. I'll probably add a player quest event for it tonight to be coupled with the npc quest so people can choose which they'd like.
Reply With Quote
  #7  
Old 11-01-2008, 05:10 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Sorry if I came across rude in my last post. I was not trying to be offensive was just pointing out a few NPCs could use the popups the way Derision implemented it. However, I agree it will mainly be used in the player.pl. Thank you for taking your time to add the option to use it in both.
Reply With Quote
  #8  
Old 01-31-2010, 03:08 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Trying to get this stuff to work with Sub Event Enter.. And can not..

Here is what i have based off what you posted but it simply will not work...

What am I doing wrong??

Code:
sub EVENT_SPAWN {
	my $x = $npc->GetX();
	my $y = $npc->GetY();
	my $range = 12;
	quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range);

}

sub EVENT_POPUPRESPONSE {

        quest::say("Popup response");
        if($popupid eq "10") {
	 quest::movepc(176,1900.0,-474.8,24.75);
		}  

}

sub EVENT_ENTER {
    
    quest::popup("Test Popup", "Test popup with ID 10", 10);
  }
}
Reply With Quote
  #9  
Old 01-31-2010, 04:22 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by KingMort View Post
Code:
sub EVENT_ENTER {
    
    quest::popup("Test Popup", "Test popup with ID 10", 10);
  }
}
Extra closing bracket marked in red.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #10  
Old 01-31-2010, 03:19 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Pop up works fine, it's just not porting me after I hit OK...
Reply With Quote
  #11  
Old 01-31-2010, 03:46 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

It doesn't work because when you click OK to the popup, you have no NPC targeted, and so the EVENT_POPUPRESPONSE doesn't get called.

This was what KLS was getting at further back in the thread, about this being better handled in the player.pl.

I could alter the behaviour, but it would break any existing scripts using this event, or maybe even have both the npc and player.pl receive the event ... let me test it.
Reply With Quote
  #12  
Old 01-31-2010, 04:12 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

OK, using Rev1202 code, do it like this. In your NPC quest:
Code:
sub EVENT_SPAWN
{
        my $x = $npc->GetX();
        my $y = $npc->GetY();
        my $range = 12;
        quest::set_proximity($x - $range, $x + $range, $y - $range, $y + $range);

}

sub EVENT_ENTER {

    quest::popup("Test Popup", "Test popup with ID 10", 10);
}
And in player.pl, add
Code:
sub EVENT_POPUPRESPONSE
{
        if($popupid eq "10")
        {
                quest::movepc(176,1900.0,-474.8,24.75);
        }

}
Reply With Quote
  #13  
Old 02-02-2010, 03:08 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Still not working ... *boggle*
Reply With Quote
Reply


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 10:32 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3