How do I import my personal roboport area?

Place to get help with not working mods / modding interface.
sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

How do I import my personal roboport area?

Post by sore68 »

I would like to call the construction area of the robotic ports on the device or player.
eq.png
eq.png (142.79 KiB) Viewed 1142 times

I made a code to load the equipment of the player armor.
code
Is there a command to simplify this further?

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: How do I import my personal roboport area?

Post by Nexela »

Equipping a personal roboport attaches a logistic_cell to your character http://lua-api.factorio.com/latest/LuaLogisticCell.html

Example code

Code: Select all

c = game.players[1].character --Get the player's character
if c and c .valid then --Make sure we have a character as some players (god mode for instance) won't have a character
  if c.logistic_cell and c.logistic_cell.mobile then --See if character is a logistic cell AND is a mobile cell
  radius = c.logistic_cell.construction_radius or 0 -- Return a radius for the construction cell
  robot_count = c.logistic_cell.stationed_construction_robot_count -- total robots (or available not sure which)
  end
--For you to check as I am not sure: are any/all of these available if power in roboport is 0 .cell, .mobile, .construction_radius
--These might be able to be wrapped with .active
end

sore68
Fast Inserter
Fast Inserter
Posts: 123
Joined: Mon May 02, 2016 8:39 am
Contact:

Re: How do I import my personal roboport area?

Post by sore68 »

Nexela wrote:Equipping a personal roboport attaches a logistic_cell to your character http://lua-api.factorio.com/latest/LuaLogisticCell.html
Oh! Thank you!! I missed [players.character]
This is what I was looking for. :D

Post Reply

Return to “Modding help”