Spawn movement

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

Moderator: Team Members

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

Re: Spawn movement

Post by Cynnar » Thu Feb 15, 2018 7:51 pm

Try changing the + and - values maybe. From what I see here you get the npc x location add one then next movement you get the npc location minus one. Then minus one again
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

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

Re: Spawn movement

Post by Jabantiz » Thu Feb 15, 2018 7:56 pm

I have never seen spawns walk backwards before, in fact I think the client takes care of the heading when a spawn walks. That said the difference in location is tiny so it may not have a chance to really rotate a spawn but that is just a guess. At most you have a difference of 2 on one axis, 10 is usually right in the face of the spawn, try bumping the +/- 1 and see if you get the same results.

Plague
Posts: 68
Joined: Mon Jun 29, 2015 3:17 pm
EQ2Emu Server: WiP

Re: Spawn movement

Post by Plague » Thu Feb 15, 2018 8:18 pm

Code: Select all

function spawn(NPC)
	local x = GetX(NPC)
	local y = GetY(NPC)
	local z = GetZ(NPC)
	MovementLoopAddLocation(NPC, x + 10 , y, z - 10 , 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x - 10 , y, z - 10 , 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x - 10 , y, z + 10 , 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x + 10 , y, z + 10 , 1, math.random(5, 15))
end

function respawn(NPC)
	spawn(NPC)
end
Its your basic square movement, to keep them in a small area but look alive.
Now they are moonwalking for a long ways.
This works just fine, callously borrowed from generic tiny_movement_loop.

Code: Select all

	local x = GetX(NPC)
	local y = GetY(NPC)
	local z = GetZ(NPC)
	MovementLoopAddLocation(NPC, x - 2, y, z + 4, 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x + 3, y, z + 1, 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x    , y, z - 2, 1, math.random(5, 15))
	MovementLoopAddLocation(NPC, x - 5, y, z - 1, 1, math.random(5, 15))

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

Re: Spawn movement

Post by Cynnar » Thu Feb 15, 2018 9:06 pm

Plague wrote: Thu Feb 15, 2018 8:18 pm This works just fine, callously borrowed from generic tiny_movement_loop.
So if you place the code from tiny_movement_loop in place of your code it works? Not using the tiny_movement_loop script, but changing your script.

Is there a reason you are not wanting to use tiny_movement_loop script?
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

Plague
Posts: 68
Joined: Mon Jun 29, 2015 3:17 pm
EQ2Emu Server: WiP

Re: Spawn movement

Post by Plague » Thu Feb 15, 2018 9:42 pm

No reason, it was just a learning process.
I plan on making a moonwalking bear later tho.

User avatar
Cynnar
Project Leader
Posts: 738
Joined: Sat Sep 27, 2014 1:22 am
EQ2Emu Server: Eq2emulator
Characters: Vlash
Veinlash
Taragak
Cynnar

Re: Spawn movement

Post by Cynnar » Thu Feb 15, 2018 9:47 pm

Ah ok. I don't know why it's happening tbh.
[ 01000011 01111001 01101110 01101110 01100001 01110010 ]

Follow on:
Twitter Facebook

Contact me:
PM Discord chat email

Hardware: the parts of a computer that can be kicked

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

Re: Spawn movement

Post by Ememjr » Fri Feb 16, 2018 1:08 pm

if they are truly walking backwards then it could have to do with the spawn it self not knowing what is front and what is back, kinda like when it client gets 0 heading and 180 heading mixed up

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests