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 » Mon Sep 16, 2013 12:44 pm

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: 1837
Joined: Sun Feb 03, 2013 2:51 pm
Contact:

Re: defines.controllers

Post by slpwnd » Mon Sep 16, 2013 9:53 pm

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 » Mon Sep 16, 2013 10:21 pm

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”

Who is online

Users browsing this forum: No registered users