Hostile Trees


Makes trees hate you and your factory. They will do bad things to you and your factory.

Tweaks
5 months ago
1.1
257
Enemies Environment

b sometimes entities are destroyed without the "ghost"

1 year, 4 months ago

when I was testing the mod, I had a situation happen a couple of times when trees penetrated into my small outpost (a good question is how, although I saw trees multiplying in a “chain” throwing acid), and around then or when the Ents spawned, my turrets/walls disappeared without "ghost", and they could not be replaced by drones. I’m now trying to repeat this situation but it’s not working, in the new world the trees are somehow more passive, despite the fact that I set the timeout to 1 for attack timeouts, in general there is a feeling that the mod settings are not applied

1 year, 4 months ago

The settings thing is likely, I think right now I only reload mod stuff for backwards compatibility when mod version changes. I'll have to add another function for when just mod settings change. Could never reproduce trees being passive on newly made worlds, but ent spawning only happens when a minimal evolution level is reached, maybe that's it?

Considering the disappearing entities, I'm not sure. I have no code that would manually destroy buildings, it's all done by dealing damage. OTOH there is one rare event where a turret would be "subverted" to enemy side, that I assume would not create a ghost after destroying it since the turret is no longer "yours". No clue about walls though.

1 year, 4 months ago

you are right, I set the game to a very low speed and indeed, the turret after which there is no ghost left for some reason turns into an enemy force. There seems to be a misunderstanding about the walls, most likely I didn’t notice how I removed them myself or the like.

1 year, 4 months ago

Well it's intended behaviour, the evil forest has a chance to subvert your turret if there is a tree nearby. Dunno how to make it so that it leaves a ghost after being destroyed.

1 year, 4 months ago

I guess I could store an ID for it and react to an "entity died" event, so that's doable. Will add to TODOs.

1 year, 4 months ago

um, a quick search in the code did not indicate a single place where the force of the turrets can change, and in the deal_damage_to_player_entities function the entity is simply killed. It’s still a mystery to me why the turret suddenly switches sides.

1 year, 4 months ago

In tree_events.lua there's take_over_turret.

1 year, 4 months ago

You can try to save a list of such turrets and try to restore it during the on_entity_died, on_post_entity_died or on_entity_destroyed event. Unfortunately, my modding experience ends with the fact that I created a mod that simply replaces the sounds of laboratories, so I don’t know how to implement it correctly

1 year, 4 months ago

Pretty much. Unfortunately I won't have time to do that next week, maybe on holidays :(

New response