Search found 582 matches

by Reika
Wed Jul 19, 2017 4:31 am
Forum: Mod portal Discussion
Topic: "Failed to read info.json" on uploaded, yet functional mod
Replies: 22
Views: 8111

Re: "Failed to read info.json" on uploaded, yet functional mod

The zip is read using https://docs.python.org/3.5/library/zipfile.html . If you provide examples of a broken zip, I can take a look. Here are a whole bunch - my entire set of mods. All of them were built just now using method 2 (the second non-working one) in the above post (so selected because it ...
by Reika
Tue Jul 18, 2017 5:27 am
Forum: Won't implement
Topic: "Chunk updates pollution" event
Replies: 9
Views: 2742

Re: "Chunk updates pollution" event

If you don't have to do something to EVERY chunk EVERY tick, you can scan over all chunks, but stop after you've scanned X, and next tick pick up starting at the next chunk over. That way performance penalty is spread evenly over all ticks, and does not increase in proportion to number of chunks ge...
by Reika
Tue Jul 18, 2017 2:52 am
Forum: Mod portal Discussion
Topic: "Failed to read info.json" on uploaded, yet functional mod
Replies: 22
Views: 8111

Re: "Failed to read info.json" on uploaded, yet functional mod

Well, I learned something: The actual code used to compile the zips matters too, and seems to be the deciding factor. In particular, however WinRAR does it always works. Editing the contents of a jar/zip actually repack the whole thing using WinRAR's encoding, which the portal can accept. My custom ...
by Reika
Tue Jul 18, 2017 2:19 am
Forum: Won't implement
Topic: "Chunk updates pollution" event
Replies: 9
Views: 2742

Re: "Chunk updates pollution" event

What does access to the event give you that iterating over the chunks once a second does not? I want to do something similar to Minecraft's block ticks. Iterating over the entire world is far too expensive to ever do all at once, even once per second, resulting in a noticeable lag spike every time ...
by Reika
Tue Jul 18, 2017 2:14 am
Forum: Mod portal Discussion
Topic: "Failed to read info.json" on uploaded, yet functional mod
Replies: 22
Views: 8111

"Failed to read info.json" on uploaded, yet functional mod

I sometimes get an issue when uploading a mod to the portal, telling me that it could not read the info.json file. In particular, I have noticed the following: *How the mod zip is compiled matters; ones compiled with WinRAR have the greatest rate of success *Editing the zip in an attempt to 'fix' th...
by Reika
Tue Jul 18, 2017 2:01 am
Forum: Won't implement
Topic: "Chunk updates pollution" event
Replies: 9
Views: 2742

Re: "Chunk updates pollution" event

This is another one of the events we never made because of how frequently it would be called (100-200 times/tick or more). 200 times a tick!? I thought chunks only updated their pollution once a second. EDIT: By "Update" I mean the spread/absorption behavior, not any time the data is acce...
by Reika
Sun Jul 16, 2017 8:30 pm
Forum: Won't implement
Topic: "Chunk updates pollution" event
Replies: 9
Views: 2742

"Chunk updates pollution" event

As per viewtopic.php?f=28&t=50178&p=292472#p292472 , which was never responded to.
by Reika
Sun Jul 16, 2017 8:29 pm
Forum: Won't implement
Topic: Make surface.spill_items return item entities
Replies: 4
Views: 1454

Re: Make surface.spill_items return item entities

Rseding91 wrote:Do you really want the items or do you just want a parameter you can use to auto-mark them for deconstruction?
The former would be more generally useful.
by Reika
Sun Jul 16, 2017 8:28 pm
Forum: Modding help
Topic: Accessing [RW] fluid-turret fluid buffer via scripting?
Replies: 1
Views: 973

Accessing [RW] fluid-turret fluid buffer via scripting?

My turret range upgrade research - the one that replaces turrets in-situ with a range-boosted version - should keep the ammo/power/fluids of a turret when replaced. However, flamethrower turrets are posing something of a problem. Their lua-script 'fluidbox' parameter on the LuaEntity only offers one...
by Reika
Sun Jul 16, 2017 5:00 am
Forum: Modding help
Topic: Is there an event type for on simulation start?
Replies: 3
Views: 1703

Re: Is there an event type for on simulation start?

Haven't tried, but I believe this should work: script.on_init(function() game.map_settings.enemy_evolution.destroy_factor = 1 end) on_init(f) Register a callback to be run on mod init. This is called once when a new save game is created or once when a save file is loaded that previously didn't cont...
by Reika
Sun Jul 16, 2017 4:53 am
Forum: Implemented mod requests
Topic: events.on_damage
Replies: 2
Views: 1316

Re: events.on_damage

darkfrei wrote:Hi all!

Here was added damage event:

Code: Select all

Damaging a tree with impact or physical damage generates some leaves.
Is it possible to add this as API?
This is basically my request as well:

viewtopic.php?f=28&t=50177&p=291708#p291638
by Reika
Fri Jul 14, 2017 2:11 am
Forum: Modding help
Topic: Automatically generating localized names
Replies: 4
Views: 1079

Re: Automatically generating localized names

Nexela wrote:In locale.cfg

Code: Select all

[turrets]
upgrade=__1__ range_boost __2__
in data*.lua

Code: Select all

myturret.localised_name = {"turrets.upgrade", {"entity-name."..turret_name_from_loop}, level}
What will that parse into?
by Reika
Thu Jul 13, 2017 9:57 pm
Forum: Modding help
Topic: Automatically generating localized names
Replies: 4
Views: 1079

Automatically generating localized names

I have a research that adds turret range upgrades, but to do this it has to effectively clone turrets once per turret type, once per level. This all works fine, but the problem is that the upgraded turrets (internally named [original name]-rangeboost-[level]") have no corresponding localization...
by Reika
Tue Jul 11, 2017 3:08 am
Forum: Won't implement
Topic: Make surface.spill_items return item entities
Replies: 4
Views: 1454

Make surface.spill_items return item entities

It would be very convenient if the item drop function returned the item drops, so that you could, for example, mark them for deconstruction automatically without having to then search for entities pointlessly.
by Reika
Wed Jun 28, 2017 7:56 am
Forum: Implemented mod requests
Topic: "Get random chunk" from Surface
Replies: 13
Views: 3939

Re: "Get random chunk" from Surface

Would that be feasible?
by Reika
Sun Jun 25, 2017 11:45 pm
Forum: Implemented mod requests
Topic: "Get random chunk" from Surface
Replies: 13
Views: 3939

Re: "Get random chunk" from Surface

Rseding91 wrote:
Reika wrote:OK...is there any way at all to give the API the ability to performantly pick random in-world positions?
No.
In which case let me transform this request into an event for "on chunk updates pollution".
by Reika
Sun Jun 25, 2017 8:05 pm
Forum: Implemented mod requests
Topic: "Get random chunk" from Surface
Replies: 13
Views: 3939

Re: "Get random chunk" from Surface

The game can access any given chunk in O(1) time but doesn't know the total-set of chunks that exist without iterating the container that may or may not hold chunks for the given position in it. That virtually never happens in the normal game because O(1) access time is far better than iterating. O...
by Reika
Sun Jun 25, 2017 12:47 am
Forum: Implemented mod requests
Topic: "On entity attacked" event
Replies: 3
Views: 1571

Re: "On entity attacked" event

Rseding91 wrote:We talked about adding an on-attacked event in the past but it was decided against due to performance concerns.
Given the existence of on_tick, I am not sure this is worth concerning oneself with.
by Reika
Sun Jun 25, 2017 12:45 am
Forum: Implemented mod requests
Topic: "Get random chunk" from Surface
Replies: 13
Views: 3939

Re: "Get random chunk" from Surface

Random access into the chunk iterator would be iterating the chunk iterator to get the total count then iterating again to decide when to stop. What I'm trying to say is: there's no built-in way to "get a random chunk" without just "getting all chunks and pick a random one" whic...
by Reika
Sat Jun 24, 2017 6:54 pm
Forum: Modding help
Topic: Performant way to pick random positions in the world?
Replies: 8
Views: 2344

Re: Performant way to pick random positions in the world?

Optera wrote:
Reika wrote:
Optera wrote:Chances are pretty good if you argue like this that it'll be added to some future version.
Is there a location to request new API hooks and/or ping a developer?
There's an entire subforum for it
viewforum.php?f=28
Requested.

Go to advanced search