Search found 129 matches

by Boodals
Sun Oct 20, 2019 11:15 am
Forum: Implemented mod requests
Topic: ChooseElemButton EntityType/s
Replies: 4
Views: 629

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".
by Boodals
Fri Oct 18, 2019 1:20 pm
Forum: Implemented mod requests
Topic: Creation of separate random generators
Replies: 7
Views: 864

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...
by Boodals
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: 775

[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...
by Boodals
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: 424

Re: [0.17.69] Can assign values to LuaRemote and possibly others

Klonan wrote:
Sun Sep 29, 2019 8:04 pm
So what does this break?
The rule that you cant modify LuaObjects other than their explicit properties? idk
You could ask the opposite question about LuaObjects that don't allow setting random variables.
by Boodals
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: 424

[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
by Boodals
Fri Sep 20, 2019 6:24 pm
Forum: Already exists
Topic: LuaTechnology.level is not consistent
Replies: 20
Views: 2594

Re: LuaTechnology.level is not consistent

Pro tip: more text is bad.
by Boodals
Wed Sep 18, 2019 5:04 am
Forum: Modding interface requests
Topic: LuaRendering and LuaPlayer Limitations
Replies: 4
Views: 434

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...
by Boodals
Sat Sep 14, 2019 10:26 pm
Forum: Modding interface requests
Topic: Define for prototype-type tree
Replies: 0
Views: 265

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...
by Boodals
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: 1939

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 ...
by Boodals
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: 1939

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...
by Boodals
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: 1939

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...
by Boodals
Tue Sep 10, 2019 7:38 pm
Forum: Modding interface requests
Topic: Allow for penalty change in modded rail signal
Replies: 3
Views: 627

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 ...
by Boodals
Thu Aug 29, 2019 1:55 pm
Forum: Implemented mod requests
Topic: Move doc's class description to top of page
Replies: 7
Views: 834

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.
Image
by Boodals
Tue Aug 27, 2019 1:52 pm
Forum: Implemented mod requests
Topic: Move doc's class description to top of page
Replies: 7
Views: 834

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?
by Boodals
Thu Aug 22, 2019 3:27 pm
Forum: Implemented mod requests
Topic: Move doc's class description to top of page
Replies: 7
Views: 834

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...
by Boodals
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: 608

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...
by Boodals
Sat Jul 27, 2019 5:23 pm
Forum: Modding interface requests
Topic: Oposite of util.parse_energy(energy)
Replies: 3
Views: 380

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.
by Boodals
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: 651

Re: Make maximum_wire_distance optional when placing wire in script

TheFunnySide wrote:
Wed Jul 24, 2019 10:03 pm
edit: "Surface teleport can only be done for players at the moment."
That means you were trying to teleport it between surfaces. Wires most likely can't go between surfaces.
I think it errors if you give any surface into the function call, even if its already on that surface.
by Boodals
Tue Jul 23, 2019 8:24 pm
Forum: Modding interface requests
Topic: Force event and lookup consistency
Replies: 6
Views: 561

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 ...

Go to advanced search