Making Npc Loop Movement
Moderator: Team Members
Forum rules
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
READ THE FORUM STICKY THREADS BEFORE ASKING FOR HELP!
Most information can be found there, and if not, the posts will help you determine the information required to get assistance from the development team.
Incomplete Help Requests will be locked or deleted.
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Making Npc Loop Movement
I have a Question,
So I have my script for movement
In spawn script I have all the fields right but... Lua_Script.
I tryed putting the name of my script file, that didnt work.
In C# you would write the code with base creature xxxxx, and that would be were the data base would find the script.
This is a bit new to me.
So I put in the location of the file C:\eq2emu\scripts..... so on
Still cant load the script file.
What am I supost to put in the lua_script field for the server to see the file and follow the xyz that I am using for Npc movemnt?
Thanks for your help.
P.s. I did spend all night looking though all the forums and read a lot about group movment and how you tryed to get them to walk in circles and so on. So im not a slacker...
Thanks for the help.
So I have my script for movement
In spawn script I have all the fields right but... Lua_Script.
I tryed putting the name of my script file, that didnt work.
In C# you would write the code with base creature xxxxx, and that would be were the data base would find the script.
This is a bit new to me.
So I put in the location of the file C:\eq2emu\scripts..... so on
Still cant load the script file.
What am I supost to put in the lua_script field for the server to see the file and follow the xyz that I am using for Npc movemnt?
Thanks for your help.
P.s. I did spend all night looking though all the forums and read a lot about group movment and how you tryed to get them to walk in circles and so on. So im not a slacker...
Thanks for the help.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Making Npc Loop Movement
You do put the file path of your script in lua_script. Are you positive it's not loading? All 1,331 spawn scripts on Tess work. Is your script written properly? You can use "/luadebug start" in-game to find syntax errors in scripts. If you paste your script here we can double check it for ya.
- John Adams
- Retired
- Posts: 9684
- Joined: Thu Jul 26, 2007 6:27 am
- EQ2Emu Server: EQ2Emulator Test Center
- Characters: John
- Location: Arizona
- Contact:
Re: Making Npc Loop Movement
Scat, perhaps this is a good time to start adding to the Wiki those LUA function examples we talked about. I'll see if I can add this one and get a general format for the Wiki started so others can help fill in the blanks.
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
Thanks guys.
here is the script.
I named the file, " movment"
function spawn(NPC)
--Syntax is NPC, x, y, z, speed, delay (in seconds)
MovementLoopAddLocation(NPC, -115.55, -52.09, -727.04, 2, 30)
MovementLoopAddLocation(NPC, -111.14, -48.75, -751.51, 2, 30)
MovementLoopAddLocation(NPC, -81.45, -45.57, -704.45, 2, 30)
MovementLoopAddLocation(NPC, -.90, -5.47, 212.14, 2, 30)
MovementLoopAddLocation(NPC, -103.04, -45.12, -704.47, 2, 30)
end
like i said this code seems to simple compared to c#.. LOL.
maybe im not coding this right to find it. In C# you put a public class name for the server toto find the file. example
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
namespace Server.Movement
{
public class Movement : IMovement <<<<<<<<
{
So sorry if I am confused. But as I looked at your C++ That is all there is to the code.
Am I wrong?
Also would I make the custom spells from scripts also?
Thanks again for the help.
here is the script.
I named the file, " movment"
function spawn(NPC)
--Syntax is NPC, x, y, z, speed, delay (in seconds)
MovementLoopAddLocation(NPC, -115.55, -52.09, -727.04, 2, 30)
MovementLoopAddLocation(NPC, -111.14, -48.75, -751.51, 2, 30)
MovementLoopAddLocation(NPC, -81.45, -45.57, -704.45, 2, 30)
MovementLoopAddLocation(NPC, -.90, -5.47, 212.14, 2, 30)
MovementLoopAddLocation(NPC, -103.04, -45.12, -704.47, 2, 30)
end
like i said this code seems to simple compared to c#.. LOL.
maybe im not coding this right to find it. In C# you put a public class name for the server toto find the file. example
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
namespace Server.Movement
{
public class Movement : IMovement <<<<<<<<
{
So sorry if I am confused. But as I looked at your C++ That is all there is to the code.
Am I wrong?
Also would I make the custom spells from scripts also?
Thanks again for the help.
- Zcoretri
- Team Member
- Posts: 1642
- Joined: Fri Jul 27, 2007 12:55 pm
- Location: SoCal
Re: Making Npc Loop Movement
Did you enter the name of your spawn script in the 'lua_script' field of the spawn_scripts table in the DB?
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
Yes, the name of the script is "movement"
in spawn scripts in the db table, under Lua_Scripts I put in movement. that didn't work so then i put in the path c:\eq2emuu\spawnScripts\movement.
I got an error saying cant access script and no movement. Is the script written correct? seems to easy lol
in spawn scripts in the db table, under Lua_Scripts I put in movement. that didn't work so then i put in the path c:\eq2emuu\spawnScripts\movement.
I got an error saying cant access script and no movement. Is the script written correct? seems to easy lol
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Making Npc Loop Movement
I can't remember if not having the file extension (.lua) matters or not. I remember reading somewhere that it didn't matter but I always include the .lua to make sure. Are you using version 0.6.5? I logged into your server and noticed the welcome message still said "Welcome to EQ2Emulator 0.0.4", but you probably just haven't changed that in your db
Your script looks good, so it's nothing there. I'm not really sure.. it's probably a simple mistake somewhere, wrong spawn_id ?
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
here is my server with just Movement path typed in
Loading new Zone 'GreaterFaydark'
Loaded 81 NPC(s), 0 Object(s), 0 Widget(s), 0 Sign(s), 0 GroundSpawn(s).
Error loading cannot open C:\AC Web Ultimate Repack\EQ2EMU\SpawnScripts\Movement
: No such file or directory
Error LUA Spawn Script 'C:\AC Web Ultimate Repack\EQ2EMU\SpawnScripts\Movement'
OP_ChatFiltersMsg Received 0x0135
0: 0D 00 FF FF FF FF FF 01 - 00 00 00 80 FF FF 03 01 | ................
OP_ChatFiltersMsg Received 0x0135
0: 0D 00 FF FF FF FF FF FF - FF FF FF FF FF FF 03 01 | ................
OP_Unknown Received 0x00ad
0: 00 00 | ..
Does that help at all? lol
Loading new Zone 'GreaterFaydark'
Loaded 81 NPC(s), 0 Object(s), 0 Widget(s), 0 Sign(s), 0 GroundSpawn(s).
Error loading cannot open C:\AC Web Ultimate Repack\EQ2EMU\SpawnScripts\Movement
: No such file or directory
Error LUA Spawn Script 'C:\AC Web Ultimate Repack\EQ2EMU\SpawnScripts\Movement'
OP_ChatFiltersMsg Received 0x0135
0: 0D 00 FF FF FF FF FF 01 - 00 00 00 80 FF FF 03 01 | ................
OP_ChatFiltersMsg Received 0x0135
0: 0D 00 FF FF FF FF FF FF - FF FF FF FF FF FF 03 01 | ................
OP_Unknown Received 0x00ad
0: 00 00 | ..
Does that help at all? lol
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
Thanks Scatman. I need to change the message it is 6.5.
I didnt put .lu behind it ill try that right now thanks
I didnt put .lu behind it ill try that right now thanks
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
YIPPIE!!!! IT WORKED... So anyone doing this make sure and put your path and .lua behind your file 
I must stay this is easy coding... I love it... I wish they would of tought c++ in the early 80's when I went to collage in computer science. haha.... Thanks for your help
I must stay this is easy coding... I love it... I wish they would of tought c++ in the early 80's when I went to collage in computer science. haha.... Thanks for your help
- Scatman
- Retired
- Posts: 1688
- Joined: Wed Apr 16, 2008 5:44 am
- EQ2Emu Server: Scatman's Word
- Characters: Scatman
- Location: New Jersey
Re: Making Npc Loop Movement
Glad that worked. Yep, LE made the LUA interface very easy to use 
- palaxe
- Posts: 65
- Joined: Fri Oct 05, 2007 9:01 am
- EQ2Emu Server: Aprilla
- Location: U.S.A
Re: Making Npc Loop Movement
Thanks LE.. I really love working on your system.. Its solid 
Who is online
Users browsing this forum: No registered users and 0 guests