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

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

Reply
 
Thread Tools Display Modes
  #16  
Old 12-29-2009, 02:43 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Thanks, Derision, but for some reason it's still not working. Here is the script for my transporter NPC:

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

sub EVENT_ENTER
	{
	$client->SetHeading(0);	
	quest::movepc(16,-63,-802,59);
	}
The transporter stands at a point that forces a PC to enter his proximity at a heading of SE. When the PC enters the proximity of the transporter, I can see by my compass that the heading changes from SE to N right before zone (hence, the $client function is working, at least initially). However, when I land in the destination zone, I end up facing SE again.

Lillu, I'd be interested in knowing if my script works on your server (particularly, whether you end up facing North in Beholder coming from a heading of SE in the sending zone as you enter the transporter's proximity using my script). I'd also like to see if I can reproduce your results with the script that you said works perfectly. Could you post that script here? Thanks.
Reply With Quote
  #17  
Old 12-29-2009, 03:30 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

You will need to put a heading parameter in the quest::movepc call. Any heading, it doesn't matter what. If you leave the heading parameter off, it will default to a heading of zero.

If there is a heading there, the bug in the code prior to 1063 will mean it will use whatever heading you are currently facing, which should be the heading you set with $client->setheading().

This is the quest I used to to test the workaround:
Code:
sub EVENT_SAY {
        if($text=~/Hail/i){
                quest::say("I am Guard Philbin.");
                $client->SetHeading(45);
                quest::movepc(2, -223, 694, 4, 128);
        }
}
And I ended up in North Qeynos with a heading of 45.

Edit: After reading your post again, my explanation doesn't make sense, but try putting a random heading in the movepc call and see if it uses the heading from your $client->SetHeading call
Reply With Quote
  #18  
Old 12-29-2009, 04:33 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Thanks, Derision; that failed to work as well. My code now looks like this:
Code:
sub EVENT_SPAWN
	{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 60, $x + 60, $y - 60, $y + 60);
	}

sub EVENT_ENTER
	{
	$client->SetHeading(0);	
	quest::movepc(16,-63,-802,59,0);
	}
I also tried plugging in your headings, and placing the $client function after the quest::movepc function, and got the same results.
Reply With Quote
  #19  
Old 12-29-2009, 05:08 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

I did some further testing on this and found an oddity. I changed the event from an ENTER to the following SAY, and it works:

Code:
sub EVENT_SAY
	{
	if($text=~/Hail/i)
		{
		quest::say("You are taking a dangerous road, $name.Beware.");
		$client->SetHeading(255);
		quest::movepc(16,-63,-802,59,255);
		}
	}
The PC successfully faces north (incidentally, I tried 0 in place of 255--which should also face north--and it it ignored). When I change it back to an ENTER event, . . .
Code:
sub EVENT_SPAWN
	{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 60, $x + 60, $y - 60, $y + 60);
	}

sub EVENT_ENTER
	{
	quest::say("You are taking a dangerous road, $name. Beware.");
	$client->SetHeading(255);
	quest::movepc(16,-63,-802,59,255);
	}
. . . the heading is again ignored, and I simply land in Beholder facing SE again. The only difference between these scenarios is the event I am using. I am facing the same direction when triggering both events, and the functions are otherwise identical. Is it possible it it the ENTER event that is broken and not the quest::movepc() function?
Reply With Quote
  #20  
Old 12-29-2009, 05:25 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I found the same thing (works in EVENT_SAY but not EVENT_ENTER). Even the fix I made in Rev1063 behaves oddly in EVENT_ENTER, even though it worked fine in EVENT_SAY.

I'll take another look at it in the next day or two.
Reply With Quote
  #21  
Old 12-30-2009, 11:48 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

I've spent some time looking at this and it appears to be a timing issue.

I.e., we call $Client->SetHeading(0), but then the server receives an update packet from the client with it's current x,y,x location and heading, so we set the heading back to what it was.

Even if I call $client->SendPosUpdate(2) after $client->SetHeading, the server receives a packet from the client with the old heading.

I assume the client is sending updates faster when moving, which is why the problem is seen using EVENT_ENTER and not using EVENT_SAY (when the client is typically standing still to hail the NPC).

I can't think of any easy workaround, other than to set a flag indicating that the client is about to zone and ignoring any client update packets if that flag is set.
Reply With Quote
  #22  
Old 08-31-2010, 04:36 PM
wwarff
Fire Beetle
 
Join Date: Jul 2005
Posts: 6
Default

Has anyone been able to figure out a way to fix the heading coord error using an EVENT_ENTER yet? Derision, How would I go about setting a flag for something like what you mention here?

I can't think of any easy workaround, other than to set a flag indicating that the client is about to zone and ignoring any client update packets if that flag is set.

Sorry to open an old can of worms but sometimes entering your target zone will put you in the completely opposite direction pointing you right back to the zone you came from and it has been awhile since the last post on this thread.... Thanks for any suggestions.
Reply With Quote
  #23  
Old 08-31-2010, 05:04 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by neiv2 View Post
I did some further testing on this and found an oddity. I changed the event from an ENTER to the following SAY, and it works:

Code:
sub EVENT_SAY
	{
	if($text=~/Hail/i)
		{
		quest::say("You are taking a dangerous road, $name.Beware.");
		$client->SetHeading(255);
		quest::movepc(16,-63,-802,59,255);
		}
	}
The PC successfully faces north (incidentally, I tried 0 in place of 255--which should also face north--and it it ignored). When I change it back to an ENTER event, . . .
Code:
sub EVENT_SPAWN
	{
	$x = $npc->GetX();
	$y = $npc->GetY();
	quest::set_proximity($x - 60, $x + 60, $y - 60, $y + 60);
	}

sub EVENT_ENTER
	{
	quest::say("You are taking a dangerous road, $name. Beware.");
	$client->SetHeading(255);
	quest::movepc(16,-63,-802,59,255);
	}
. . . the heading is again ignored, and I simply land in Beholder facing SE again. The only difference between these scenarios is the event I am using. I am facing the same direction when triggering both events, and the functions are otherwise identical. Is it possible it it the ENTER event that is broken and not the quest::movepc() function?
Perhaps have the '$client->SetHeading();' process AFTER quest::movepc();
Reply With Quote
  #24  
Old 08-31-2010, 09:19 PM
wwarff
Fire Beetle
 
Join Date: Jul 2005
Posts: 6
Default

Thanks Akkadius. I tried that too, same result. It works with a SAY command but since I'm trying to use the ivisible man proximity script it makes the "hail" portion useless. I can get them to speak and port me, but not set my heading right. I have been trying to find an easy way to find all of the 0,0,0,0 hardcoded zonepoints somewhere. (That way I wouldn't need to even use the proximity method for zoning) I've slowly been logging into live and grabbing them but with over 1000 of them in the database it will take quite some time to do.
Reply With Quote
  #25  
Old 04-27-2011, 08:04 PM
Packet's Avatar
Packet
Hill Giant
 
Join Date: Jun 2010
Location: Omicron Percei-8
Posts: 106
Default

I know this is an old post but I thought I might add some input on this. For those of you working on quest::movepc and getting frustrated with heading not working, I wrote up this work-around.

quest::movepc() still does not work with changing the heading upon zone-in as of 5/27/2011 so I wrote this up real quick. It modifies the /template/player.pl to check coords upon zone in. If the X & Y coords match perfectly, it will update your heading to whatever is specified in the var under each if statement. There are better ways to accomplish this I am sure however this is how I got around it.

Also if you are considering adding this in, I might recommend adding a zone_id check before running the coord checks considering it would be highly unnecessary to run a massive list of coord checks on every single zoneline that is hit.

/quests/template/player.pl
------------------------------

Code:
sub EVENT_ENTERZONE {
#Zone Name - X  - Y or it jacks up the $cy/$cx variables. Last time I used one, it gave me a 324.24920492094 for $cx in freeport.
my $cx =  $client->GetX();
my $cy = $client->GetY();

if($cx == "324" && $cy == "-432") { #Freeport Port-in XY coords
my $fp_head = 220; #Var containing heading.
$client->SetHeading($fp_head);
$client->SendPosUpdate($fp_head);
$client->Message(15, "Your XY Coords are - X: $cx Y: $cy"); 
$client->Message(15, "Sucessfully modified your heading to $fp_head. Check by typing #loc."); 
}
if($cx == "-66" && $cy == "658") { #Qeynos Port-in XY coords
my $qy_head = 220; #Var containing heading.
$client->SetHeading($qy_head);
$client->SendPosUpdate($qy_head);
$client->Message(15, "Your XY Coords are - X: $cx Y: $cy"); 
$client->Message(15, "Sucessfully modified your heading to $qy_head. Check by typing #loc."); 
}
}
And this is a teleporter to test with if you'd like to try it.


Code:
sub EVENT_SAY {
if($text=~/hail/i) {
quest::say("Hi! I can take you to [Qeynos] or [Freeport]. Choose whichever you would like.");
}
if($text=~/qeynos/i) {
quest::movepc(2,-66, 658, 3, 113); #Qeynos Coords
}
if($text=~/freeport/i) {
quest::movepc(9, 324, -432, -24, 202); #Freeport Coords
}
}
Anyways, I apologize for reviving an old thread. This was irritating me earlier and I hope it may help someone else.

(Edit: Final note, if this doesn't work then you probably have a player.pl file already in the zone folder (/quests/zonename/) which is causing /templates/player.pl to not run.)
__________________
Packet Loss
Current project:
Dark Horizons

Formerly "Richardo"
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 04: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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3