[Rseding91] Crash when throwing grenades at transport belts

This subforum contains all the issues which we already resolved.
Post Reply
swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

[Rseding91] Crash when throwing grenades at transport belts

Post by swni »


EDIT. Ignore this message, see my reply with better information.


I wrote some scripting code that creates an explosive mess whenever a filter inserter is built... my code is similar to the following: (if there's a better way, let me know)

Code: Select all

local function check_for_filters(event)
    local e = event.created_entity
    if e.name == "filter-inserter" or e.name == "stack-filter-inserter" then
        local surface = e.surface
        local p = e.position

        e.health = 1
        surface.create_entity{
                name = 'cluster-grenade',
                position = p,
                target = e,
                speed = 0
            }
    end
end

script.on_event(defines.events.on_built_entity, check_for_filters)
script.on_event(defines.events.on_robot_built_entity, check_for_filters)
When I tried it out in game, it looked like it was working fine, and I was having a fun time making explosions everywhere when suddenly Factorio crashed as I placed an inserter. Log is attached.

As is suggested in the stack trace, some transport belts were being destroyed by the blasts, which might be relevant somehow.

I will experiment a bit further, and if I can figure out the exact conditions that are necessary to cause the crash, I will post with more information.

log: http://pastebin.com/Nk7qx7Tw
Attachments
factorio-current.log
(10.52 KiB) Downloaded 47 times
Last edited by swni on Sun Jul 03, 2016 3:37 am, edited 2 times in total.

swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Re: Crash when using scripting to spawn grenades

Post by swni »

I was able to reproduce the crash with no mods enabled and no scripting of any kind. I have attached a save ("crashtest.zip") and new log.

Load the save and fire two grenades at the spot show in the screenshot. The screenshot shows the last thing I see before Factorio crashes.

Image

v 0.13.3, by the way
Attachments
crashtest.zip
(22.55 MiB) Downloaded 49 times
factorio-current.log
(7.41 KiB) Downloaded 41 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13251
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] Crash when throwing grenades at transport belts

Post by Rseding91 »

Fixed for 0.13.4.
If you want to get ahold of me I'm almost always on Discord.

swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Re: [Rseding91] Crash when throwing grenades at transport belts

Post by swni »

Thanks! Fixed very fast! Can I ask if there are conditions I can avoid in 0.13.3 to make it less likely to get a crash? (I'm playing a large multiplayer game today that is likely going to have explosions next to transport belts and want to avoid crashes.) In any case I appreciate the fix!

swni
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Sat Mar 05, 2016 1:54 am
Contact:

Re: [Rseding91] Crash when throwing grenades at transport belts

Post by swni »

Never mind, I just noticed that 0.13.4 was released -- perfect timing! Though I'm still a bit curious about why the crash happens....

Post Reply

Return to “Resolved Problems and Bugs”