Page 1 of 1

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

Posted: Tue Jul 21, 2015 6:31 pm
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?

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

Posted: Tue Jul 21, 2015 6:36 pm
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.