Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Lua
➜ afkmud and Lua
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Sat 01 Mar 2008 07:35 PM (UTC) |
Message
| Anyone successfully put Lua into afkmud? I've been trying and have been very unsuccessful.
Are there plans for it? Anyone ambitious to do it? lol | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sat 01 Mar 2008 08:04 PM (UTC) |
Message
| My post about adding Lua to SMAUG went into some detail:
http://www.gammon.com.au/forum/?id=8000
Using that as a guide, it should be fairly easy to do, if you are reasonably familiar with Lua, and know what you are about with the MUD code.
If you say you have "been very unsuccessful" can you give more details? Error messages? Crashes? Can't work out where a particular line goes? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Reply #2 on Sat 01 Mar 2008 08:21 PM (UTC) |
Message
| Here's mud.h
/*
Lua includes :)
NJG
*/
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
Here's the make errors:
Building AFKMud....
make -s afkmud
Compiling o/imc.o....
In file included from imc.cpp:62:
mud.h:58:19: lua.h: No such file or directory
mud.h:59:22: lualib.h: No such file or directory
mud.h:60:23: lauxlib.h: No such file or directory
In file included from mud.h:810,
from imc.cpp:62:
character.h:585: error: `CHAR_DATA' was not declared in this scope
character.h:585: error: `ch' was not declared in this scope
character.h:585: error: variable or field `open_lua' declared void
character.h:586: error: `CHAR_DATA' was not declared in this scope
character.h:586: error: `ch' was not declared in this scope
character.h:586: error: variable or field `close_lua' declared void
character.h:589: error: `CHAR_DATA' was not declared in this scope
character.h:589: error: `ch' was not declared in this scope
character.h:589: error: syntax error before `char'
character.h:592: error: `CHAR_DATA' was not declared in this scope
character.h:592: error: `ch' was not declared in this scope
character.h:592: error: syntax error before `char'
character.h:594: error: `CHAR_DATA' was not declared in this scope
character.h:594: error: `ch' was not declared in this scope
character.h:595: error: syntax error before `char'
character.h:599: error: `CHAR_DATA' was not declared in this scope
character.h:599: error: `ch' was not declared in this scope
character.h:600: error: syntax error before `char'
make[1]: *** [o/imc.o] Error 1
make: *** [all] Error 2
I know character.h probably needs to be changed from CHAR_DATA to char_data... I figure anyway, not sure. AFKmud is so different from what i'm used to with smaugfuss, I'm just not really sure on it. | Top |
|
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Reply #3 on Sat 01 Mar 2008 08:33 PM (UTC) |
Message
| I fixed the above errors, but then I get a ton of errors from the lua files about syntax errors before void and int and *
| Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #4 on Sat 01 Mar 2008 08:42 PM (UTC) |
Message
| Well it won't compile without the Lua files like lua.h.
A copy is available here:
http://www.gammon.com.au/files/mushclient/lua5.1_extras/lua5.1_lib.zip
However basically you should download Lua from www.lua.org, unzip, compile and install that (make install).
I can't see how you will get far until that is done.
Quote:
... I get a ton of errors from the lua files about syntax errors ...
Even posting 10 of them helps to get a feel for the problem. It really is impossible to help when you say "I got errors" with no indication about what those errors are.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Reply #5 on Sat 01 Mar 2008 08:50 PM (UTC) |
Message
|
Building AFKMud....
make -s afkmud
Compiling o/imc.o....
In file included from mud.h:58,
from imc.cpp:62:
lua.h:16:21: luaconf.h: No such file or directory
In file included from mud.h:58,
from imc.cpp:62:
lua.h:99: error: syntax error before `;' token
lua.h:103: error: syntax error before `;' token
lua.h:110: error: syntax error before `*' token
lua.h:111: error: syntax error before `void'
lua.h:112: error: syntax error before `*' token
lua.h:114: error: syntax error before `(' token
lua.h:120: error: syntax error before `int'
lua.h:121: error: syntax error before `void'
lua.h:122: error: syntax error before `void'
lua.h:123: error: syntax error before `void'
lua.h:124: error: syntax error before `void'
lua.h:125: error: syntax error before `void'
lua.h:126: error: syntax error before `int'
lua.h:128: error: syntax error before `void'
lua.h:135: error: syntax error before `int'
lua.h:136: error: syntax error before `int'
Just just a couple errors.
Here's lua.h 99
/* type of numbers in Lua */
typedef LUA_NUMBER lua_Number;
| Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #6 on Sat 01 Mar 2008 08:54 PM (UTC) |
Message
| |
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Reply #7 on Sat 01 Mar 2008 08:57 PM (UTC) |
Message
| Had to change #include <luaconf.h> to "luaconf.h"
had to do that in a few other places as well. | Top |
|
Posted by
| Orik
USA (182 posts) Bio
|
Date
| Reply #8 on Sat 01 Mar 2008 08:59 PM (UTC) |
Message
| how do i save my makefile to a txt file?
I know it was something like this:
make > make.txt | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #9 on Sat 01 Mar 2008 09:48 PM (UTC) |
Message
| |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
29,519 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top