Server Clan Crushbone
Moderator: Team Members
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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.
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.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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?
Can we do that now, or is that another function to consider?
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Annnnnd because I just love the sound of my own voice, here's yet another thought. 
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!
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!
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
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.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?
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
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: 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.
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: Also, proximity reactions - like passing by an NPC who blurts out some sales pitch or annoyingly gleeful greeting.
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: Can NPCs perform a visual "action" in the script? Like move to x,y,z then start gathering, like Paula is supposed to do.
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.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...
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)
endCode: 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)
endThat 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: 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.
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: 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.
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.luaJohn 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.
If it doesnt work let me know, but that should work fine.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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?
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
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: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.
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).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?
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
You are, of course, right as always. When will I ever learn to not question you?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.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
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 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).
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
-
LethalEncounter
- Team: Zombie
- Posts: 2717
- Joined: Wed Jul 25, 2007 10:10 pm
Who is online
Users browsing this forum: No registered users and 0 guests