*facepalm* I think you need to learn a lot more one how coding and syntax works.
[lua]
--This is where the primary game code goes
run = true
Lout( "As you awake in the small house,a man asks you for some change.\n Give it to him?\n" )
Lout( "--Y or N--" )
while (run) do
Lout( ">" )
cmd = Lin()
Lout( "Result: "..cmd.."\n" )
if (cmd == "y" or cmd == "Y") then
Lout( "Man: FUCK YES! WOo")
end
if (cmd == "n" or cmd == "N") then
Lout( "The man punches you in the balls, takes your wallet, and runs away.")
Lout( "You:Why the fuck was that guy in this house? Better yet why am I in this house?" )
end
if (cmd == "quit") then
run = false
end
end
[/lua]
Futhermore, I recommend this not be the structure you follow.
Sorry, I just didn't understand the "if (cmd ==)" part
Thanks for helping :)
[QUOTE=grea$emonkey;19232009]No, it is being compiled. On server start, everything is being compiled. Do you have any idea how expensive it would be to be reinterpreting a lua file into binary every server tick? This is why when the game/server starts, the files are interpreted [i]and[/i] compiled into C++(I think... maybe it's C).[/QUOTE]
I'd like to just point out that lua is [b]interpreted[/b]. It is [b]compiled[/b] into [b]bytecode[/b] which is then [b]translated[/b] to actual operations by the interpreter (lua is not considered compiled because bytecode is not executable by itself, it needs to be interpreted by the interpreter :P).
While the text is being translated to bytecode, this isn't considered a true compilation phase.
And now we know.
[I]And knowing is only half the battle.[/I]
[editline]11:31PM[/editline]
I have 63 lines of code so far for my game :D
Just hit 97 lines guys, thanks so much for the help! My game is turning out AWESOME.
Special thanks to Anthoni_c for the program :)
[QUOTE=Chad Mobile;19268607]Just hit 97 lines guys, thanks so much for the help! My game is turning out AWESOME.
Special thanks to Anthoni_c for the program :)[/QUOTE]
I'm glad you're optimistic.
plz no rate me gaybow :keke:
[editline]06:19AM[/editline]
shit that was fast
No Problem. I was mainly using it as a learning experience though. I had not known how to bind Lua previously.
[QUOTE=Chad Mobile;19204311]I'm trying to remember the name for those games that you played in the black box, all text.[/QUOTE]
Multi user dungeon.
Zork and Lord of the Rings are the two Text games I remember.
Heh, I remember a long time ago playing these kinds of games when my graphics card was broken or something.
Also, Anthoni, you don't mind if I release the game someday do you?
Why would I mind? Did you read the license? It's Creative Commons Attribution. You can release the game even for sale.
Wow, thanks!
i gotta try this engine! :razz:
It's good. I'm pretty far into my game. I'm adding a wallet and a bank account.
Is it just a Lua console with cin and cout implemented in Lua as Lin and Lout?
I'm just mainly using stuff like
[lua]
if (cmd == "test") then
Lout("PRINTING STUFF")
end
[/lua]
Lout prints to the screen but I tested with print() and it works too.
I just made a Lua interface library for c++ very similar to the one used to make Lua binary modules for Garrysmod (ILuaInterface and ILuaObject). I'm going to test if it works correctly by making a Lua console, are there any features, such as Lin and Lout that you think I should implement?
use Lout() for sure.
- snip because i didn't scroll up >.> -
Yeah, Null it wasn't difficult at all to build, but it's not just the Lua console, I would have no point to build that. This is more like a scripted Console. I just made it for Chad since he couldn't do it himself. I was thinking of updating it with a proper text-game engine, but I decided to move onto another project.
[QUOTE=Anthoni_c;19331655]This is more like a scripted Console.[/QUOTE]
What do you mean?
it's like the gmod console, but not in gmod. and you chose what goes in it.
I've got my own game going already.
Does anybody know how to make it play a music file?
I'm gonna try to make it play the ShadowGate death music when you die, because it's epic.
[QUOTE=ZenX2;19331991]it's like the gmod console, but not in gmod. and you chose what goes in it.[/QUOTE]
Right, that's exactly what I was talking about when I said I was going to make a Lua console...
[editline]09:39PM[/editline]
In fact, what you have created is nothing like what I was going to make.
[editline]10:07PM[/editline]
Can I just ask why you have linked against lua5.1.dll [b]AND[/b] lua51.dll? What's the difference between the two?
i dont think i can make a good inventory system due to the fact that this is really linear...
Make one in Garrysmod Lua, then you can make a gui for it as well.
[QUOTE=Chad Mobile;19204159]Lua IS a REAL programming language, but it is a light weight programming language.
How is making a game in the console useless? It's like a DOS box game, where it's all text.[/QUOTE]
Correction; Lua is a scripting language.
C++ is a programming language.
[QUOTE=Racid;19334668]Correction; Lua is a scripting language.
C++ is a programming language.[/QUOTE]
The first line of the Lua 5.1 reference manual:
"Lua is an extension programming language".
[editline]11:32PM[/editline]
Extension programming language == scripting language.
Actually, why didn't you just static link it?
Happy new year! :v:
[editline]12:29AM[/editline]
It was new year about half an hour ago, but I was looking after my cat, she is shit scared of fireworks.
Sorry, you need to Log In to post a reply to this thread.