[MOD 0.12.2+] Evolution | Alien Manipulation
Re: [0.12.2] Evolution | Alien Manipulation
Great mod, thanks! One question thought, how do you pick up small/medium/etc. worms? Would be a waste to just kill them, especially if you have a lot of them.
Cheers.
Cheers.
- darkshadow1809
- Filter Inserter
- Posts: 306
- Joined: Thu Jan 15, 2015 10:13 pm
- Contact:
Re: [0.12.2] Evolution | Alien Manipulation
unfortunately theres no way to pick up I couldnt code it as minable either since its an actual AI controlled. "thing" Would also involve a bug when just picking it up dropping it back down resets it to full health.
so unfortunately you'd have to kill them off;(
so unfortunately you'd have to kill them off;(
ShadowsModpackDevelopment
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Really nice mod. But I have some questions.
I am playing your modpack V5. I had rushed to Mind hive and had built 5 bitter hives. Now bitters are running around my base, screaming at each other and randomly explode filling conveyers with corpses and artifacts while spaming alarms. Is this behavior intended?
I am playing your modpack V5. I had rushed to Mind hive and had built 5 bitter hives. Now bitters are running around my base, screaming at each other and randomly explode filling conveyers with corpses and artifacts while spaming alarms. Is this behavior intended?
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
LOL. You just made my daykeyten wrote:Really nice mod. But I have some questions.
I am playing your modpack V5. I had rushed to Mind hive and had built 5 bitter hives. Now bitters are running around my base, screaming at each other and randomly explode filling conveyers with corpses and artifacts while spaming alarms. Is this behavior intended?
- darkshadow1809
- Filter Inserter
- Posts: 306
- Joined: Thu Jan 15, 2015 10:13 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Been trying to fix this. unfortunately factorio has no real options for AI behavior so i discontinued this modkeyten wrote:Really nice mod. But I have some questions.
I am playing your modpack V5. I had rushed to Mind hive and had built 5 bitter hives. Now bitters are running around my base, screaming at each other and randomly explode filling conveyers with corpses and artifacts while spaming alarms. Is this behavior intended?
ShadowsModpackDevelopment
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
I encounter an error when starting a new world on version 0.12.16
"__Evolution__/control.lua:8: attempt to index global 'game' (a nil value)"
"__Evolution__/control.lua:8: attempt to index global 'game' (a nil value)"
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Quick fix is to go and change those error-inducing 'game' to 'script'Andaren wrote:I encounter an error when starting a new world on version 0.12.16
"__Evolution__/control.lua:8: attempt to index global 'game' (a nil value)"
Beyond that, you're probably not going to get much help because...
darkshadow1809 wrote:... i discontinued this mod
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
I tried this mod a few months back and IT WAS AWESOME! I would really like to see the dytech biters and especially the mechanical biter. The mechanical biter sounds really, really cool. Anyways, keep up the good work. If there's any way to support you without needing to spend money, I'd be happy to do so.
Edit: I just noticed that you said you'd be discontinuing it. Why would you discontinue it?! It's such a great mod! What about the mechanical biter? Please reconsider!
Edit: I just noticed that you said you'd be discontinuing it. Why would you discontinue it?! It's such a great mod! What about the mechanical biter? Please reconsider!
-
- Burner Inserter
- Posts: 11
- Joined: Wed Mar 02, 2016 12:01 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Getting and error that makes no sense to me
"Unknown key:"Error while running the on_load:_ _Evolution_ _/control.lua:18: attempt to index global 'game' (a nil value)" "
From what I've seen all over Factorio mods when trying to run 0.11.x mods in 0.12.x is to swap the game.on code for script.on. I did this with the control.lua file for Evolution - Alien Manipulation mod already. So you can see my confusion..
"Unknown key:"Error while running the on_load:_ _Evolution_ _/control.lua:18: attempt to index global 'game' (a nil value)" "
From what I've seen all over Factorio mods when trying to run 0.11.x mods in 0.12.x is to swap the game.on code for script.on. I did this with the control.lua file for Evolution - Alien Manipulation mod already. So you can see my confusion..
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Are you sure you got all of them?DaysofKnight wrote:Getting and error that makes no sense to me
"Unknown key:"Error while running the on_load:_ _Evolution_ _/control.lua:18: attempt to index global 'game' (a nil value)" "
From what I've seen all over Factorio mods when trying to run 0.11.x mods in 0.12.x is to swap the game.on code for script.on. I did this with the control.lua file for Evolution - Alien Manipulation mod already. So you can see my confusion..
control.lua:18: attempt to index global 'game'
Check line 18 again.
-
- Burner Inserter
- Posts: 11
- Joined: Wed Mar 02, 2016 12:01 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
I used the "Replace all" thing in notepad, I got'em all. I even scrolled though the whole thing myself, there's no game.on's in the control file. I even found the load line, there's a script.on theredaniel34 wrote:Are you sure you got all of them?
control.lua:18: attempt to index global 'game'
Check line 18 again.
EDIT: Unless you can ind it, I don't know lua, or any coding for that matter. So I wouldn't even know what line 18 is, or what is considered "line 18".
Code: Select all
require "defines"
local update_com_count = 80
local agro_area_rad = 40
local call_back_area_rad = agro_area_rad + 15
local max_unit_count = 20
script.on_init(function()
if global.evolution == nil then
global.evolution = {}
end
end)
script.on_load(function()
if global.evolution == nil then
global.evolution = {}
end
for i = 1, #game.players, 1 do
if game.players[i].force.technologies["Hive-mind"].researched then
game.players[i].force.recipes["attractor-on2"].enabled = true
end
end
end)
script.on_event(defines.events.on_tick, function(event)
if event.tick % update_com_count == 0 then
for index, player in ipairs(game.players) do
if player.character then
UpdateUnitsCommands(index)
end
end
end
end)
function UpdateUnitsCommands(player_index)
local player = game.players[player_index].character
local pos = player.position
local aggression_area = {{pos.x - agro_area_rad, pos.y - agro_area_rad}, {pos.x + agro_area_rad, pos.y + agro_area_rad}}
if not player.surface.valid then return end
local targets = player.surface.find_entities(aggression_area)
local min_dist = agro_area_rad + 10;
local closest_index = -1
local surface = player.surface
for index, target in ipairs(targets) do
if target.health then
if target.force == game.forces.enemy and target.type ~= "turret" and target.type ~= "unit" then
local dist = GetDistance(target.position, pos)
if min_dist > dist then
min_dist = dist
closest_index = index
end
end
end
end
local unit_count = 0
if closest_index == -1 then
local attOn = game.players[player_index].get_item_count("attractor-on")
local attOff = game.players[player_index].get_item_count("attractor-off")
local lastState = nil
if global.evolution[game.players[player_index].name] and global.evolution[game.players[player_index].name].lastState then
lastState = global.evolution[game.players[player_index].name].lastState
else
if global.evolution[game.players[player_index].name] == nil then
global.evolution[game.players[player_index].name] = {}
end
global.evolution[game.players[player_index].name].lastState = nil
end
if attOn > 0 and attOff == 0 then
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "on"
elseif attOn == 0 and attOff > 0 then
if attOff > 1 then
game.players[player_index].removeitem({name="attractor-off", count=(attOff - 1)})
end
lastState = "off"
elseif attOn > 0 and attOff > 0 then
if lastState ~= nil and lastState == "off" then
game.players[player_index].removeitem({name="attractor-off", count=attOff})
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "on"
else
game.players[player_index].removeitem({name="attractor-on", count=attOn})
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "off"
end
else
lastState = "off"
end
global.evolution[game.players[player_index].name].lastState = lastState
if lastState == "off" then return end
local call_back_area = {{pos.x - call_back_area_rad, pos.y - call_back_area_rad}, {pos.x + call_back_area_rad, pos.y + call_back_area_rad}}
local biters = surface.find_entities_filtered{area = call_back_area, type = "unit"}
for index, biter in ipairs(biters) do
if biter.force == (player.force) then
biter.set_command({type = defines.command.go_to_location, destination = pos, radius = 10, distraction = defines.distraction.byanything});
unit_count = unit_count + 1
end
if unit_count > max_unit_count then return end
end
else
local call_back_area = {{pos.x - call_back_area_rad, pos.y - call_back_area_rad}, {pos.x + call_back_area_rad, pos.y + call_back_area_rad}}
local biters = player.surface.find_entities_filtered{area = call_back_area, type = "unit"}
for index, biter in ipairs(biters) do
if biter.force == player.force then
biter.set_command({type = defines.command.attack, target = targets[closest_index], distraction = defines.distraction.byanything});
unit_count = unit_count + 1
end
if unit_count > max_unit_count then return end
end
end
end
function GetDistance(pos1 , pos2)
return math.sqrt((pos1.x - pos2.x)^2 + (pos1.y - pos2.y)^2)
end
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
In this case follow the error command exactly
There is a script.on_load function there that has reference to game.player - thats not allowed anymore.
In on_load you can't reference game - that was one of changes of the patch also.
On the other hand.. this mod is obsolete and content from it should be in Natural Evolution mod.
There is a script.on_load function there that has reference to game.player - thats not allowed anymore.
In on_load you can't reference game - that was one of changes of the patch also.
On the other hand.. this mod is obsolete and content from it should be in Natural Evolution mod.
-
- Burner Inserter
- Posts: 11
- Joined: Wed Mar 02, 2016 12:01 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Natural Evolution doesn't look as appealing, as it's main focus point seems to be PvP oriented.orzelek wrote:In this case follow the error command exactly
There is a script.on_load function there that has reference to game.player - thats not allowed anymore.
In on_load you can't reference game - that was one of changes of the patch also.
On the other hand.. this mod is obsolete and content from it should be in Natural Evolution mod.
How do I fix the line you mentioned? Show me the code that needs replacing and what it needs to be replaced with.
Again, not a coder in anyway, so I'm just winging it here. Would appreciate help trying to make it work.
Edit: Actually, I seem to have made it work on my own. I deleted the code for the game.player reference. Loaded up just fine (On a new world. Gonna test if having Evolution entities makes a difference).
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
So I see the mod is giving some issues in the above posts, I think it still holds true now...http://puu.sh/nwWRk/dd7c50e81d.jpg
And what I don't understand is that the mods was working once before...I was to able to use everything and such, And i'd like to mention I don't think the ore gen works with Train Outposts...Never did do much to any testing but yea it doesnt seem like they work together.
And what I don't understand is that the mods was working once before...I was to able to use everything and such, And i'd like to mention I don't think the ore gen works with Train Outposts...Never did do much to any testing but yea it doesnt seem like they work together.
-
- Burner Inserter
- Posts: 11
- Joined: Wed Mar 02, 2016 12:01 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
You're having the same problem I had. All I did to make it work was -Nukerman9 wrote:So I see the mod is giving some issues in the above posts, I think it still holds true now...http://puu.sh/nwWRk/dd7c50e81d.jpg
And what I don't understand is that the mods was working once before...I was to able to use everything and such, And i'd like to mention I don't think the ore gen works with Train Outposts...Never did do much to any testing but yea it doesnt seem like they work together.
Code: Select all
script.on_load(function()
if global.evolution == nil then
global.evolution = {}
end
for i = 1, #game.players, 1 do
if game.players[i].force.technologies["Hive-mind"].researched then
game.players[i].force.recipes["attractor-on2"].enabled = true
end
end
end)
Delete " for i = 1, #game.players, 1 do
if game.players.force.technologies["Hive-mind"].researched then
game.players.force.recipes["attractor-on2"].enabled = true
end "
and it should work. I really don't know what it does, I'm not a coder. But it made my game load fine
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
DaysofKnight wrote:You're having the same problem I had. All I did to make it work was -Nukerman9 wrote:So I see the mod is giving some issues in the above posts, I think it still holds true now...http://puu.sh/nwWRk/dd7c50e81d.jpg
And what I don't understand is that the mods was working once before...I was to able to use everything and such, And i'd like to mention I don't think the ore gen works with Train Outposts...Never did do much to any testing but yea it doesnt seem like they work together.Find this in your control.lua file, should be near the top.Code: Select all
script.on_load(function() if global.evolution == nil then global.evolution = {} end for i = 1, #game.players, 1 do if game.players[i].force.technologies["Hive-mind"].researched then game.players[i].force.recipes["attractor-on2"].enabled = true end end end)
Delete " for i = 1, #game.players, 1 do
if game.players.force.technologies["Hive-mind"].researched then
game.players.force.recipes["attractor-on2"].enabled = true
end "
and it should work. I really don't know what it does, I'm not a coder. But it made my game load fine
Yup that seemed to fix it, and yes to the mod developer, Doesn't look like Train Ouposts generates the Alien Artifact ore.
Other than the few names that kinda bug me for not being capitalized, Great mod over all (I'm just a tab OCD when it comes to names) And yes, Thanks to you DaysofKnight for the fix
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
OK I know I'm repeating this, but the mod worked once i started a new map and everything worked i started playing with the mod some, saved it, quit game for a bit loaded it again but it gave the same error control.lua:18: attempt to index a nil value... Always does this after i save then try loading the game. This is confusing...
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
OK so I've been messing around with a friend who is familiar with Lua, and he was saying how this bit...
Is a loop i guess? Constantly checking or something, so i got rid of it, started up the game went into my world just fine, tested around it worked and i was able to research stuff and use it, i closed the game after saving it and it still worked. Sooo yea... Delete that bit of code EXCLUSIVELY. And the mod should then work? If it doesn't then i have no idea.
Code: Select all
for i = 1, game.players, 1 do
if game.players[i].force.technologies["Hive-mind"].researched then
game.players[i].force.recipes["attractor-on2"].enabled = true
end
end
-
- Burner Inserter
- Posts: 11
- Joined: Wed Mar 02, 2016 12:01 pm
- Contact:
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Isn't that exactly what I said? Albeit missing that extra "end", but that's literally exactly what I said...Nukerman9 wrote:OK so I've been messing around with a friend who is familiar with Lua, and he was saying how this bit...Is a loop i guess? Constantly checking or something, so i got rid of it, started up the game went into my world just fine, tested around it worked and i was able to research stuff and use it, i closed the game after saving it and it still worked. Sooo yea... Delete that bit of code EXCLUSIVELY. And the mod should then work? If it doesn't then i have no idea.Code: Select all
for i = 1, game.players, 1 do if game.players[i].force.technologies["Hive-mind"].researched then game.players[i].force.recipes["attractor-on2"].enabled = true end end
Re: [MOD 0.12.2+] Evolution | Alien Manipulation
Didn't work for me initially but i've updated the control.lua so it at least activates without problem (had an issue with game.on being outdated. Minor search/replace fixed it) . Haven't tested much in game beyond that point, but it's a start. How many times is this now ?
e2. DaysofKnight's part about removing updated in there as well. (commented out)
TL:DR. Copy paste 2nd codebox, replace entire control.lua with that.
e2. DaysofKnight's part about removing
Code: Select all
for i = 1, #game.players, 1 do
if game.players[i].force.technologies["Hive-mind"].researched then
game.players[i].force.recipes["attractor-on2"].enabled = true
end
end
Code: Select all
require "defines"
local update_com_count = 80
local agro_area_rad = 40
local call_back_area_rad = agro_area_rad + 15
local max_unit_count = 20
script.on_init(function()
if global.evolution == nil then
global.evolution = {}
end
end)
script.on_load(function()
if global.evolution == nil then
global.evolution = {}
end
-- for i = 1, #game.players, 1 do
-- if game.players[i].force.technologies["Hive-mind"].researched then
-- game.players[i].force.recipes["attractor-on2"].enabled = true
-- end
-- end
end)
script.on_event(defines.events.on_tick, function(event)
if event.tick % update_com_count == 0 then
for index, player in ipairs(game.players) do
if player.character then
UpdateUnitsCommands(index)
end
end
end
end)
function UpdateUnitsCommands(player_index)
local player = game.players[player_index].character
local pos = player.position
local aggression_area = {{pos.x - agro_area_rad, pos.y - agro_area_rad}, {pos.x + agro_area_rad, pos.y + agro_area_rad}}
if not player.surface.valid then return end
local targets = player.surface.find_entities(aggression_area)
local min_dist = agro_area_rad + 10;
local closest_index = -1
local surface = player.surface
for index, target in ipairs(targets) do
if target.health then
if target.force == game.forces.enemy and target.type ~= "turret" and target.type ~= "unit" then
local dist = GetDistance(target.position, pos)
if min_dist > dist then
min_dist = dist
closest_index = index
end
end
end
end
local unit_count = 0
if closest_index == -1 then
local attOn = game.players[player_index].get_item_count("attractor-on")
local attOff = game.players[player_index].get_item_count("attractor-off")
local lastState = nil
if global.evolution[game.players[player_index].name] and global.evolution[game.players[player_index].name].lastState then
lastState = global.evolution[game.players[player_index].name].lastState
else
if global.evolution[game.players[player_index].name] == nil then
global.evolution[game.players[player_index].name] = {}
end
global.evolution[game.players[player_index].name].lastState = nil
end
if attOn > 0 and attOff == 0 then
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "on"
elseif attOn == 0 and attOff > 0 then
if attOff > 1 then
game.players[player_index].removeitem({name="attractor-off", count=(attOff - 1)})
end
lastState = "off"
elseif attOn > 0 and attOff > 0 then
if lastState ~= nil and lastState == "off" then
game.players[player_index].removeitem({name="attractor-off", count=attOff})
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "on"
else
game.players[player_index].removeitem({name="attractor-on", count=attOn})
if attOn > 1 then
game.players[player_index].removeitem({name="attractor-on", count=(attOn - 1)})
end
lastState = "off"
end
else
lastState = "off"
end
global.evolution[game.players[player_index].name].lastState = lastState
if lastState == "off" then return end
local call_back_area = {{pos.x - call_back_area_rad, pos.y - call_back_area_rad}, {pos.x + call_back_area_rad, pos.y + call_back_area_rad}}
local biters = surface.find_entities_filtered{area = call_back_area, type = "unit"}
for index, biter in ipairs(biters) do
if biter.force == (player.force) then
biter.set_command({type = defines.command.go_to_location, destination = pos, radius = 10, distraction = defines.distraction.byanything});
unit_count = unit_count + 1
end
if unit_count > max_unit_count then return end
end
else
local call_back_area = {{pos.x - call_back_area_rad, pos.y - call_back_area_rad}, {pos.x + call_back_area_rad, pos.y + call_back_area_rad}}
local biters = player.surface.find_entities_filtered{area = call_back_area, type = "unit"}
for index, biter in ipairs(biters) do
if biter.force == player.force then
biter.set_command({type = defines.command.attack, target = targets[closest_index], distraction = defines.distraction.byanything});
unit_count = unit_count + 1
end
if unit_count > max_unit_count then return end
end
end
end
function GetDistance(pos1 , pos2)
return math.sqrt((pos1.x - pos2.x)^2 + (pos1.y - pos2.y)^2)
end