Page 1 of 1
Errors processing "tainted" lua
Posted: Wed Aug 13, 2008 7:53 pm
by John Adams
There are no posts here, so I thought I'd throw this out.

Scat, great work on the queenscolony_tainted.lua. There were a few errors, plus it being named one thing but linked in another. I changed the Quests record to point to "queenscolony_tainted.lua" - though we might think about naming our scripts as close to the actual quest name as possible (special characters aside).
Secondly, where it says "NPC ID(s)", you have to actually put the spawn_id's in - and you can get them from the spawn editor by looking them up by name.
Lastly, be careful of your "if / then" in LUA. =~ throws an error, but ~= is the proper format.
I fixed these two. Take a look when you get a chance.
Great job though. I like seeing quests come to life. Players like that, too. Smells like progress.

Posted: Wed Aug 13, 2008 9:40 pm
by Scatman
Yah! I put a large tag up at the top -- NOT FINISHED -- because I was at work writing that (shh) and wasn't able to get the item IDs nor spawn IDs nor test it. I just got in so I'll give it a whirl tomorrow. I didn't want to mess with Murar Shurar, or whatever his name is, because I know you had that KillCrabs quest with him so I found that 2nd line of quests in the noobie zone. I knew it wasn't going to work, sorry, I should've let ya know! Thanks for putting those changes in there, I'll try and tweek in soon.
EDIT
Oh! The reason why the linking might not have been correct was because I had originally named it queenscolony_tainted.lua to specify <zone>_<quest_name> then realized after I saved it that you had a script written to put it in its specific zone folder already! Very nice! So I tried to rename it just to tainted.lua (the name of the quest), but I guess I did something wrong.
Nice job on the editor btw John, it's super easy and super simple, I likey.
Re: Errors processing "tainted" lua
Posted: Wed Aug 13, 2008 9:51 pm
by Scatman
if questGiver ~= nil then[/code]
I fixed these two. Take a look when you get a chance.
Oops! used to perl matching and substitute =~ m// and =~ s//// hehe. Nice catch John, like I said I just wrote it quicky to get a feel for the quest functions and didn't even have a chance to test it myself. I'll take a look at it asap!
Posted: Wed Aug 13, 2008 10:42 pm
by Scatman
I wrote the script for that mob to offer the quest but in your editor when I hit save, it would not save it and I think it crashed the server =/ oops! After the first time I wrote it, I rewrote a second quick one and tried to make sure I had no syntax errors just incase your scripts checked for it before it saved it into the DB. I'm going to copy and paste it in this post so if there is a bug I can just copy/paste it back in there. Otherwise, let me know what I'm doing wrong. Thanks!
Code: Select all
function spawn(npc)
ProvidesQuest(npc, 3)
end
function hailed(npc, spawn)
FaceTarget(npc, spawn)
conversation = CreateConversation()
if HasQuest(spawn, 3) then
AddConversationOption(conversation, "K bye")
StartConversation(conversation, npc, spawn, "Keep killan!")
else
if HasCompletedQuest(spawn, 3) then
AddConversationOption(conversation, "Anytime")
StartConversation(conversation, npc, spawn, "Thanks for the help!")
else
AddConversationOption(conversation, "Listen to the silence?", "quest1_before1")
AddConversationOption(conversation, "Then I'll leave you in peace.")
StartConversation(conversation, npc, spawn, "Shhh...I'm trying to listen to the silence. Whisper please.")
end
end
end
function quest1_before1(npc, spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "The view's not so clear from here.", "quest1_before2")
StartConversation(conversation, npc, spawn, "Away from the noise over in the camp. You can see where you've been and where you can go. You know what awaits you if you go further in. If only everything were as simple as that, where all your choices are clear and you can see what awaits.")
end
function quest1_before2(npc, spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "What evil do you sense?", "quest1_before3")
AddConversationOption(conversation, "Then I'll have no more dealings with you.")
StartConversation(conversation, npc, spawn, "True, but it's clearer than, say, the difference between good and evil. All those around here who are \"good\" avoid me because I was born \"evil\". I grew up in Freeport. Does that make them better than me somehow, that I chose to leave Freeport to work on behalf of the Queen only recently? Who knows? Yet I must be evil; I can sense the evil in others.")
end
function quest1_before3(npc, spawn)
conversation = CreateConversation()
AddConversationOption(conversation, "I'll do what I can.", "quest1_offerQuest")
AddConversationOption(conversation, "Perhaps some other time.")
StartConversation(conversation, npc, spawn, "They say that there is a taint rising from an unknown source, polluting this place and corrupting the inhabitants. I feel it is much simpler than that. There are spiders in the Tainted Forest, poisonous ones. With their venom, they can cause untold suffering. The search for \"evil\" sometimes has a mundane cause. We must rid the Colony of these spiders.")
end
function quest1_offerQuest(npc, spawn)
OfferQuest(npc, spawn, 3)
end
*EDIT*
Edited spawnscript for her first quest to be exactly like live. Couldn't save it on the spawnscript because the Save button wasn't available to click.
Posted: Thu Aug 14, 2008 6:11 am
by John Adams
Sorry Scat, I knew you were not finished with it heh. I was just opening dialog publicly so people are aware Scripting is being done by the (now) script master (as you definitely know more about it than me! lol)
I didn't mean to imply it was done, and buggy. Just hoping our combine knowledge will fuel the community to get involved in some of these writings - because there are thousands of them.

As for the server, the script editor should not effect the EQ2 server unless you mean on /reload it crashed. If that's the case, I am pretty sure I have screamed enough at LE that there are problems with /reload. TessEQ2 auto-restarts, so it's no complete loss, just an inconvenience.
Currently the script editor does
not check for syntax. I would have no idea what is correct syntax, but maybe in a future version it will have more features.
The "scripts" you write get saved directly to the file {name}.lua on the hard drive - no database entry for that. The path/to/script.lua is saved to the `quests` table when you add a new one or update an exiting one (the top section).
The "SpawnScript" editor is not working at this time. I screwed something up and broke it. I'll try and get it fixed today. Only editors that save currently are Quest and Spells. Sorry!
Posted: Thu Aug 14, 2008 6:21 am
by Scatman
Oh ok that's fine. Hm, I guess it was another problem connecting to your server last night then. Whenever I attempted to enter the world on your server it came back with an error like, "Could not log you in because of errors." or something very vague like that.
And no worries, once I actually get that sample quest working, I'm going to change the dialog around to perfectly match live's quest, as well as quest dialog/steps and such.
I guess I'll just have to wait patiently for the editor!
