EvoGUI - Trying to update

Place to get help with not working mods / modding interface.
Chamkey
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Oct 25, 2016 6:30 am
Contact:

EvoGUI - Trying to update

Post by Chamkey »

Can't get this to work.

Code: Select all

local evo_factor = force.evolution_factor
In-game it tells me "attempt to index global 'force' (a nil value)"

Please help. I'm going to be uploading it to the mod portal asap. I know a lot of people who want this on my friends list.
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: EvoGUI - Trying to update

Post by Nexela »

How are you getting "force"

Everything from the game requires getting it from the game. global (unless sent through an event ie. gui events send the element)

local force = game.forces["name-of-force"]
Chamkey
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Oct 25, 2016 6:30 am
Contact:

Re: EvoGUI - Trying to update

Post by Chamkey »

Nexela wrote:How are you getting "force"

Everything from the game requires getting it from the game.global (unless sent through an event ie. gui events send the element)

local force = game.forces["name-of-force"]
Thank you... I didn't understand what a force was in the context of this game. I thought it was something that had to do with actual science push, pull, friction. That sorta thing. Went it to the Command Console to find out that that is not the case. Finally got it working.. will be up on the mod portal in a few.
Post Reply

Return to “Modding help”