Jump to content

[wip] Lua Script Engine


sketchyphoenix

Recommended Posts


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Oct 18, 2013 - Moved to http://hercules.ws/board/blog/13/entry-41-get-ready-get-hype-the-road-to-lua-with-hpm/

 

------------------

Continued from the same thread on the eA site.

This is a development branch that replaces the rAthena script engine with a Lua script engine. The commands have been written, the NPCs have not, and some functionality must be completed.

This project is based off the old eAthena project found here: http://eathena-proje...l/DracoRPG/lua/

I just happened across this one day and decided I would make an attempt at finishing it, and props to everybody who worked on it.

  • Upvote 10
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Got a big update in the works. About 3/4ths done merging this into rAthena Done and I'll continue my work on variable storage/autobonus/finish converting scripts/other stuff I can't think of yet but I'll post it when I remember but those 3 are the biggest issues

Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Variable storage is almost done. I just need to write the queries.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  257
  • Reputation:   253
  • Joined:  11/29/11
  • Last Seen:  

How will you be going about the conversion of scripts? :P

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

A conversion script is the most feasible idea. The problem is it wouldn't be very well written by Lua standards.

In other news, I got rid of LuaSQL today. I was writing the db queries to handle variable storage and found that the bindings weren't able to prepare statements, which had me looking for one that could - and that was LuaDBI.

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  257
  • Reputation:   253
  • Joined:  11/29/11
  • Last Seen:  

Fair enough.

I've always wanted to get rid of eAscript, tis so limited. You can't even explode strings.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

What I plan on doing with this there's a lot more going on than Lua's string library!

  • Upvote 2
Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Still alive, but having to plan out the rest of my short term work so I don't get bogged down by too much. I'm taking notes on what I need to remove to get the old script engine out, since technically it's still in but disabled since I decided at the time that trying to remove it and fixing whatever that depended on it in the source took more time than I would've liked to put in it.

Also I plan on having an update next week.

  • Upvote 1
Link to comment
Share on other sites

  • 3 weeks later...

  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  427
  • Reputation:   123
  • Joined:  11/17/11
  • Last Seen:  

Woooot.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

So what's been holding me up for so long was 1) i got a new job and 2) I was torn on how to finish off variable storage.

It came down to this. I needed to send registries from map to char or login for saving, but I had 2 ways to do it. I could either do it with Lua or do it using rA's inter-server stuff. Tried the latter first. Then I realized that doing it with inter-server functions is really hacky (take variables from Lua -> conver to struct -> send to char/login -> char/login reconstructs the table, send it back to Lua then save it. So I decided to just have char/login server have its own Lua server just to handle that since I was already giving char/login their own lua states for sqlite support. Now I'm in the process of writing that.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

LChar-Server can now save registries to a sqlite or mysql database.

It also has user authorization. Just need to plug this into rA so I can use the hashing functions for the inter-server user/pw.

LLogin-Server being worked on.

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Update coming tomorrow, only 1 major bug I need to fix tonight/tomorrow.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   6
  • Joined:  11/15/11
  • Last Seen:  

Good job, i love LUA :).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

When I first started this, I didn't take out all of the old script engine code since I didn't want to break anything. Now I'm tired of looking at it since I'm closer to being done. Next few updates will probably be centered around taking that engine out and cleaning up what's left.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Another update today. Also the OP now has an update queue so you can see what's being worked on and what's going in the next update.

r16140

  • Upvote 2
Link to comment
Share on other sites

  • 2 months later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Sometime this week should be another update when I finish merges and that update should include some code to make item scripts work.

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   28
  • Joined:  09/20/12
  • Last Seen:  

Sketchy I love you

Lots of serious gay in that ohyea LOTSOFGAY.

Ok joking, But where did you end up on this.

also NECRO POST!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

I wonder if a Lua server could read certain client lua files (copied as-is with no format modifications), for things like the const.txt database and other IDs?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   28
  • Joined:  09/20/12
  • Last Seen:  

I don't see why not.

I'd almost make sure a all the scripts are lua ready if i knew sketchy was more then 60% complete :D

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  326
  • Reputation:   19
  • Joined:  09/27/12
  • Last Seen:  

Will this allow you to store strings and arrays on characters and accounts? Because that would pretty much be the most bad ass thing ever.

Link to comment
Share on other sites

  • 4 weeks later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

I wonder if a Lua server could read certain client lua files (copied as-is with no format modifications), for things like the const.txt database and other IDs?

It can. If you loaded it plain they would all be defined as globals.

I don't see why not.

I'd almost make sure a all the scripts are lua ready if i knew sketchy was more then 60% complete :D

Most of the commands work. The only ones I haven't worked on were item scripts.

Will this allow you to store strings and arrays on characters and accounts? Because that would pretty much be the most bad ass thing ever.

Considering the variable handling is being done entirely* in lua, all it takes is for one to write a script to do it.

*still using athena's inter-server functions for sending the right variables to the right server for saving, but the db operations for it will be done in lua so anybody can use their own (supported by luadbi anyway) engine if they wanted.

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   28
  • Joined:  09/20/12
  • Last Seen:  

I wonder if a Lua server could read certain client lua files (copied as-is with no format modifications), for things like the const.txt database and other IDs?

It can. If you loaded it plain they would all be defined as globals.

I don't see why not.

I'd almost make sure a all the scripts are lua ready if i knew sketchy was more then 60% complete :D

Most of the commands work. The only ones I haven't worked on were item scripts.

Will this allow you to store strings and arrays on characters and accounts? Because that would pretty much be the most bad ass thing ever.

Considering the variable handling is being done entirely* in lua, all it takes is for one to write a script to do it.

*still using athena's inter-server functions for sending the right variables to the right server for saving, but the db operations for it will be done in lua so anybody can use their own (supported by luadbi anyway) engine if they wanted.

-drool-

of course you come back and reply when I am really busy! work sucks mmhmmm

  • Upvote 1
Link to comment
Share on other sites

  • 4 months later...

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Just posting to inform everyone that I've been fixing bugs the past day or so.

Ill need to put this on another repo since I don't have svn here and ill update the links when I do done

Edited by sketchyphoenix
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  112
  • Reputation:   89
  • Joined:  11/12/11
  • Last Seen:  

Unfortunately, this project is no longer using svn. We git now. Both out of date. Will post a link when I finish my big change.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...