Page 1 of 1

New Lua Commands?

Posted: Wed Jul 22, 2015 5:13 pm
by Stickman
So, since 0.12 has some kind of change to command syntax, can we get the wiki updated?

There are a few commands that I'd like to play with but I don't know the new syntax to rework the old commands.

When I try the commands listed currently in the wiki, I get string errors like map doesn't contain 1 player, attempt to index field (a nil value), LuaGameScript doesn't contain key, etc.

Re: New Lua Commands?

Posted: Wed Jul 22, 2015 6:38 pm
by ratchetfreak
Stickman wrote:So, since 0.12 has some kind of change to command syntax, can we get the wiki updated?

There are a few commands that I'd like to play with but I don't know the new syntax to rework the old commands.

When I try the commands listed currently in the wiki, I get string errors like map doesn't contain 1 player, attempt to index field (a nil value), LuaGameScript doesn't contain key, etc.
I did a quick pass over them; which ones don't work?

Re: New Lua Commands?

Posted: Wed Jul 22, 2015 11:51 pm
by Stickman
All the ones I'm trying. I tried half a dozen of them and I get error messages with every single one.

Wasn't there a change to Lua syntax or something in that periods or dots in item names were changed to underscores or something?

Here's a screenshot of some of the commands I've tried and the failure messages.

http://i.imgur.com/WljqHOM.png

Re: New Lua Commands?

Posted: Wed Jul 22, 2015 11:57 pm
by ssilk

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:09 am
by Stickman
ratchetfreak wrote:I did a quick pass over them; which ones don't work?
Okay, so the kill_all_units works instead of kill_all_enemies.

I'll try some of the other commands I was goofing around with in a bit.

Thanks :mrgreen:

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:09 am
by ratchetfreak
Stickman wrote:All the ones I'm trying. I tried half a dozen of them and I get error messages with every single one.

Wasn't there a change to Lua syntax or something in that periods or dots in item names were changed to underscores or something?

Here's a screenshot of some of the commands I've tried and the failure messages.

http://i.imgur.com/WljqHOM.png
a word separator was added to the names. "peacefulmode" changed to "peaceful_mode". The dots stayed.

Some commands changed where they were like the killallenemies went to the force of enemies where you can kill all units of the force.

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:19 am
by Stickman
Okay, so I tried "/c game.player.selected.amount=7500" over a pump jack and also over the oil patch after removing the pump jack, but I can't get the oil patch to go back to 100%. Is this one broken or am I doing something wrong? I put my cursor right over the item so that the yellow outline popped up.

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:20 am
by Stickman
/c for n,t in pairs(game.player.force.technologies) do t.researched=t.enabled end

doesn't work either

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:24 am
by ssilk
Please can you continue in modding help? Thanks.

https://forums.factorio.com/forum/viewforum.php?f=25

Re: New Lua Commands?

Posted: Thu Jul 23, 2015 12:35 am
by Stickman
ssilk wrote:Please can you continue in modding help? Thanks.

https://forums.factorio.com/forum/viewforum.php?f=25
I don't know what you're asking me to do.

I'm not in to modding, I just want to see how commands work and what you can do with them.

Do you want me to create a thread there? Can't you just move this well-established thread?