How to find the neighbours of a ghost underground belt and how to get the player who created the ghost-entity?
Posted: Sun Mar 10, 2019 1:52 pm
Hi
I'm trying to fix some issues around placing the underground belts of the mod subterrain.
Some small explanation prior.
Subterrain belt's are belts which could be indefinitely long currently limited to 250 tiles.
If you place them the mod removes the amount of belts needed for the distance, e.g. if it's 50 tiles long you'll loose 50 belts (of the same tier as the belt is).
Moreover if you remove one part of the underground belt you'll regain the belts you spend for building it.
Right now this works only well if the player places the underground belts, I did not find a way for doing this with robots yet because I ran into some issues.
If such belts are placeable as ghost the question is now, when do we remove the belts?
Two solutions I can think of are:
1. Somehow tell factorio that the entity requires not only the subterrain belt, it requires belts too.
2. Claim the belts even if it's only placed as ghost
However in both solutions I ran into the issues:
1. I can't acquire the player who "made" the ghost entity
2. I can't acquire the player from who the robot is from so I could claim belts or give back belts.
3. I can't acquire the neighbour of a ghost underground belt (accessing the field results in a runtime error).
Is there anything you can think of as possible solution to this?
I'm trying to fix some issues around placing the underground belts of the mod subterrain.
Some small explanation prior.
Subterrain belt's are belts which could be indefinitely long currently limited to 250 tiles.
If you place them the mod removes the amount of belts needed for the distance, e.g. if it's 50 tiles long you'll loose 50 belts (of the same tier as the belt is).
Moreover if you remove one part of the underground belt you'll regain the belts you spend for building it.
Right now this works only well if the player places the underground belts, I did not find a way for doing this with robots yet because I ran into some issues.
If such belts are placeable as ghost the question is now, when do we remove the belts?
Two solutions I can think of are:
1. Somehow tell factorio that the entity requires not only the subterrain belt, it requires belts too.
2. Claim the belts even if it's only placed as ghost
However in both solutions I ran into the issues:
1. I can't acquire the player who "made" the ghost entity
2. I can't acquire the player from who the robot is from so I could claim belts or give back belts.
3. I can't acquire the neighbour of a ghost underground belt (accessing the field results in a runtime error).
Is there anything you can think of as possible solution to this?