[1.1.36]when logistic-robot crash,triggers nothing.

Place to get help with not working mods / modding interface.
Post Reply
meifray
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat May 29, 2021 6:12 pm
Contact:

[1.1.36]when logistic-robot crash,triggers nothing.

Post by meifray »

I make logistic can crash:

Code: Select all

for _,e in pairs(data.raw["logistic-robot"]) do
	e.loot=
	{
		{
		count_max = 1,
		count_min = 1,
		item = "logistic-robot",
		probability = 1
		}
	}
	e.minable.result="logistic-robot";
	e.min_to_charge=0;
	e.max_to_charge=0;
	e.speed_multiplier_when_out_of_energy=0;
	e.dying_trigger_effect=data.raw["ammo-turret"]["gun-turret"].dying_trigger_effect;
	e.destroy_action=data.raw["combat-robot"]["defender"].destroy_action;
end
and trying to capture the death from control phase

Code: Select all

script.on_event(defines.events.on_combat_robot_expired,function(event) game.print{"",event.robot.name," expired."}end);
script.on_event(defines.events.script_raised_destroy,function(event) game.print{"",event.entity.name," dies."}end);
script.on_event(defines.events.on_entity_died,function(event) game.print{"",event.entity.name," died."}end);
but it doesnt work,
and I observed the roboport count,it works normal,when these bot disappear,it also count down the robot count.

and I try to use this command

Code: Select all

/c game.print(#game.surfaces[1].find_entities_filtered{type="logistic-robot"});
it seems these littl bot are just gone.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4893
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [1.1.36]when logistic-robot crash,triggers nothing.

Post by Klonan »

I am going to move this to modding help

There are many ways and many ways to go wrong when hooking events and using your own scripting,
It would be best if you can just post the whole mod/script instead of cherry picked snippets

User avatar
Silari
Fast Inserter
Fast Inserter
Posts: 175
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: [1.1.36]when logistic-robot crash,triggers nothing.

Post by Silari »

Klonan wrote:
Wed Jul 21, 2021 7:53 am
I am going to move this to modding help

There are many ways and many ways to go wrong when hooking events and using your own scripting,
It would be best if you can just post the whole mod/script instead of cherry picked snippets
From testing it myself it doesn't seem like any event fires when a logistic robot dies from charge running out. It might be intentional that on_combat_robot_expired doesn't (though also likely no one really though about using the 0 uncharged speed for logi/con robots and thus it wasn't a decision so much as no one thinking they needed it), but not calling on_entity_died or on_entity_destroyed either seems to be a bug?

If you think it's worth reporting I can throw together a small mod + save that shows nothing is getting called and make a thread for it.

meifray
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sat May 29, 2021 6:12 pm
Contact:

Re: [1.1.36]when logistic-robot crash,triggers nothing.

Post by meifray »

that will be nice

Post Reply

Return to “Modding help”