Robot Army


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

7 days ago
0.13 - 2.0
32.9K

i The Ruins Mod compatibility suggestion (with code)

3 years ago
(updated 3 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

3 years ago
(updated 3 years ago)

deleted

3 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.

3 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).

3 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!

3 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.

3 years ago

Neither neutral nor hostile ruins interact with biters.

3 years ago

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

New response