I am working on a detector script for mines, to see how much of a resource is around a drilling unit
when i use the createdentity i can get the basics but not the resource_searching_radius variable
so im curious for a way to look at all mods and base to get that variable for the games mines as well as mods mines to see thier search radius. The idea is to get thier search radius, divide by two and run game.findentitiesfiltered every so often on each mine to see how much it has access to then also need to get and store the mines/drills cords ie its X/Y location
any ideas?
How to get entity vars from a script
-
- Long Handed Inserter
- Posts: 55
- Joined: Thu Jun 27, 2013 3:59 pm
- Contact:
-
- Long Handed Inserter
- Posts: 55
- Joined: Thu Jun 27, 2013 3:59 pm
- Contact:
Re: How to get entity vars from a script
Well still no luck <.< I keep trying to use the wiki, it says all the info is stored in the data.raw table, but it always says the the table is empty when I doa serpent or when i access it its always nill
I am using a require "dataloader" and running local t109 = data.raw.ammo["piercing-bullet-magazine"].magazine_size gives a - attempt to index field 'ammo' (a nil value)
I tried accessing it with names, types, always says its nil value.
When i do a glob.player.print(serpent.block(data.raw)) it says its empty - { } <memory address>
https://forums.factorio.com/wiki/inde ... g_overview says I can access the info this way but I cant seem to get it to load anything <.< any suggestions on what im messing up
I am using a require "dataloader" and running local t109 = data.raw.ammo["piercing-bullet-magazine"].magazine_size gives a - attempt to index field 'ammo' (a nil value)
I tried accessing it with names, types, always says its nil value.
When i do a glob.player.print(serpent.block(data.raw)) it says its empty - { } <memory address>
https://forums.factorio.com/wiki/inde ... g_overview says I can access the info this way but I cant seem to get it to load anything <.< any suggestions on what im messing up
Re: How to get entity vars from a script
Data.raw only exist when factorio is starting and you use data.lua file to edit it.
Its temporary holder of prototype definitions until all data.luas are done and the game will retrieve the data.
Its temporary holder of prototype definitions until all data.luas are done and the game will retrieve the data.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela