Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2009, 11:52 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default Extra variable for moveto and pathto quest functions

Would it be possible to have the heading added to these as well as another field that would include whether or not the mob stops and holds at those coordinates? ex: quest::moveto(x,y,z,h,stop(1/0)).

Currently, after a mob uses moveto, it returns to its start point. It requires a lot of work to get that little weasel to stop sometimes and can create a lot of extra grids. This would also allow for more scripting control than using $wp which only fires when a mob leaves a waypoint. You would be able to have say statements appear more fluid with less timer setting required.
__________________
Retired EMarr
Project1999 Developer
Reply With Quote
  #2  
Old 07-27-2009, 06:46 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

In this thread, Justsomeguy shows how to use quest::moveto and save the new WP after each move fairly easily:

http://www.eqemulator.net/forums/sho...329#post175329


As long as you have this in your script, it will save every WP it gets to as long as the NPC isn't already using a grid:

Code:
sub EVENT_WAYPOINT {

  $npc->SaveGuardSpot(0);

}
If your NPC is already on a grid, you can just have them do a quest::stop() to make them leave the grid, and you can add a $npc->SaveGuardSpot(0) in after the stop so it will stay at it's current position. Then, if you want to have say messages trigger at certain WPs, you can just use variable settings after you do your moveto command and then set the say message to happen when EVENT_WAYPOINT is triggered if that certain variable is currently set. Something like this:

Code:
my $Destination = "None";

sub EVENT_SAY {

	if ($text=~/hail/i) {
		quest::say("I can [move] if I am in your way.");
	}

	if ($text=~/move/i) {
		#Moves and sets a variable for the waypoint
		quest::say("Very well.");
		quest::moveto(100, 200, 300);
		$Destination = "RoomB"; #Naming this makes it easy to know which point you are dealing with if you have many.
		quest::stop(); #only required if the NPC is already on a grid
	}
}

sub EVENT_WAYPOINT {

$npc->SaveGuardSpot(0);	#this is so npcs don't not walk to waypoint and return immediately

	if($Destination eq "RoomB") {	#NPC Has Moved
		quest::say("That move went well enough.");
	}
}
This way isn't too overly complex and you don't need to use timers for say messages unless you want the NPC to say something sometime after it arrives at it's destination.

I do agree that the stop option should definitely be added to the moveto quest command. It would have saved me a bit of work on a script I am currently working on that has quite a bit of moving around in it. Heading probably wouldn't be a bad thing to have as an option either. I might try to look into adding these features if I get some time soon. For now, the above method works pretty well.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-30-2009, 05:12 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I went ahead and added the 2 new options to quest::moveto. It wasn't hard to get them added using guard spots. Here is the new explanation of the command I updated in the wiki for it:

Quote:
quest::moveto(x,y,z, [h, saveguardspot?]) - NPC moves to the set coordinates with Heading and saveguardspot being optional. NPC will path back unless saveguardspot is set to 1. Heading of -1 will use existing heading.
Any quests already using this command should still be fine, since the 2 new ones are completely optional. Though, there isn't much use to set the heading field unless you are saving the guard spot as well, as the NPC will just return right away anyway. You can set heading to -1 and that will force the NPC to keep the heading it was using on it's way to the destination. So, you don't have to set headings manually each time unless you really want to use a particular heading at some point.

Here is an example of a quest using all of these options:

Code:
sub EVENT_SAY {

my $move = quest::saylink("move and stay there");

	if ($text =~/Hail/i)
	{
		quest::say ("Hello, $name. Would you like me to [$move]?");
	}

	if ($text =~/move and stay there/i)
	{
		quest::say ("Ok, I am moving and I won't be back!  I might even face South when I get there, if I am feeling crazy!");
		#Example loc at the top of the center of Nexus facing South
		quest::moveto(5, 5, -31, 127, 1);
	}

}
Lemme know if there are any questions or issues with this.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 07-30-2009 at 01:19 PM..
Reply With Quote
  #4  
Old 07-30-2009, 09:15 AM
Dibalamin
Hill Giant
 
Join Date: Dec 2007
Posts: 182
Default

Thanks! I found that post after I'd posted this though =/. Consequently, when I use stop, the NPC generally takes the absolute straightest route home that it could find, so I generally just used long pauses and a timer with a depop.
__________________
Retired EMarr
Project1999 Developer
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 11:11 AM.


 

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