Discussions on development of both the EQ2Emulator LUA Script Engine and Script specifications
Moderator: Team Members
-
alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
-
Contact:
Post
by alfa » Thu Jan 22, 2009 4:53 pm
I have spend 2 hours for try to do it with the original function but this is a nightmare
This is possible to add something to the original function for force NPC to do a circle ?
I mean can we set a central point and force mob to turning arround on a certain distance ?
And in addition can we set just a part of the circle ?
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
-
Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Post
by Scatman » Thu Jan 22, 2009 5:01 pm
The MovementLoopAddLocation function is used really for what its named for, to make a loop. Go to point A, then to point B, then to point C, there are no more points so begin at part A and repeat. What I did to make a generic circle script was before the loop was started, get the spawn's initial x, y, z and make a loop of their spawn location, so it can be applied to any spawn without any hardcoded numbers besides the offsets, and even those can be randomly generated if you wish to have larger or smaller circles.
-
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 » Thu Jan 22, 2009 5:27 pm
Scatman is fookin brilliant. I tell ya.
-
alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
-
Contact:
Post
by alfa » Fri Jan 23, 2009 5:34 am
Scatman wrote:The MovementLoopAddLocation function is used really for what its named for, to make a loop. Go to point A, then to point B, then to point C, there are no more points so begin at part A and repeat. What I did to make a generic circle script was before the loop was started, get the spawn's initial x, y, z and make a loop of their spawn location, so it can be applied to any spawn without any hardcoded numbers besides the offsets, and even those can be randomly generated if you wish to have larger or smaller circles.
Can you provide me a little example please ?
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
-
Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Post
by Scatman » Fri Jan 23, 2009 8:51 am
Code: Select all
function spawn(NPC)
x = GetX(NPC)
y = GetY(NPC)
z = GetZ(NPC)
MovementLoopAddLocation(NPC, x + 7 , y, z - 8 , 2, math.random(5, 15))
MovementLoopAddLocation(NPC, x - 5 , y, z - 10, 2, math.random(5, 15))
MovementLoopAddLocation(NPC, x - 10, y, z + 9 , 2, math.random(5, 15))
MovementLoopAddLocation(NPC, x + 5 , y, z + 8 , 2, math.random(5, 15))
end
-
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 Jan 23, 2009 11:42 am
alfa, as a member of the DB team, you have access to the DB editor, which shows you any script we have in development.
You should try using it to see what work has already been done. It may answer many questions!

-
Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Post
by Scatman » Fri Jan 23, 2009 11:55 am
This is off topic but I hate how EQ2 uses Y as their verticle axis

In a 3d world, isn't the Z axis the height? Throws me off sometimes.
-
Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Post
by Scatman » Fri Jan 23, 2009 1:17 pm
Ahh I am thinking of way back in my graph theory class we always drew the Z axis vertical haha. I guess the images were tilted in those drawings.
-
alfa
- Team Member
- Posts: 550
- Joined: Fri Jul 27, 2007 6:24 pm
- Location: France
-
Contact:
Post
by alfa » Sat Jan 24, 2009 3:18 pm
Humm after test not what I mean at all (but thx for this info too)
I mean the mob do a perfect circle. For example in VP Mylex turn around his enginer he do simply a circle, not random point or other just a circle and the central point is enginer.
Fight with me... Or die, like the rest.
J.A. say: "I think Xinux tried to tell me this, but I ignore most things he suggests."
-
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 Jan 24, 2009 3:53 pm
Hah, the sample was just to show you how to use Movement Loops. You have to get in game, stand where you want him to move and /loc, then enter a new movement loop for every "waypoint" you wish him to stop and turn.
No, there is no "perfect circle" lua command. :/
-
Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Post
by Scatman » Sat Jan 24, 2009 4:05 pm
It wouldn't be hard to make a perfect circle. My offsets I showed you are different so the circle won't be perfect, but if you tweek them you could very easily make a perfect circle.
Who is online
Users browsing this forum: No registered users and 0 guests