Search found 129 matches
- Sun Oct 20, 2019 11:15 am
- Forum: Implemented mod requests
- Topic: ChooseElemButton EntityType/s
- Replies: 4
- Views: 1733
Re: ChooseElemButton EntityType/s
I was thinking of requesting/implementing something like this, but I was thinking of using the new prototype filter system so you have more control than just "type = X".
- Fri Oct 18, 2019 1:20 pm
- Forum: Implemented mod requests
- Topic: Creation of separate random generators
- Replies: 7
- Views: 1957
Re: Creation of separate random generators
You can always combine the ints yourself, similar to standard methods of computing hashcodes. From a quick google, something like: local seed = 7 seed = seed * 31 + map_seed seed = seed * 31 + chunkX seed = seed * 31 + chunkY Although since lua numbers are doubles, you may need to modulo it to preve...
- Wed Oct 02, 2019 2:59 am
- Forum: Minor issues
- Topic: [0.17.69] table_to_json outputs inf, which is invalid json
- Replies: 2
- Views: 1439
[0.17.69] table_to_json outputs inf, which is invalid json
The following command will output invalid json: /c game.print(game.table_to_json({math.huge})) Will output: [inf] According to some quick googling, json doesn't support infinity, negative infinity, nor nan. Possible solutions: Error if it encounters any of these values, but that would mean we'd have...
- Sun Sep 29, 2019 9:01 pm
- Forum: Minor issues
- Topic: [0.17.69] Can assign values to LuaRemote and possibly others
- Replies: 3
- Views: 1043
- Sun Sep 29, 2019 5:43 pm
- Forum: Minor issues
- Topic: [0.17.69] Can assign values to LuaRemote and possibly others
- Replies: 3
- Views: 1043
[0.17.69] Can assign values to LuaRemote and possibly others
I just found that you can assign variables to LuaRemote and possibly others.
Code: Select all
/c remote.potato = 4 --no error
/c game.print(remote.potato) --prints 4
- Fri Sep 20, 2019 6:24 pm
- Forum: Already exists
- Topic: LuaTechnology.level is not consistent
- Replies: 20
- Views: 7145
Re: LuaTechnology.level is not consistent
Pro tip: more text is bad.
- Wed Sep 18, 2019 5:04 am
- Forum: Modding interface requests
- Topic: LuaRendering and LuaPlayer Limitations
- Replies: 4
- Views: 1317
Re: LuaRendering and LuaPlayer Limitations
Please can you make draw_sprite have the option to also be able to scale_with_zoom - i feel this has been missed? As far as I know there's no technical reason this couldn't be done, the problem is as soon as it would be made, people will be requesting ways to position objects relative to each other...
- Sat Sep 14, 2019 10:26 pm
- Forum: Modding interface requests
- Topic: Define for prototype-type tree
- Replies: 0
- Views: 588
Define for prototype-type tree
In the data stage, I often need to find an entity or item by name in data.raw. As it can be of any type (eg. item, ammo, capsule, etc) I have to search through several different types in order to find it. I made a table and a helper function to make this easier: local ItemPrototypeTypes = { ["i...
- Sat Sep 14, 2019 8:59 pm
- Forum: Won't implement
- Topic: LuaSurface.clone_entities should return the created entities
- Replies: 2
- Views: 1078
- Thu Sep 12, 2019 5:12 am
- Forum: Implemented mod requests
- Topic: Include captured entity's unit_number in blueprint entity data
- Replies: 30
- Views: 5696
Re: Include captured entity's unit_number in blueprint entity data
That sounds pretty helpful. But how would extensions work? For example mod A sets tag foo="bla" and a related mod B want's to extend that to foo="bla1" or foo="bla2" depending on other factors. Would all mods share an entity.tags namespace so they can freely overwrite ...
- Wed Sep 11, 2019 6:51 pm
- Forum: Implemented mod requests
- Topic: Include captured entity's unit_number in blueprint entity data
- Replies: 30
- Views: 5696
Re: Include captured entity's unit_number in blueprint entity data
Mods would still need the unit_numer of entities to associate custom data into the blueprints though. And if you store all the data in global... how would that work with im/exporting blueprint strings? (Maybe i'm not fully understanding what you're suggesting.) No, the system from lua would be tran...
- Wed Sep 11, 2019 2:53 pm
- Forum: Implemented mod requests
- Topic: Include captured entity's unit_number in blueprint entity data
- Replies: 30
- Views: 5696
Re: Include captured entity's unit_number in blueprint entity data
Would it really be so much worse than keeping the same data in lua like we all do now? Yes. At the moment, if no mods are installed, there is 0 memory overhead. With tags as a property of all entities, every entity would have to have at least an 8 byte pointer, even though nothing would use it unle...
- Tue Sep 10, 2019 7:38 pm
- Forum: Modding interface requests
- Topic: Allow for penalty change in modded rail signal
- Replies: 3
- Views: 1633
Re: Allow for penalty change in modded rail signal
I think you can already do this with utility_constants.train_path_finding.train_arriving_to_signal_penalty or maybe one of the other variables in that table. You might have to do some digging to find out how each one is used, as the documentation on the wiki is a little lacking, but i'm pretty sure ...
- Thu Aug 29, 2019 1:55 pm
- Forum: Implemented mod requests
- Topic: Move doc's class description to top of page
- Replies: 7
- Views: 1962
Re: Move doc's class description to top of page
I think it would be better to have the description above the "sort" button on the class pages, and keep the concepts page as it is now. You can still read the description of the concepts if you click on the link to the concept.
- Tue Aug 27, 2019 1:52 pm
- Forum: Implemented mod requests
- Topic: Move doc's class description to top of page
- Replies: 7
- Views: 1962
Re: Move doc's class description to top of page
I don't like that its below the "class LuaItemStack - sort" text. Can that get changed real quick or should I make another interface request?
- Thu Aug 22, 2019 3:27 pm
- Forum: Implemented mod requests
- Topic: Move doc's class description to top of page
- Replies: 7
- Views: 1962
Move doc's class description to top of page
Lots of new modders don't see the class descriptions. It doesn't matter too much for most classes, but for things like LuaItemStack it's quite important to read. It should really be at the very top of the page, so that you see it immediately. At the moment its under the summary of functions/variable...
- Wed Aug 14, 2019 8:22 pm
- Forum: Modding interface requests
- Topic: Add ability to draw_animation to stop on last frame
- Replies: 6
- Views: 1731
Re: Add ability to draw_animation to stop on last frame
Something like this would be pretty easy to add, it just isn't a high priority. Your use case is very specific and pretty hacky, plus the devs are going for stable at the moment so they are more hesitant to implement new features. I recommend trying to find another solution for your issue for now, t...
- Sat Jul 27, 2019 5:23 pm
- Forum: Modding interface requests
- Topic: Oposite of util.parse_energy(energy)
- Replies: 3
- Views: 1428
Re: Oposite of util.parse_energy(energy)
The code can be optimized a bunch. There's no reason to create the lookup table every time you call the function, and the while loop can be flattened using logarithms I believe.
- Wed Jul 24, 2019 10:49 pm
- Forum: Modding interface requests
- Topic: Make maximum_wire_distance optional when placing wire in script
- Replies: 6
- Views: 1602
Re: Make maximum_wire_distance optional when placing wire in script
That means you were trying to teleport it between surfaces. Wires most likely can't go between surfaces.TheFunnySide wrote: ↑Wed Jul 24, 2019 10:03 pmedit: "Surface teleport can only be done for players at the moment."
I think it errors if you give any surface into the function call, even if its already on that surface.
- Tue Jul 23, 2019 8:24 pm
- Forum: Modding interface requests
- Topic: Force event and lookup consistency
- Replies: 6
- Views: 1369
Re: Force event and lookup consistency
(like creation of surface in on_init of some mod.. maybe if it runs before your mod). As explained in the Data Lifecycle page of the API, under "4. control.lua init": Note: until on_init has finished executing for a given mod (scenario scripts are also counted as a mod) the game will not ...