Getting Started: Mod to add different types of robot?

Place to get help with not working mods / modding interface.

Getting Started: Mod to add different types of robot?

Postby jhechtf » Fri Aug 25, 2017 4:23 am

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

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

Postby jhechtf » Sun Aug 27, 2017 3:27 am

Is there anywhere I could view the logic for the logistics robots? Even that would give me an idea.
jhechtf
Manual Inserter
Manual Inserter
 
Posts: 4
Joined: Fri Aug 25, 2017 4:16 am

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

Postby torne » Mon Aug 28, 2017 4:12 pm

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.
torne
Fast Inserter
Fast Inserter
 
Posts: 207
Joined: Sun Jan 01, 2017 11:54 am

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

Postby hreintke » Tue Sep 12, 2017 6:58 am

Hi,

Is there a way that you can get the "command" of a robot i.e. what task it is performing at this moment ?
hreintke
Inserter
Inserter
 
Posts: 20
Joined: Mon Sep 04, 2017 6:52 pm

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

Postby mrvn » Tue Sep 12, 2017 8:04 am

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.
mrvn
Smart Inserter
Smart Inserter
 
Posts: 1100
Joined: Mon Sep 05, 2016 9:10 am

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

Postby bobingabout » Tue Sep 12, 2017 8:11 am

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.
User avatar
bobingabout
Smart Inserter
Smart Inserter
 
Posts: 4601
Joined: Fri May 09, 2014 1:01 pm

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

Postby Mr.YaR » Wed Sep 13, 2017 7:46 am

AAI is your only possible path to glory.

Lurk through it's code and you will get an idea how complicated things get.
Mr.YaR
Inserter
Inserter
 
Posts: 25
Joined: Fri Jan 22, 2016 9:17 am


Return to Modding help

Who is online

Users browsing this forum: No registered users and 1 guest