Unit Control

by Klonan

Control of Units

Utilities
2 years ago
0.17 - 1.1
26.7K
Combat

b Possible conflict with DiscoScience

5 years ago

Hey Klonan,

Some users of DiscoScience seem to be encountering an issue when using it with Unit Control: DiscoScience attempts to address an animation that no longer exists (https://mods.factorio.com/mod/DiscoScience/discussion/5cbb4f6b5862c4000def4399). I've looked through my code and I'm having trouble seeing any way it could get into this situation without something else destroying the animation. However, I gave your code a cursory look as well and couldn't see anything that would cause it to destroy any effects it didn't own.

I have a feeling you know more about how this works than I do, though. Could you double-check that you're not destroying animations created by DiscoScience?

Thanks,
Daniel

5 years ago

Hi, I clear all the rendering objects as part of a migration

I would say, its a dick move on my part, but its also something any script of mod can call at any time

I think its better to write your mod in a safer way, such that it checks if the rendering object is valid before attempting to call any method on it, just like you would do if storing entity references.

5 years ago

Cheers, thanks!

5 years ago

Just FYI, I'm still displaying an error message when DiscoScience encounters animations that have been deleted out from under it. Given that rendering.clear() even supports only clearing objects belonging to your mod, you should probably use that:

https://lua-api.factorio.com/latest/LuaRendering.html#LuaRendering.clear

4 years ago

Ok, I will change it to only clear my own objects

New response