Server Clan Crushbone

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Apr 21, 2008 3:31 pm

Sorry, I should have been clearer... I have not tested actual NPC movements yet with this new code - and, I missed the param "speed" in your previous post (sorry) because I think that answers my question.
Before movement was implemented, some "visual states" showed NPCs in a slow-motion running state. One in particular was a little gnome chick on my IoR (good) standing to the side of the banker. She's kinda running in place (no movement code), and seems very slow. So being uninformed as I usually am when I am in a hurry and fail to read everything (grin), I was asking if there was a function to handle how speedy the NPC moves around - both physically traversing the terrain and their little arms/hands swinging motion to simulate a "running" NPC.
Save yourself the headache of answering me, and tell me to just try it out. LOL... sorry, been one of those weeks... and it's only Monday.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Apr 25, 2008 11:09 pm

I just checked this out (NPC movement) on my dev server. That is totally cool! Got me to thinking, so here it is... you know how you have herds of guards walking about the cities and such? If you stop one and ask him for directions, that guard lags behind the others. In live, if I remember, that guard will then >sprint< (or such) to catch up with his buddies.
Can we do that now, or is that another function to consider?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 12:50 am

Annnnnd because I just love the sound of my own voice, here's yet another thought. :D
Is it possible/feasible to have a "global script" that has functions that every NPC might use... like the FaceTarget() function when targeted or hailed? I guess that might be ridiculous for badgers and bugs to consciously face you for no apparent reason... so many a toggle in the spawn record to "use globals" blah blah.
Also, proximity reactions - like passing by an NPC who blurts out some sales pitch or annoyingly gleeful greeting.
Can NPCs perform a visual "action" in the script? Like move to x,y,z then start gathering, like Paula is supposed to do.
For "packs" of NPCs (as I mentioned above) that move together - guards, enemy patrols, etc - could it be made easier to assign them a single script, and they just walk along together in formation based on their destination coords? Rather than give each and every NPC in formation movement commands...
This might also be a good time to consider "signaling" between NPCs. Eg., you hail an NPC and start a dialog, and that NPC "signals" another to walk this way, or perform some action, etc.
BUG: Can we stop targeting from generating a Hail? Unless it's a default action and we double-click (Hail) or right-click select Hail, we shouldn't get the hail on single left-click, just target. I think. I like the option of function targeted() where the NPC >could< respond to that... just not the Hail part.
Lastly, can we start early on organizing our scripts folders maybe by zone? Or perhaps that could be left up to the admin to include the path in the spawn_script field? I was just thinking about rats in many zones, will all require their own script. I know you can name the script by the spawnID so they do not accidentally use "a_rat.lua" in every zone for every rat... just a thought.
There was one more thing I was thinking about while playing with this, but I forgot. Lucky you. I'll be back!

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 3:20 am

Welp, I made a formation of guards on the island. :) If you log into my server and watch them a while, you can see the timings are not quite what they should be. I will post my scripts tomorrow, with more info. Right now I am just about to die frome exhaustion :D

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Apr 26, 2008 5:12 am

John Adams wrote:I just checked this out (NPC movement) on my dev server. That is totally cool! Got me to thinking, so here it is... you know how you have herds of guards walking about the cities and such? If you stop one and ask him for directions, that guard lags behind the others. In live, if I remember, that guard will then >sprint< (or such) to catch up with his buddies.
Can we do that now, or is that another function to consider?
We can't do that currently. I just added the code that allows an NPC to sprint back to his starting location after a short delay (5 seconds) if he kills someone. So the code is there, I will just have to integrate it with the movement code.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Apr 26, 2008 6:00 am

John Adams wrote: Is it possible/feasible to have a "global script" that has functions that every NPC might use... like the FaceTarget() function when targeted or hailed? I guess that might be ridiculous for badgers and bugs to consciously face you for no apparent reason... so many a toggle in the spawn record to "use globals" blah blah.
It would be possible, but I don't think it is feasible unless you have multiple default files (one for each spawn type), which kinda defeats the purpose. If someone has an idea about how to do this this without adding too much needless complexity I can change it.
John Adams wrote: Also, proximity reactions - like passing by an NPC who blurts out some sales pitch or annoyingly gleeful greeting.
I could have the code check for proximity and if the spawn is within say 15 feet (half of the chat distance), call a function in the LUA script that could say whatever you wanted.
John Adams wrote: Can NPCs perform a visual "action" in the script? Like move to x,y,z then start gathering, like Paula is supposed to do.
Currently no, I hadn't anticipated it when I was coding the function although I can easily add it to the function when I get a chance.
John Adams wrote: For "packs" of NPCs (as I mentioned above) that move together - guards, enemy patrols, etc - could it be made easier to assign them a single script, and they just walk along together in formation based on their destination coords? Rather than give each and every NPC in formation movement commands...
I can see the need for group movement in the LUA code, but instead of adding a complex table to the database we handle it solely from the LUA scripts? IE instead of MovementLoopAddLocation(NPC, x, y, z, speed, delay), have a function called GroupMovementLoopAddLocation(Group Name, x, y, z, speed, delay). Group Name could be any string you wanted to describe the group and would make it a lot easier to keep track of rather than a group number. Have this function called from 1 script as many times as you would like for the locations. Then call a function called GroupMovementAddNPC(Group Name, NPC, x_offset, z_offset) for each NPC that comprises the group. The offsets would be the values added (or subtracted) from the x and z coords to keep them close to each other without overlapping.
So for the 'head' NPC's script:

Code: Select all

function spawn(NPC)
	GroupMovementLoopAddLocation("Queen Island Guards", 22.19, -6.86, 183.95, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 30.76, -6.33, 196.28, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 20.70, -6.85, 206.43, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", -.90, -5.47, 212.14, 2, 5)
	GroupMovementLoopAddLocation("Queen Island Guards", 2.35, -4.73, 196.93, 2, 5)
	GroupMovementAddNPC("Queen Island Guards", NPC, 0, 0)
end
For other NPCs in the same group:

Code: Select all

function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, 2, 2)
end
function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, -2, -2)
end
function spawn(NPC)
	GroupMovementAddNPC("Queen Island Guards", NPC, 2, 0)
end
If someone has a better idea, let me know.
John Adams wrote: This might also be a good time to consider "signaling" between NPCs. Eg., you hail an NPC and start a dialog, and that NPC "signals" another to walk this way, or perform some action, etc.
That could probably be handled easier with a GetNPC(Name) LUA function. That way your script could handle whatever you wanted all from the Hail function.
John Adams wrote: BUG: Can we stop targeting from generating a Hail? Unless it's a default action and we double-click (Hail) or right-click select Hail, we shouldn't get the hail on single left-click, just target. I think. I like the option of function targeted() where the NPC >could< respond to that... just not the Hail part.
Targeting doesn't generate a Hail unless the default command is "Hail". On live I never had to double click to have it Hail. Every time I single click on a Hail'able spawn on live it Hails it. So I think it is working correctly.
John Adams wrote: Lastly, can we start early on organizing our scripts folders maybe by zone? Or perhaps that could be left up to the admin to include the path in the spawn_script field? I was just thinking about rats in many zones, will all require their own script. I know you can name the script by the spawnID so they do not accidentally use "a_rat.lua" in every zone for every rat... just a thought.
You should be able to do this right now, just use a / as the directory separator. So if you want your Antonica spawns to be in an Antonica directory inside of the SpawnScripts directory, simply have the spawn_script field in the table set to Antonica/Whateveryouwant.lua
If it doesnt work let me know, but that should work fine.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 9:40 am

Thank you for taking the time to go through my mind vomit. I think you are spot on with everything I requested, except the Hail thing, which I'll have to check in the Live game - I do not remember a single left-click performing any default action. How dangerous would that be to click a mob to see it's info and it attacks becuase that's it's default action? heh. I'll let you know what I find.
After additional consideration, I have to ask (don't hate me) if Waypoints would in fact be better supported by being a database table instead of LUA scripting? Here's why... Last night, setting up my Guard formation, it was a royal pain in the ass to walk to where I wanted the guard to move, do a /loc, then put those coords into the LUA - one for each waypoint, for each guard.
An alternative thought would be to offer an in-game command that allows you to set your current /loc to a waypoint id (assigned to the spawn):
/addwp 1 20 - to add the current loc to waypoint ID 1 delay here for 20 seconds
I like the LUA idea, it just seems like an administrative nightmare to set up... but I can also see a 3rd party tool being born that takes (for instance) a chat log of /locs and parses it into the movement commands for pasting into the LUA... dunno.
Are you dead set on waypoints being managed via script instead of DB?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Apr 26, 2008 9:58 am

John Adams wrote:Thank you for taking the time to go through my mind vomit. I think you are spot on with everything I requested, except the Hail thing, which I'll have to check in the Live game - I do not remember a single left-click performing any default action. How dangerous would that be to click a mob to see it's info and it attacks becuase that's it's default action? heh. I'll let you know what I find.
I believe that only the attack action is not done with a single click unless you enable it via the client's UI, but I'm pretty sure all the rest are done with a single click.
John Adams wrote: After additional consideration, I have to ask (don't hate me) if Waypoints would in fact be better supported by being a database table instead of LUA scripting? Here's why... Last night, setting up my Guard formation, it was a royal pain in the ass to walk to where I wanted the guard to move, do a /loc, then put those coords into the LUA - one for each waypoint, for each guard.
An alternative thought would be to offer an in-game command that allows you to set your current /loc to a waypoint id (assigned to the spawn):
/addwp 1 20 - to add the current loc to waypoint ID 1 delay here for 20 seconds
I like the LUA idea, it just seems like an administrative nightmare to set up... but I can also see a 3rd party tool being born that takes (for instance) a chat log of /locs and parses it into the movement commands for pasting into the LUA... dunno.
Are you dead set on waypoints being managed via script instead of DB?
The idea of doing it via LUA was so that the server admin would be able to customize it a little more. I am open to doing it via the db, but I never really liked the way it was done in eqemu so if we do it in the db we really need to design it first. Also doing it in game makes it quite a bit more complicated. Movements like you wanted to do with your guards would be very troublesome to setup. If you can come up with the db structure and the in game commands to pull it off I would be happy to switch over to it. I just think it will end up being very complicated for the average user. (Although a addon gui could be created to help in this regard I would think).

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 10:14 am

LethalEncounter wrote:I believe that only the attack action is not done with a single click unless you enable it via the client's UI, but I'm pretty sure all the rest are done with a single click.
You are, of course, right as always. When will I ever learn to not question you? :D I am in live now, and left single-click is in fact causing the default action to pop up. Man, I coulda sworn there used to be more interaction than that... thought I had stumped ya. :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 10:17 am

LethalEncounter wrote:If you can come up with the db structure and the in game commands to pull it off I would be happy to switch over to it. I just think it will end up being very complicated for the average user. (Although a addon gui could be created to help in this regard I would think).
Let me ponder this a while longer, cuz I definitely like the current implementation. Just thinking about an easier way to plug in all these coords. Maybe inspiring someone to write a log parser with the locs in it is the best solution.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Apr 26, 2008 10:32 am

I can always make commands that write directly to the files.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Apr 26, 2008 10:39 am

Meh, i thought of that... sounds risky, allowing an outsider to change physical files on your local drive. /paranoia on

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sat Apr 26, 2008 10:49 am

lol, true I didnt think about that

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests