defines.controllers

Place to get help with not working mods / modding interface.
Post Reply
User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

defines.controllers

Post by rk84 »

How do I change controller from god/ghost to character?

Code: Select all

game.player.setcontroller{type=defines.controllers.character}
--Error: attempt to index number value.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

slpwnd
Factorio Staff
Factorio Staff
Posts: 1835
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: defines.controllers

Post by slpwnd »

The syntax is:

Code: Select all

-- let's say you have stored a reference to character entity in characterref
game.player.setcontroller{type=defines.controller.character, character=characterref}
However this doesn't work in 0.6.4 because of a small bug. It will be fixed for 0.7. In the meantime you can use:

Code: Select all

game.player.connecttocharacter(characterref)

User avatar
rk84
Filter Inserter
Filter Inserter
Posts: 556
Joined: Wed Feb 13, 2013 9:15 am
Contact:

Re: defines.controllers

Post by rk84 »

Thank you
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela

Post Reply

Return to “Modding help”