Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 06-26-2013, 04:26 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default Lua Parser

Lua Parser has been the works for a while now.

We're getting close to release of it but it's still a couple days away while we clean up last minute build issues and such.

https://github.com/EQEmu/Server/tree/lua

Documentation:
https://github.com/EQEmu/Server/wiki/Lua-Parser

Right now it is turned OFF by default but eventually we want to get to the point where we turn it ON by default and perl OFF by default.

Also we've worked hard to reduce incompatible changes with the Perl parser but there are a few:

Code:
* templates quest folder has been renamed global.

* The items and spells quest folders need to be moved to the global folder.

* Item quests have been consolidated into a single type instead of the three types based on event_type.  
Now instead of three potential quests per item there is just one loaded as follows: 
	-if scriptfileid != 0 -> load script_<scriptfileid>.ext (eg: script_1000.pl)
	-else if charmfile != "" -> load <charmfile>.ext (eg: CHRMTest.pl)
	-else load <item_id>.ext (eg: 10001.pl)

* EVENT_PROXIMITY_SAY no longer occurs automatically. 
You need to call quest::enable_proximity_say() in perl
or call eq.enable_proximity_say() in lua at least once 
for the quest_manager to begin looking to process proximity events.

* quest::handleturnin has been removed

* quest::completehandin has been removed

* quest::resethandin has been removed

* quest::clearhandin has been removed

* Cazic Touch (982) is no longer hard coded to shout the target's name on cast.  
This can easily be scripted in now and we're looking to hard code as few things as possible.

* Spell quests that previously blocked effects no longer function as they did in perl due to a limitation of the perl parser.

* event_death no longer triggers after a death has occurred but before.
For the item quests it's very likely people wont have to modify a thing. Before we had 3 types of item quests based on the items charm, script and item_id that varied based on event type. This is now all in one quest according to that priority. If you have an item quest right now that has more than one script for the same item then you'll need to make some changes but odds are you do not. Eg: none of the PEQ quests afaik follow this pattern.

For the handin stuff things we wrote a plugin that duplicates the functionality of multiquesting for perl. Though if you make heavy use of the functions it might take a while to update.

The spell stuff is more tricky due to how we changed the underlying system and a limitation in our perl parser we simply cannot override the effects on perl. It's suggested that if you need scripted spells that have completely overridable effects and can't use lua to make the spells be basically blank.

For the event_death, the way to get the old functionality (which is required in a few circumstances) is to instead use the event: event_death_complete.

Last edited by KLS; 06-28-2013 at 12:30 AM..
Reply With Quote
  #2  
Old 06-26-2013, 07:42 PM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

That is some good stuff. I like how you guys/girls laid out the wiki.
Reply With Quote
  #3  
Old 07-01-2013, 05:20 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Has been running on PEQ for nearly a week now so we're confident about merging it into master.

It's a bit disruptive but not too bad to upgrade. Overall it should take about 10 minutes of changes unless you have some really heavy use of some of the impacted features.


Also as an aside: I realize we keep changing back end systems with questionable immediate benefit for people to upgrade. I think soon I will add something more tangible and nifty (not that lua isn't tangible and nifty but some people are happy with perl as is sooo).
Reply With Quote
  #4  
Old 07-01-2013, 05:24 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Will this release of Lua cause the death of Perl support or will we have the availability of both? I'd hate to have to learn an entirely new language just to script a few NPCs, just a concern, hopefully there is a separate branch for Lua and one for Perl.
Reply With Quote
  #5  
Old 07-01-2013, 06:10 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Perl and Lua are able to be used at the same time and can even talk to each other via signals/timers.

It can only load one per type and will prefer lua to perl quests though. Eg: if you had fippy_darkpaw.pl and fippy_darkpaw.lua then fippy_darkpaw001 on event_spawn would load fippy_darkpaw.lua.

The idea is perl is becoming more and more difficult to support (just take a look at the issues getting it to run on windows for any modern version). So we needed a viable replacement in the long run but at the same time there are thousands of perl quests so it needs to run alongside because those wont get rewritten overnight (or ever maybe for some people).
Reply With Quote
  #6  
Old 07-01-2013, 06:47 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

All right, so if you don't have a .lua for that NPC it will just load the .pl, correct? For example I have a custom NPC, suppose his name is CustomNPC, and all I had for him was a .pl, it wouldn't attempt to load a .lua if he didn't have one so custom quest wouldn't be interfered with?
Reply With Quote
  #7  
Old 07-01-2013, 07:13 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

It would attempt to load .lua, see that it's not there then attempt to load the .pl.
Reply With Quote
  #8  
Old 07-01-2013, 07:16 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Thank you, doesn't seem that bad after all, I could keep Perl and learn Lua if I wanted to. Thanks for the quick responses.
Reply With Quote
  #9  
Old 07-01-2013, 07:38 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

Nicely done, KLS, I'll be messing around with this during the week.

Boost is now required by the way if you are using LUA, I'd like to see that become a requirement for all builds and used more.
Reply With Quote
  #10  
Old 07-02-2013, 12:09 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

Ive updated my quests folder via svn today, and it changed all my event_death portion on my npcs to event_death_COMPLETE , and now my event_death scripts are not working

What do I have to download here to get everything working again? I dont know anything about lua
Reply With Quote
  #11  
Old 07-02-2013, 12:25 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

Yeah i dont understand, lua is not supposed to be enabled by default, yet now every one of my npcs have the event_death_complete instead of event_death in the .pl scripts, breaking every single one of them, what can I do?
Reply With Quote
  #12  
Old 07-02-2013, 01:49 PM
Robregen
Developer
 
Join Date: May 2011
Posts: 108
Default

you need to recompile the latest git as it now includes the code for event_death_complete. And make sure you build it with perl.
Reply With Quote
  #13  
Old 07-02-2013, 01:58 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

1) Make sure they're EVENT_DEATH_COMPLETE and not event_death_complete(case sensitive).
2) Make sure you're using current master code.

Lua enabled or not, perl still sees the new events.
Reply With Quote
  #14  
Old 07-02-2013, 03:52 PM
Furniture
Hill Giant
 
Join Date: Aug 2012
Posts: 205
Default

ahh ok, i didnt realize git was updated yesterday to include this, sorry about that
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:36 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3