Does anyone have the/a link for a Standalone Lua Interpreter? And how does it work? I’ve been using the Garry’s Mod console for a while and that takes too long to make a script, start up Garry’s Mod, start up single player, and THEN I’m ready to load scripts. Thanks and many hearts to whoever posts a valid working link and a detailed explanation first /
Run GMod in windowed mode. Test script, alt+tab, alter code, alt+tab, lua_openscript
Easy
Firefox says http://luaforwindows.luaforge.net/ is an invalid website.
I’m just looking for a way to test scripts quick and easy without Garry’s Mod.
[editline]04:00PM[/editline]
I DO have Garry’s Mod, but I’m kind of bored with it lately.
Mind you, Garry’s Mod Lua is a bit different than regular Lua in various ways I can’t be arsed to remember.
Garry added !, !=, &&, &, ||, |, //, /* and */. If you don’t use them, it doesn’t matter.
I’m doing Msg(“Hello World”) and i get input:1: attempt to call global ‘Print’ (a nil value) lol
[editline]05:01PM[/editline]
I think it’s final to say I’m failing
[editline]05:07PM[/editline]
is Msg() a Garry’s Mod only function?
input:2: attempt to call global ‘Msg’ (a nil value)
Lua doesn’t have support for bitwise?
print()
ok thank you
I forgot Lua was case sensitive lol, I was using Print() instead of print()
I’m not sure. What I’m looking for is a way to test my scripts without using Garry’s Mod.
So far this (http://www.lua.org/cgi-bin/demo) is pretty good. the msg() and Msg() don’t work, but I’m trying to manually create it :haw:
[lua]
myname=cubbeh
function msg(text)
if msg() then
print(text)
end
end
msg(“text”)
[/lua]
I get this error, lol
input:3: stack overflow
I don’t know what a stack overflow is :downs:
For no good reason, yes.
[editline]06:27PM[/editline]
You’re recursively calling msg().
Why?
In the Lua demo thing I’m using, input:1: attempt to call global ‘Msg’ (a nil value).
input:1: attempt to call global ‘msg’ (a nil value)
So I tried to recreate it using print() and it didn’t go well due to my limited knowledge of normal Lua.
Any ideas? :keke:
Finally I can test my scripts in real time and fix errors I never figured out before easily
[lua]
function boyage()
print("I am "…ageboy…"years old!
")
end
ageboy=10
function girlage()
print(“My brother is “…ageboy…” years old and I am “…agegirl…” years old!”)
end
agegirl=11
boyage()
girlage()
[/lua]
Thanks NullPoint, that is basically exactly what I was looking for.
Uh.
Go learn Lua?
You really have no idea what you’re doing judging by that, so actually learning Lua is probably a good thing to do before you do anything else.
I know Lua when I’m doing it for Garry’s Mod, but not when I’m doing it NORMALLY.
Uhh…
Gmod Lua IS normal Lua, with a few extra functions added it (ok quite alot) and some extra operators. In order to know Gmod Lua you must first know normal Lua.
I know how to do normal things in GMod but not normal things because I learned Gmod lua by looking at other files and editing them until I understood what certain things did.
This is why it’s better to learn Lua first, not Lua + Gmod Lua at the same time. I suppose it’s good that you’re practising normal Lua before going onto more complex GLua scripts.