having an issue with lua

Support forum for questions about compiling and running EQ2Emulator on Linux.

Moderator: Team Members

Post Reply
Bion
Retired
Posts: 241
Joined: Sun Sep 16, 2007 1:47 pm

having an issue with lua

Post by Bion » Sat Dec 06, 2008 1:57 pm

I was wondering if anyone else has had a issue like this or know how to fix it.
I have atm one spawnscript that is loading with one npc in my database it works fine when i first load up my server and when attacked this npc will chase you but if i wait 10 mins after it is loaded the npc no longer responds to hails or any other fuction.
He also will not move from his spot when attacked he just stays rooted in place and he can hit you from quite a distance away he stops attacking if you go far enough away say on the isle where the stairs are once you get off the boat he can hit ya till you get to where the boat is at.
I have tried using the /reload options for spawnscripts and the luasystem and repops nothing makes the npc script work again untill i restart the world.
there are somethings that i should note to get the emu to compile i had to edit the makefile and change where -llua5.1 to -llua because i was getting errors about it finding lua but after that it complied fine.
the npc stops running the script exactly 10 mins eatch time after the world is restarted. i have tested this by starting the world waiting then waiting 10 mins then logging in and trying to talk to him he never responded.
if i log in as soon as i restart he faces me like he is suppose to and says his killed event. and will do so untill 10 mins has passed.
I have dumped my database and reloaded it once to make sure i did not change something that i should not have.
I dont get any error like messages at the 10 min mark from eq2world or in my messege log.

Code: Select all

   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 13 00 00 00                                        | ....
   0: 25 00 01 00 31                                     | %...1
   0: 25 00 01 00 30                                     | %...0
   0: 54 01 00 00                                        | T...
Unhandled command: clearallqueuedabilities
   0: 35 00 0A 00 34 32 39 34 - 39 36 37 32 39 35        | 5...4294967295
   0: 54 01 00 00                                        | T...
Unhandled command: clearallqueuedabilities
OP_Unknown Received 0x00b2
   0: 01 01                                              | ..
   0: 54 01 00 00                                        | T...
Unhandled command: clearallqueuedabilities
   0: 25 00 01 00 30                                     | %...0
   0: 23 00 01 00 31                                     | #...1
Left Grid 4294967295 and Entered Grid 924281492
Left Grid 924281492 and Entered Grid 819993724
   0: 54 01 00 00                                        | T...
Unhandled command: clearallqueuedabilities
this is the only output once he stopped responding and i hailed him a few times and let him kill me to see if the killed event fires it does not.
the script that is running is a simple one and works great for 10 mins.

Code: Select all

function spawn(NPC)
        --Syntax is NPC, x, y, z, speed, delay (in seconds)
        --MovementLoopAddLocation(NPC, x, y, z, 2, 30)
end
function respawn(NPC)
end
function hailed(NPC,Spawn)
  FaceTarget(NPC,Spawn)
end
function aggro(NPC, Spawn)
 Say(NPC, "You have ruined your own lands.  You shall not ruin mine!")
end
function attacked(NPC)
end
function killed(NPC, Spawn)
  Say(NPC, "Another falls by my blade.")
end

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 Dec 06, 2008 2:14 pm

Did you create this NPC via the in-game command "/spawn create"? If not, you may be missing the location_id (the grid he is standing on). That's the only thing I can think that would make an NPC not move or lose it's LOS.
The LUA has nothing to do with whether or not you attack something and it attacks back or follows you. LUA only comes in when you want other actions to occur like shouts on aggro, death, or general walking about.

Bion
Retired
Posts: 241
Joined: Sun Sep 16, 2007 1:47 pm

Post by Bion » Sat Dec 06, 2008 2:20 pm

yes i did create the npc using the in-game commands i know the lua system does not have anything to do with if the npc chases you when attack but i noticed that when the spawn script stop working so did npc movement so i thought i would post that.
this issue is that spawn script i posted works fine for 10 mins after the world loads he faces you when hailed and will say his killed event say when he kills you. after this time has past he stops responding to hails and no longer says his killed say.

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

Post by LethalEncounter » Sat Dec 06, 2008 3:46 pm

Odd, could you have a bug post with this and I'll try to track it down when I get a chance?

Bion
Retired
Posts: 241
Joined: Sun Sep 16, 2007 1:47 pm

Post by Bion » Sat Dec 06, 2008 4:48 pm

ok LE I posted a summary of the problem in the bug forum. Tried to be a little bit more clear i can sometimes get carried away and ramble a bit :) thanks for looking into it.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests