Page 1 of 1

Getting Started: Mod to add different types of robot?

Posted: Fri Aug 25, 2017 4:23 am
by jhechtf
My friend and I were talking and we decided we would like a mod that allows for something like "patrol robots" -- Robots that will patrol back and forth in a certain path. We would like for there to be a sort of "guard tower" like robo-port that they go to, but really my biggest question is:

How do I program a custom behavior into a logistic robot? I can worry about what they look like later, I'm more curious as to how I change their default behavior. Any help would be appreciated.

Re: Getting Started: Mod to add different types of robot?

Posted: Sun Aug 27, 2017 3:27 am
by jhechtf
Is there anywhere I could view the logic for the logistics robots? Even that would give me an idea.

Re: Getting Started: Mod to add different types of robot?

Posted: Mon Aug 28, 2017 4:12 pm
by torne
There's no way to do this. The behaviour of each type of game entity is coded into the game itself and can't be modified by mods. Logistic robots do what logistic robots do: mods can only affect the robots' parameters like speed, carrying capacity, charge, etc.

Re: Getting Started: Mod to add different types of robot?

Posted: Tue Sep 12, 2017 6:58 am
by hreintke
Hi,

Is there a way that you can get the "command" of a robot i.e. what task it is performing at this moment ?

Re: Getting Started: Mod to add different types of robot?

Posted: Tue Sep 12, 2017 8:04 am
by mrvn
There are already mods for this. Try the AAI mods for freely programmable vehicles. You can set up a chaingunner to patrol for you with a few simple combinators.

Re: Getting Started: Mod to add different types of robot?

Posted: Tue Sep 12, 2017 8:11 am
by bobingabout
There are 3 types of robots in the game.

Logistic robots: Carry things from storage/provider to request/storage.
Construction robots: Carry items from provider/storage to a ghost, and "Build" the entity, and also grab repair packs (and leave unused ones in their roboport when docking) and go to repair damaged entities within their zone. Also deconstruct and take away the item from an entity marked for deconstruction.
Combat robots: Follow the player, or remain stationary, and attack any enemy within weapon range.

That's it, any further functionality cannot be added.

There are a few tricks that you can use though, I mean, what is a capsule? (as used by the combat robots), it's basically a click fire item weapon, that launches a projectile, and creates the entity at the end. You can make any weapon in the game do the same thing (Shoot combat robots) as long as the robot it creates doesn't follow the player. (if it has follow player, launching a robot in this manner will crash the game.)

There is another trick too... You can create an Enemy unit type entity that looks like a combat robots, and behaves like an enemy, though they do have a tendency to despawn when idle, or just run off into enemy bases and die, provoking an attack in the process.
I'm fairly sure Klonan (One of the devs) made a robot based mod that did something like this.
You can even make a "friendly biter spawner" that spawns these modified robots, but personally, I'd go for the gun method.

Re: Getting Started: Mod to add different types of robot?

Posted: Wed Sep 13, 2017 7:46 am
by Mr.YaR
AAI is your only possible path to glory.

Lurk through it's code and you will get an idea how complicated things get.