CivilizationAce
Warlord
- Joined
- Jan 17, 2017
- Messages
- 240
I'm trying to test lua through the console, but I can't even seem to get the simplest stuff to work. Right now I'm trying the following
I get the error message
I'd ask about Players or about GetName, but I can't ask about all the specific stuff that I need — we'd be here all day.
Instead I wonder if there's some generic flaw in my approach, like do I need to prefix Players with something, because almost whatever I do I get the "attempt to index a nil value" error.
I also wonder if there's a Civ VI (rather than V) lua reference.
Also is there a help command from Lua Console to query command syntax?
Code:
print(Players[0]:GetName())
I get the error message
Code:
Runtime Error: [string "_cmdr = {print(Players[0]:GetName())}"]:1: attempt to index a nil value
stack traceback:
[string "_cmdr = {print(Players[0]:GetName())}"]:1: in function '(main chunk)'
Lua callstack:
Instead I wonder if there's some generic flaw in my approach, like do I need to prefix Players with something, because almost whatever I do I get the "attempt to index a nil value" error.
I also wonder if there's a Civ VI (rather than V) lua reference.
Also is there a help command from Lua Console to query command syntax?
Last edited: