Page 1 of 1

NPC Movement to DB

Posted: Thu Oct 08, 2009 12:53 pm
by bolly
To speed up the custom content pipeline is there any way we can have this like it was on EQEmu? It was a billion times easier to run a to a spot and use a command which would capture your xyzhead and add it to a database.

If it could go something similar to this (not unsimilar to eqemu)

/grid list
/grid create number (next available ID) - guessing '/grid create new' would work well here (captures your zone id)

/wp add [gridid] [wpnumber] (captures your xyz) (captures your zone id)

/spawn set grid [gridid]

ie:

/grid create list
Grids for this zone:
None

/grid create 1
Created grid 1 for zone: 122

/wp add 1 1 (start of circle)
/wp add 1 2
/wp add 1 3
/wp add 1 4 (near end of circle)

*target npc*
/spawn set grid 1
Set NPC Location Spawn 'MrTester' Grid to 1

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 12:58 pm
by John Adams
I had already asked this quite a while ago and was basically told "no". LUA is how movement will be handled.

After watching our server model grow, I tend to agree at least from a storage aspect, that "grids" tables are ridiculously huge, and the added bonus of it being in LUA is you can do custom/randoms on the fly. Literally, have your NPC wander never in the sample place twice.

I was sold.

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 1:02 pm
by bolly
i'm not sure, locs are so god damn painful and because of the lack of collision i'm having to stop at every tiny bump in the path! I guess this will eventually change so this request might be redundant but i'm sure i'm not alone in that people will be wanting to do a hell load of pathing.

Is there any examples or anything to use as a work around for now?

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 1:10 pm
by John Adams
Hmm, I have Opal Darkbriar running from Nek Forest all the way to Neriak along a path, with zero "pathing" issues. She runs up and down the hills just fine. I did not place a set of coordinates anywhere but where she veers left or right along the path.

Granted, I ran the path myself and did a /loc, then parsed that exact location using our tools (Scat posted one, and I have a scripted one in our editor), so maybe that's your point. You HAVE to set the "Y" too.

Code: Select all

--[[
	Script Name	: SpawnScripts/Darklight/OpalDarkbriar.lua
	Script Purpose	: Opal Darkbriar 
	Script Author	: John Adams
	Script Date	: 2009.01.31
	Script Notes	: Auto-Generated Locations from /loc log
--]]

function spawn(NPC)
	-- she pops out of Nektulos 
	MovementLoopAddLocation(NPC, 731.51, -66.26, 92.23, 10, 5)
	MovementLoopAddLocation(NPC, 730.81, -66.26, 84.87, 10, 0)

	-- and runs for Neriak along this path
	MovementLoopAddLocation(NPC, 713.11, -66.27, 85.87, 10, 0)
	MovementLoopAddLocation(NPC, 648.75, -55.57, 87.71, 10, 0)
	MovementLoopAddLocation(NPC, 565.20, -44.76, 73.07, 10, 0)
	MovementLoopAddLocation(NPC, 529.12, -47.11, 55.37, 10, 0)
	MovementLoopAddLocation(NPC, 481.85, -45.80, 47.16, 10, 0)
	MovementLoopAddLocation(NPC, 431.75, -38.18, -3.26, 10, 0)
	MovementLoopAddLocation(NPC, 344.12, -31.62, 2.87, 10, 0)
	MovementLoopAddLocation(NPC, 243.35, -21.61, 20.27, 10, 0)
	MovementLoopAddLocation(NPC, 219.18, -21.28, 33.43, 10, 0)
	MovementLoopAddLocation(NPC, 193.26, -23.35, 33.61, 10, 0)
	MovementLoopAddLocation(NPC, 162.40, -32.60, 24.66, 10, 0)
	MovementLoopAddLocation(NPC, 142.16, -41.25, 7.35, 10, 0)
	MovementLoopAddLocation(NPC, 125.97, -42.22, -23.69, 10, 0)
	MovementLoopAddLocation(NPC, 103.92, -47.94, -40.30, 10, 0)
	MovementLoopAddLocation(NPC, 85.21, -50.88, -45.10, 10, 0)
	MovementLoopAddLocation(NPC, 60.97, -51.79, -62.79, 10, 0)
	MovementLoopAddLocation(NPC, 21.74, -48.77, -17.95, 10, 0)
	MovementLoopAddLocation(NPC, -5.13, -51.01, 5.02, 10, 0)
	MovementLoopAddLocation(NPC, -15.33, -51.53, 25.12, 10, 0)
	MovementLoopAddLocation(NPC, -116.78, -55.40, 9.44, 10, 0)
	MovementLoopAddLocation(NPC, -196.82, -52.84, 20.44, 10, 0)
	MovementLoopAddLocation(NPC, -279.86, -55.93, 23.89, 10, 0)
	MovementLoopAddLocation(NPC, -332.51, -52.64, 22.01, 10, 0)
	MovementLoopAddLocation(NPC, -366.92, -51.36, 15.03, 10, 0)
	MovementLoopAddLocation(NPC, -375.64, -51.93, -6.33, 10, 0)
	MovementLoopAddLocation(NPC, -432.46, -49.65, -44.58, 10, 0)
	MovementLoopAddLocation(NPC, -498.40, -50.50, -75.37, 10, 0)
	MovementLoopAddLocation(NPC, -536.19, -53.27, -84.00, 10, 0)
	MovementLoopAddLocation(NPC, -593.50, -56.70, -74.40, 10, 0)
	MovementLoopAddLocation(NPC, -657.14, -57.06, -86.47, 10, 0)
	MovementLoopAddLocation(NPC, -678.35, -55.46, -83.81, 10, 10, "DespawnOpal")
	-- she needs to poof into Neriak at this point
end

function hailed(NPC, Spawn)
	Say(NPC, "No one can stop me!")
end

function respawn(NPC)
	spawn(NPC)
end

function DespawnOpal(NPC)
	-- make her depop, but she needs to use her respawn timer to run again in 20 mins.
	Despawn(NPC, 0)
end
Not sure if this helps.

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 1:20 pm
by bolly
Yeah that's what the pain is with MovementLoopAddLocation (sidenote: need heading) at least with the rest of scripting it's more dialogue and text so you don't have to tab as frequently

Really really do need this one in game even if it's just:
lua:
MovementAddGrid(NPC, ZoneID, GridID)

where the grid is created in game would work just as well

It's that loc to text process where all the trouble lies

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 2:25 pm
by Scatman
Have you checked out my tool to generate movement scripts? You run the path typing /loc then it'll parse your log file and generate the entire script

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 4:15 pm
by John Adams
I am not sure why you are so focused on "GridID". Not trying to be a dick, I just don't see how anything EQEmu did can possibly relate to our server. I think leaving EQEmu at the door and thinking fresh and new is the best approach. Plus the fact we've had numerous discussions about Terrain, the fact we do not have heightmaps so Spawns are currently unaware of all elevation changes, walk through walls, the usual. We're just not that far along yet.

bolly wrote:No requirements on who does it :-) Just pasting them into this post as a request as I come across issues in game, pretty sure there'll be plenty of community code submissions as more flock here! iirc that's how we got the grid code in eqemu
Btw, I caught this slipped into the other thread ;) I guess I can arrogantly say, until I hang my hat done with this project, LUA is how it is done in EQ2Emu Core. After that, it won't really matter what "the community" implements.

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 4:31 pm
by John Adams
FWIW, I fought HARD -- went to the mat a dozen times -- to get "grids" and "grid_entries" implemented into EQ2Emu for spawn movement. I mostly hate "data" being in LUA. Ask anyone ;)

But the flexibility we have putting these movements in LUA outweigh my personal preferences. I even said, ok -- let me store the coords in the DB, then load them when the spawn loads. Nope, that was not efficient either.

Do you know how much I hate digging through 500 LUA files to change 1 coordinate, and a Update query in the DB would do it in seconds? Yeah, I fought it hard, man. Don't think I didn't. Some things are just not worth the effort to rehash.

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 4:36 pm
by Scatman
Yeah we used to do the quest rewards and the quest table itself all LUA until John pestered me enough to put it in the DB ;)

Re: NPC Movement to DB

Posted: Thu Oct 08, 2009 11:52 pm
by bolly
John Adams wrote:I am not sure why you are so focused on "GridID". Not trying to be a dick, I just don't see how anything EQEmu did can possibly relate to our server. I think leaving EQEmu at the door and thinking fresh and new is the best approach. Plus the fact we've had numerous discussions about Terrain, the fact we do not have heightmaps so Spawns are currently unaware of all elevation changes, walk through walls, the usual. We're just not that far along yet.

bolly wrote:No requirements on who does it :-) Just pasting them into this post as a request as I come across issues in game, pretty sure there'll be plenty of community code submissions as more flock here! iirc that's how we got the grid code in eqemu
Btw, I caught this slipped into the other thread ;) I guess I can arrogantly say, until I hang my hat done with this project, LUA is how it is done in EQ2Emu Core. After that, it won't really matter what "the community" implements.
absolutely nothing to do with how eqemu relates to the server, like i keep saying it's fast and easy with an in game command