[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Lua
. . -> [Subject]  Smaug Lua Forums

Smaug Lua Forums

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Orik   USA  (182 posts)  [Biography] bio
Date Sun 15 Jul 2007 06:15 PM (UTC)
Message
Hey Nick,

Do you think you could add Smaug Lua Forums to the smaug forum list? That we'd hvae smaug running smaug compiling, smaug commands, smaug code, and smaug lua.

That way all the lua posts would be in one spot and You could put the links at the top of the forum so people can see them easy and quick access.

ALso, do you update the lua code files every time you make a new post to show the new things you've done or are you just showing us what you've done yourself and don't have the files available for download yet.

Have you tried this on smaugfuss 1.8 as well?
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 15 Jul 2007 11:07 PM (UTC)
Message
I have made a Lua topic in this forum, to separate the Lua-related stuff, as you suggested.

Quote:

... do you update the lua code files every time you make a new post ...


Not quite yet. I was trying to do the preliminary post to get people interested. I am cleaning up the code a bit, making sure the task system still works, and making things slightly more modular. As the project grows in size, I don't want individual files to get too unwieldy.

The new files should be released in an hour or so from the time of this post.

Quote:

Have you tried this on smaugfuss 1.8 as well?


No, I haven't, but it should fit in OK. The reason is that the changes to the stock SMAUG code are pretty minor - a few hooks here and there. Basically if you search for "lua" in the released files here, you would see where the hooks should go.

Basically as I described earlier, it is:


  • Add Lua state to character struct
  • Initialize it to NULL as soon as possible
  • Start the Lua script engine up when the player connects
  • Shut the Lua script engine down when the character struct is about to be destroyed - if necessary
  • "Hook into" the Lua script at various appropriate places (eg. changing rooms).


After that, there are a few more files to be added to the project, that provide the bulk of the Lua support.

In addition, for the resets, there is an additional Lua state for the entire MUD. Since this doesn't belong to any particular player, the state itself is stored in the new Lua source files, so that doesn't require any change to the stock code. However, in a couple of places in comm.c I added a couple of lines to initialise the state, tell it the MUD is starting up, tell it the MUD is shutting down, and call it for things like room resets.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Orik   USA  (182 posts)  [Biography] bio
Date Reply #2 on Sun 15 Jul 2007 11:12 PM (UTC)
Message
Awesome. I can't wait to see the released code. I'll have to definately put it in and start messing around with it.

Awesome stuff. I was kind of "meh, I don't know if I want to get into it yet."

But after seeing all of your posts, I'm downright excited.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,442 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]