Page 1 of 1
Something like event "on player near gate"
Posted: Wed Apr 20, 2016 11:20 am
by Xmat
Hello,
I am playing multiplayer with friends and we all have different forces because of separated research. But we want to open gates automatically when any of us comes near to them.
So I am creating a mod for it (as I didn't find anything useful yet) and I am looking for something like "on player near gate" event, then I would call request_to_open on gate entity (with fake force). Is there any possibility to achieve that? And if, how?
Thanks a lot!
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 5:18 pm
by seronis
I dont actually use gates and my modding experience is very limited to some tweaking at the moment, but couldnt you accomplish this by setting the ownership of the gate to a neutral party or would that allow biters to open it too ? Is there even a neutral force ?
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 5:38 pm
by Klonan
Why not simply have each player put down their own gate?
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 5:53 pm
by daniel34
Klonan wrote:Why not simply have each player put down their own gate?
Also, if there are several gate segments with different forces next to each other and at least one segment belongs to the force of a player, the whole gate will open for that player.
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 6:24 pm
by Xmat
Thank you for your suggestions, but those are possible only when I am thinking about 3-4 people max. When more people come, better solution is required. And that is what I am looking for.
@seronis: there is neutral faction, but
a) I don't know if biters can open it.
b) I would have to do that for every single gate. My factory now containts like 150 gates... And I don't know if it is even possible.
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 6:39 pm
by seronis
Xmat wrote:
b) I would have to do that for every single gate. My factory now containts like 150 gates... And I don't know if it is even possible.
I actually meant that if a neutral gate works then just have a mod that makes all gates neutral instead of being owned. That is something that can be done in the on_built event so that it doesnt cause a CPU hit like a location based event would do.
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 6:57 pm
by Xmat
Okay, I understand. Thanks for your idea, I am going to try it.

Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 8:32 pm
by daniel34
seronis wrote:Xmat wrote:
b) I would have to do that for every single gate. My factory now containts like 150 gates... And I don't know if it is even possible.
I actually meant that if a neutral gate works then just have a mod that makes all gates neutral instead of being owned. That is something that can be done in the on_built event so that it doesnt cause a CPU hit like a location based event would do.
I thought that too, that's when I tested it and came to the conclusion that
daniel34 wrote:if there are several gate segments with different forces next to each other and at least one segment belongs to the force of a player, the whole gate will open for that player
So no, neutral gates won't open for any other force.
Re: Something like event "on player near gate"
Posted: Wed Apr 20, 2016 8:36 pm
by MrDoomah
You might also create a key item. When you place this item on a gate it opens for 5 seconds or so.