From game.player to game.players[index]...

Place to get help with not working mods / modding interface.
Post Reply
iUltimateLP
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Sun May 24, 2015 4:41 pm
Contact:

From game.player to game.players[index]...

Post by iUltimateLP »

So I have another problem with my teleporter mod... How do I make this function for multiplayer?
So the main functions with teleporting are made inside the ontick event, but that does not give the playerindex back, so how do I get the player(index) to make things with him?

johanwanderer
Fast Inserter
Fast Inserter
Posts: 157
Joined: Fri Jun 26, 2015 11:13 pm

Re: From game.player to game.players[index]...

Post by johanwanderer »

Store it in a variable?

I think the better question is how you want your mod to work in multiplayer mode. Does each player have a teleporter end-point, and one supply point for all, or does each player have his/her own pair of teleporting end-points?

Anyway, when the endpoints are placed, you should keep track of it, along with who owns it (the player index, for example). Then your on-tick handler can just use that information and teleport goods accordingly.

Post Reply

Return to “Modding help”