Search found 10 matches
- Thu May 26, 2016 12:49 am
- Forum: Modding help
- Topic: Is it possible to get a player's key events?
- Replies: 1
- Views: 630
Is it possible to get a player's key events?
I'm making a GUI tool, and I'd love it if I could respond to two things: The user pressing a key to show/hide the GUI, and the user pressing enter on a textbox. Is it possible to get the user's keypresses? Hopefully as an event? And also, is it possible to find out if the user pressed enter on a tex...
- Wed May 18, 2016 9:53 pm
- Forum: Modding help
- Topic: In on_load, 'game' is nil, only if mod is called 'bluMisc'.
- Replies: 4
- Views: 1522
Re: In on_load, 'game' is nil, only if mod is called 'bluMisc'.
"game" is always nil on_load by design because you're not meant to do anything with it on_load. There are only 2 things meant to be done on_load: 1. Re-register event handlers (if you do conditional event registration) 2. Re-setup meta-tables (if you use meta-tables) Other than those 2 th...
- Wed May 18, 2016 9:39 pm
- Forum: Modding help
- Topic: In on_load, 'game' is nil, only if mod is called 'bluMisc'.
- Replies: 4
- Views: 1522
In on_load, 'game' is nil, only if mod is called 'bluMisc'.
So this is a really weird problem. -- bluMisc_0.1.0/info.json { "name": "bluMisc", "version":"0.1.0", "title":"", "description":"", "author":"", "contact":"" } -- bluMisc_0.1.0/con...
- Wed May 18, 2016 10:01 am
- Forum: Modding help
- Topic: Feasibility Question - Mod to control assembler output?
- Replies: 14
- Views: 4384
Re: Feasibility Question - Mod to control assembler output?
It seems that this function does exactly the thing you are looking for: LuaEntity.set_circuit_condition You know, I'd completely dismissed that little function because it looked like you could only use it to set the conditions on things like decider combinators and arithmetic combinators. I complet...
- Wed May 18, 2016 9:18 am
- Forum: Modding help
- Topic: Feasibility Question - Mod to control assembler output?
- Replies: 14
- Views: 4384
Re: Feasibility Question - Mod to control assembler output?
Wow, sorry. I didn't expect to run into an actual developer. You guys are really active on the forums. :( I was mostly trying to answer the question based on what I knew from reading the official API docs, but I was also venting a lot of frustration at how limited it all feels. For example, I was ho...
- Wed May 18, 2016 6:01 am
- Forum: Modding help
- Topic: Apparently 'game' and 'script' are nil.
- Replies: 3
- Views: 1393
Re: Apparently 'game' and 'script' are nil.
You are running the control.lua in the data phase, when there is no game/player. Just delete the require 'control' from data.lua, control.lua is loaded automatically when a game loads/initializes. Interesting! Thanks. :) So does any .lua file in the top-level directory of a mod folder get automatic...
- Wed May 18, 2016 5:38 am
- Forum: Modding help
- Topic: Feasibility Question - Mod to control assembler output?
- Replies: 14
- Views: 4384
Re: Feasibility Question - Mod to control assembler output?
From what I've read so far, Factorio modding is extremely basic and crude right now. It's really just a bare-bones framework to be (hopefully?) extended later. Either that or the documentation is just missing a huge chunk of information. At the moment, it's not possible to read anything from a circu...
- Wed May 18, 2016 3:23 am
- Forum: Modding help
- Topic: Apparently 'game' and 'script' are nil.
- Replies: 3
- Views: 1393
Apparently 'game' and 'script' are nil.
What's going on? This is exasperating.
Code: Select all
-- data.lua
require 'control'
Code: Select all
-- control.lua
print(game.local_player)
Code: Select all
__factorio-mod-template__/data.lua:1: __factorio-mod-template__/control.lua:1: attempt to index global 'game' (a nil value)
- Sun May 15, 2016 9:51 am
- Forum: Modding help
- Topic: How do I interact with a circuit network?
- Replies: 3
- Views: 1223
Re: How do I interact with a circuit network?
The circuit network doesn't operate in a way that you could do this without an entity. All of the contents of the circuit network are based off entities inputting those numbers each game tick. Without the entity there's no number so you can't "send a number" into the circuit network and e...
- Sun May 15, 2016 6:30 am
- Forum: Modding help
- Topic: How do I interact with a circuit network?
- Replies: 3
- Views: 1223
How do I interact with a circuit network?
I've been looking around the wiki and the API documentation, and even Googling but I can't find an answer to this. What I want to do is create an entity that has read/write access to the circuit network(s) it's hooked up to. And not just in a combinator sort of way where it can only do a limited num...