Robot Army


Manufacture and deploy automated robot soldiers to attack your foes and defend your factory!

1 year, 10 months ago
0.13 - 1.1
30.3K

i The Ruins Mod compatibility suggestion (with code)

2 years ago
(updated 2 years ago)

I was working on extension to The Ruins Mod and am wondering about compatibility with Robot Army.

Problems I found are:
- Force created by Ruins is ignored on init causing crashes on bot deploy.
- Ruins use unhandled event when spawning entities. defines.events.script_raised_built

Proposed changes (don't crash instantly):

In control.init_robotarmy() replace:

event.force = game.forces["player"]
handleForceCreated(event)
event.force = game.forces["enemy"]
handleForceCreated(event)
event.force = game.forces["neutral"]
handleForceCreated(event)

with forces iteration: https://pastebin.com/nvyj25UL

In control register event handler:

script.on_event(defines.events.script_raised_built, handleOnScriptRaisedBuilt)

In eventhandlers add: https://pastebin.com/Hixxmjsk

2 years ago
(updated 2 years ago)

deleted

2 years ago

heya, i'll add these in for 4.11 and upload soon. thanks for your contribution!

how much have you tested these changes?

I think a randomly generated ruin with hostile robot army units would be a neat addition to the game. Not sure how well balanced robot-army units are against player guns actually.

2 years ago

Haven't tested them much yet other than making sure that ruins with droid assemblers can deploy robots which then move to attack player owned entities.
That said I haven't actually changed much:
-> Robot Army init() wasn't handling forces created by mods init() earlier in mod order but would pick them up by happenstance if settings change.
-> handleOnScriptRaisedBuilt() just copies handleOnRobotBuiltEntity() since the latter isn't referring to anything other than entity spawned, available to both (but under different name XD).

2 years ago

yeah, it's not a big change, I don't see it as high-risk.

The in-progress v5.0 of Robot Army actually does have the script_raised_built event handled I think, because I have a new engineer droid (with a short range chaingun arm!) which can build stuff for the player (it places items into ghosts, assuming the global engineering supply container has the parts in it )

I will try to add this code in and deploy soon and you can continue testing your stuff. The ruins deploying robot units against you sounds great fun!

2 years ago

will the ruins factions be at war with the biters too? The ruins may get stomped by the biters, or the ruin's armies may stomp the nearby biters.

2 years ago

Neither neutral nor hostile ruins interact with biters.

2 years ago

I have uploaded v4.11, please check that it meets your needs.

New response