Getting Started: Mod to add different types of robot?

Place to get help with not working mods / modding interface.
Post Reply
jhechtf
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Aug 25, 2017 4:16 am
Contact:

Getting Started: Mod to add different types of robot?

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

jhechtf
Manual Inserter
Manual Inserter
Posts: 4
Joined: Fri Aug 25, 2017 4:16 am
Contact:

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

Post by jhechtf »

Is there anywhere I could view the logic for the logistics robots? Even that would give me an idea.

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

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

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

hreintke
Fast Inserter
Fast Inserter
Posts: 115
Joined: Mon Sep 04, 2017 6:52 pm
Contact:

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

Post 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 ?

mrvn
Smart Inserter
Smart Inserter
Posts: 5704
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

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

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

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

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

Mr.YaR
Inserter
Inserter
Posts: 26
Joined: Fri Jan 22, 2016 9:17 am
Contact:

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

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

Post Reply

Return to “Modding help”