NPC Movement

Discussions of the design and development of in-game content.

Moderator: Team Members

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: NPC Movement

Post by Jabantiz » Fri Nov 03, 2017 9:12 pm

Odd that reentering the same values worked but glad you got the callbacks working.

As for not moving in the callback it almost sounds like the spawn doesn't produce the packets to make it move on the client but it moves on the server. Not sure what would cause that off hand...

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: NPC Movement

Post by Ememjr » Fri Nov 03, 2017 9:22 pm

looks like that movement needs some work, spawn is turnign around after getting to location, but need seemless
i think thinks would work alot smoother if we were able to move like the movement loop one, and have an option to turn it off

something like this
MovementLoopAddLocation(NPC, -233.71, -1.32, -78.60, 1 , 5)
MovementLoopAddLocation(NPC, -199.22, -1.30, -65.10, 1 , 5, "Cancel")
function cancel(NPC)
cancelmovementloop
end

or a AddMoveToLocation() caommand
that would have the location removed after it arrived so it would not loop

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: NPC Movement

Post by Ememjr » Sat Nov 04, 2017 5:41 am

ok i was playing with this, in order to use MovementLoopAddLocation(NPC, -199.22, -1.30, -65.10, 1 , 5, "Comment",1) by adding an optional parameter that defaults to 0
now what i wnat to do is if the optional 8 parameter is set to 1, then in the ProcessMovment() when it moves to that location, if parm 8 ==1 then remove that location from the movement loop
but
i am not sure if this is the proper command to do that

Code: Select all

movement_loop.erase(movement_loop.begin()+movement_index);

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: NPC Movement

Post by Ememjr » Sat Nov 04, 2017 8:34 am

so i have answered my one question about the command, that location was removed , and ingrid just walks back and forth between 2 locations not 3 anymore

Code: Select all

MovementLoopAddLocation(ingrid, -2.48, -1.78, -9.14, 1, 0 , "",1)--location1 get removed
	MovementLoopAddLocation(ingrid, -2.07, 1.21, -14.71, 1, 0 , "")--location2
	MovementLoopAddLocation(ingrid, 1.80, 1.21, -13.71, 1, 0 , "")--location3
but
here is the orderby location
1,2,3,1,2,3,2,3,2,3,2,3

when setting the second location to get removed

Code: Select all

MovementLoopAddLocation(ingrid, -2.48, -1.78, -9.14, 1, 0 , "",1)--location1 get removed
	MovementLoopAddLocation(ingrid, -2.07, 1.21, -14.71, 1, 0 , "",1)--location2 get removed
	MovementLoopAddLocation(ingrid, 1.80, 1.21, -13.71, 1, 0 , "")--location3
the order is
1,2,3 and ingrid stops where she should, but there is a pause between stops

here is where i added the remove code, is there a faster way or more appropriate place to add( in ProcessMovement

Code: Select all

				else
					AddRunningLocation(data->x, data->y, data->z, data->speed);

				// reset this timer to 0 now that we are moving again
				boolean doiremove = data->remove;
				if (doiremove == 1) {// added by ememjr to remove a location
					movement_loop.erase(movement_loop.begin()+movement_index);
				}
				movement_start_time = 0;
				
			}

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests