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-15-2013, 05:09 PM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default quest::pause(0)

I was working on a quest which has an NPC pathing a grid. When he arrives at waypoints, the code in the quest checks which one...

If he arrives at a certain waypoint, I want to stop here there until signaled.

In the waypoint arrival code, I placed a quest::pause(0).

From the viewpoint of the questmgt code, this is supposed to cease all pathing until we do a resume. It does this by setting the NPC grid to -(grid).

The MobAI code always checks the grid pathing timer to see if he's arrived at the next waypoint even if the grid is negative.

Code:
 if (AIwalking_timer->Check())^M
        {^M
            movetimercompleted=true;^M
            AIwalking_timer->Disable();^M
        }^M

Since I used pause(0) at his arrival point, the above check is true and movetimercompleted is set to true.

Then, the mobai code does the following - which just frees up the npc.

Code:
 else if (gridno < 0) ^M
        {   // this mob is under quest control^M
            if (movetimercompleted==true)    ^M
            { // time to pause has ended^M
                SetGrid( 0 - GetGrid()); // revert to AI control^M
                mlog(QUESTS__PATHING, "Quest pathing is finished. Resuming on grid %d", GetGrid());^M
^M
                if(GetAppearance() != eaStanding)^M
                    SetAppearance(eaStanding, false);^M
^M
                CalculateNewWaypoint();^M
            }^M
        }^M
Am I missing something. I turned path and waypoint logging on and followed the code. I was tempted to wrap the 1st check with an if (gridid > 0) but then the second snipet would never do the setAppearance stuff.

It seems to me that the quest:: routines should be responsible for pause and resume in all cases.

I am willing to work on this, but since I have nowhere near the experience with this code as some of you, I wanted to ask if you believe my data is correct.

Last edited by noudess; 05-15-2013 at 06:08 PM.. Reason: meant to say negative not -1
Reply With Quote
  #2  
Old 05-16-2013, 03:32 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I think you just need to do this each time before using pause:

$npc->SaveGuardSpot();

That will prevent them from moving back to their original spawn point.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 05-16-2013, 07:04 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Quote:
Originally Posted by trevius View Post
I think you just need to do this each time before using pause:

$npc->SaveGuardSpot();

That will prevent them from moving back to their original spawn point.
Hmm.. If I use moveto and set that, it works. That's what I was doing before. However, I wanted them to follow a path, so I put them on a grid. That's when I changed to using pause(0). I don't think SaveGuardSpot will work witha grid? I'll try it.
Reply With Quote
  #4  
Old 05-16-2013, 09:21 AM
noudess
Discordant
 
Join Date: Sep 2012
Location: Upstate NY
Posts: 274
Default

Ok..

I have a solution, but something is still amiss to me.

When I simply used moveto(x,y,z,90,1) with no grids, the npcs routed to the location and stayed there (the 1 for save guard spot worked). But, I didn't like this, as the mobs ran trough walls, etc.

So, I created a grid that all of them can use.

When I put them on the grid from the beginning, I simpy let the grid take them to where I wanted. Then, if I used an WAYPOINT event to do your suggestion $npc->saveguardpoint followed by a pause, that worked.

So.... I took it one further. Once they all recached the end point (which since I was now using 1 grid was the exact same spot.. I did the move(x,y,z,90,1) with the locs I orininally wanted. With no grid, back i my 1st example, that 1 at the end saved their guard spot and they did not move. Now, on a grid, it did not. Is that a bug?

I ended up doing the following, so I'm all set, but the above seemed maybe like a bug so I wanted to mention it.

- tookthem back off the grid in the db.
- Used start(grid) on them in their spawn code.
- used move(x,y,z,90,1) in their arrive code
- then added a stop();

That worked.
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 06:40 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