Skip to content

Commit

Permalink
ready to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranf committed Aug 10, 2021
1 parent 0d06a7b commit f7fd556
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Changelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ changes from 0.4.7 to 0.4.8:
- fixes to the Droid Counter module and the Settings Module code, which had issues with referencing parameters tables which have changed in recent history.
instead of control_behaviours.parameters.parameters, there's only one layer of parameters table now. Yay! Means I can get rid of the comment I had in the code, "-- ridiculous, we have to do parameters WHY WUBE WHY"

changes from 0.4.8 to 0.4.9:
- upgrading the version requirement of Unit Control (optional mod) to 3.10 for supporting the new API
- fixes to how the mod uses the new Unit Control API for raising unit events from known deployers.
- adding Guard Station to deployer supported for Unit Control
- reducing how/when the guard and assembler stations try to run logic when spawning units while Unit Control is active. Basically all droid processing is halted.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Robot Army mod for Factorio V1.1+

## Version
0.4.8,
Known to be compatible with Factorio v1.1.1. Requires at least v1.1.1 due to mod script API changes and tech name changes.
0.4.9,
Known to be compatible with Factorio v1.1.37. Requires at least v1.1.1 due to mod script API changes and tech name changes.


## Description
Expand Down
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{

"name": "robotarmy",
"version": "0.4.8",
"version": "0.4.9",
"title": "Robot Army",
"author": "Kyranzor",
"contact": "[email protected]",
"homepage": "https://github.com/kyranf/robotarmyfactorio",
"description": "Manufacture and deploy automated robot soldiers to attack your foes and defend your factory!",
"dependencies": ["base >= 1.1.5", "? Unit_Control >= 0.1.0"],
"dependencies": ["base >= 1.1.5", "? Unit_Control >= 0.3.10"],
"factorio_version": "1.1"
}
1 change: 1 addition & 0 deletions prototypes/building.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ local guardStation = {
type = "assembling-machine",
name = "droid-guard-station",
icon_size = 32,
is_deployer = true,
icon = "__robotarmy__/graphics/icons/droid-guard-station.png",
flags = {"placeable-neutral", "placeable-player", "player-creation"},
minable = {hardness = 0.2, mining_time = 0.5, result = "droid-guard-station"},
Expand Down
19 changes: 15 additions & 4 deletions robolib/eventhandlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,13 @@ function processDroidAssemblers(force)
raise_built=true })

if returnedEntity then

if not game.active_mods["Unit_Control"] then
processSpawnedDroid(returnedEntity)
else
local control_events = remote.call("unit_control", "get_events")
unit_spawned_event = control_events.on_unit_spawned
script.raise_event(unit_spawned_event, {entity = returnedEntity, spawner = assembler})
end

end
inv.clear() --clear output slot
Expand All @@ -297,6 +302,7 @@ end

function processDroidGuardStations(force)
--handle guard station spawning here

if global.droidGuardStations and global.droidGuardStations[force.name] then
for _, station in pairs(global.droidGuardStations[force.name]) do
if station and station.valid and station.force == force then
Expand All @@ -312,7 +318,13 @@ function processDroidGuardStations(force)
position = droidPos, direction = defines.direction.east,
force = station.force, raise_built=true })
if returnedEntity then
processSpawnedDroid(returnedEntity, true, station.position)
if not game.active_mods["Unit_Control"] then
processSpawnedDroid(returnedEntity, true, station.position)
else
local control_events = remote.call("unit_control", "get_events")
unit_spawned_event = control_events.on_unit_spawned
script.raise_event(unit_spawned_event, {entity = returnedEntity, spawner = station})
end
end
inv.clear() --clear output slot
end
Expand Down Expand Up @@ -425,8 +437,7 @@ function handleOnBuiltEntity(event)
handleBuiltRallyBeacon(event)
elseif entity.type == "unit" and table.contains(squadCapable, entity.name) then --squadCapable is defined in DroidUnitList.
if not game.active_mods["Unit_Control"] then

processSpawnedDroid(entity, false, nil, true) --this deals with droids spawning
processSpawnedDroid(entity, false, nil, true) --this deals with droids spawning manually by the player
end
end
end -- handleOnBuiltEntity
Expand Down

0 comments on commit f7fd556

Please sign in to comment.