[MOD 0.14] AAI Programmable Vehicles

Topics and discussion about specific mods
MysterGeOrGe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Oct 28, 2015 11:46 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by MysterGeOrGe »

Any solution ? i love this mod
Flatnoise
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Mar 26, 2020 6:02 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Flatnoise »

Encountered a fatal bug when any of my chaingunners dies:
Factorio 0.18.16

UPD:
Nevermind. It was because i have vehicles before mod's update.

Code: Select all

The mod AAI Programmable Vehicles (0.6.2) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event aai-programmable-vehicles::on_entity_died (ID 4)
__aai-programmable-vehicles__/control.lua:904: bad argument #1 of 2 to 'ipairs' (table expected, got nil)
stack traceback:
	[C]: in function 'ipairs'
	__aai-programmable-vehicles__/control.lua:904: in function 'unit_unmanage'
	__aai-programmable-vehicles__/control.lua:920: in function 'unit_unmanage_by_entity'
	__aai-programmable-vehicles__/control.lua:924: in function 'unit_on_entity_died'
	__aai-programmable-vehicles__/control.lua:3312: in function 'callback'
	__aai-programmable-vehicles__/scripts/event.lua:14: in function <__aai-programmable-vehicles__/scripts/event.lua:12>
	
Last edited by Flatnoise on Thu Mar 26, 2020 6:30 am, edited 1 time in total.
canisdirusleidy
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu May 23, 2019 7:31 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by canisdirusleidy »

MysterGeOrGe wrote: Wed Mar 25, 2020 11:50 am Any solution ?
Fixed in new version:
Bugfixes:
- Fixed error when trying to load with mods with unusual icon sizes.
Kladdey
Burner Inserter
Burner Inserter
Posts: 11
Joined: Tue Mar 03, 2020 3:33 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Kladdey »

Nevermind, I got it working :D
Sepon
Manual Inserter
Manual Inserter
Posts: 3
Joined: Wed Mar 06, 2019 4:23 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Sepon »

Hi,
I think I bumped into a problem: the mod was working perfectly for me, and I was playing "starcraft" with biters for ~5 hours. But one moment all my chaingunners started to give me "No path" error, although there is a pass and they already used this path (e.g. even trying to return to base gives "no path"). Maximum they can do is to move some short distances when I give a close order, but somehow they just stopped moving on a long distances.
Can someone help me with it?
joemcguiregaming
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sun Mar 01, 2020 12:14 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by joemcguiregaming »

Is it not possible to convert AI Miners to higher tiers? They themselves are not used in the recipes of higher AI tiers and I haven't figured out a way to remove their AI status.

Seems like such a waste to build AI miners (their intended function) when they will be useless once you have higher tiers unlocked.
torne
Filter Inserter
Filter Inserter
Posts: 342
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by torne »

Version 0.6.4 released just a couple of days ago made it so that picking up a deployed AI vehicle will returns the normal version of the vehicle which allows it to be used in upgrades.
joemcguiregaming
Burner Inserter
Burner Inserter
Posts: 16
Joined: Sun Mar 01, 2020 12:14 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by joemcguiregaming »

Awesome that clears that up, I was about to re-install the vehicle wagon mod because I knew that removed the AI status of aai vehicles.

Now on to positional beacons, can someone explain their use case? Because I assumed you placed them down as path waypoints but that clearly isn't the case.

It makes no sense that when creating a path you have the option to use vehicle depots or positional beacons as waypoints, and yet vehicles will not actually use them! I was hoping to use them to make an automated highway for haulers travelling between depots or for mining vehicles to drop off their cargo but instead I've just had to use standard path positions or zones nearby to the depot.

Personally I'm starting to get a bit irritated at how AAI seems to be hugely popular, and yet there's no up-to-date manual or examples of use cases. All the tutorials are out of date and there are no YTers right now using AAI to it's fullest extent. All the examples on page 1 are so out of date now that, for example, you can specify what a scanner outputs and so there's no need for long strings of deciders, not that that's showcased and I only stumbled onto that with my need to click on everything.

Figuring shit out on my own is fine up to a point, but now I'm just getting frustrated trying to use the mod as I spend hours troubleshooting. And mods should never be frustrating to use.
Elvang
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Apr 06, 2020 1:27 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Elvang »

neetzow wrote: Mon Feb 03, 2020 12:42 pm 1)For starters, all the vehicles have trouble to start moving, giving frequent "no path" error messages, be it with the yellow controller or with the command buildings.
1.1) When using the yellow controller they give several "no path" messages, and I need to give several move orders before said vehicle decide to move.
1.2) They don't move in a straight line. They seem to think that some patches of land are obstructed, even though they are clearly empty barren land, and if the distance is longer... "no path"

...

UPDATE:
Anyway, uninstalled the "driver assist mod" that tell you to follow pavement, and, not sure - probably I'm wrong - it seems to have worked somewhat... The miners have trouble tracing a path to a further point if there is any kind of obstacle on the way (the hauler seems to be smarter, but must be my dumb-self deriving circunstancial and un-based conclusions), but it's still going to it's intended point.
Sepon wrote: Tue Mar 31, 2020 12:06 am Hi,
I think I bumped into a problem: the mod was working perfectly for me, and I was playing "starcraft" with biters for ~5 hours. But one moment all my chaingunners started to give me "No path" error, although there is a pass and they already used this path (e.g. even trying to return to base gives "no path"). Maximum they can do is to move some short distances when I give a close order, but somehow they just stopped moving on a long distances.
Can someone help me with it?
Image

I keep running into this "No Path" issue after several hours into a map. Its like whole chunks just stop being drive-able. I can order a vehicle to move into one of these "No Path" areas by repeatedly moving the vehicle a tile at a time but the area remains a "No Path" zone. Updating Factorio to 0.18.x from 0.17 resolved it for a bit before it came back again, same for updating AAI to the 0.18.x versions. I've found toggling the VehicleSnap mod on the mod list will 'reset' all the "No Path" areas (i.e. turn off mod, continue playing until issue reoccurs, turn on mod, continue playing until issue reoccurs, repeat). Playing without VehicleSnap at all still causes the issue.
Mod List
Last edited by Elvang on Mon Apr 06, 2020 2:22 am, edited 1 time in total.
Zarnoo
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Thu Mar 31, 2016 6:01 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Zarnoo »

Just getting into AAI for the 1st time with 0.18, and I seem to have got most of it down, but can't get it to find enemy structures.

To test it, I've fed a tile scanner into a simple count, and it's just not finding anything. Anyone got any idea what I'm doing wrong ? Here's my simple blueprint:

Code: Select all

0eNq9l1uOmzAUhvfiZxxxDQRVXUXfqggZcNKjgkG2SYMiFtCFdGNdSY2ZXMdk4kzUlygkzndu/38IB5RXHW05MInSA4KiYQKl3w9IwJaRavxM9i1FKQJJa+QgRurxSkJFsSgIQ4ODgJV0j1JvcD78nZC8KyTeUkY5FJqg3mFBpQS2FRc0f1g7iDIJEuiUkr7oM9bVOeUq3MNQB7WNUJyGjXkpNvYd1KPUVdFUwZI3VZbTH2QHDR9PbKCSlM/0YQdcduqTc3R9ArtI07qxkd4HPZljeEaGb8UQHd+QghpJgRVpj8cpG0GhJUh0uZETWXEqwkojZmmFAbZTUmp4j0XVSCMwtgIq3dU97hiYYYldduYSV1aQFthPsx7dYT2MqBsz+XNmAtZ20uCgYOG7gedHk5HeLiY/MVqMJ8V41BtfOC0vDawqVA1WaRjyCAwbZt6+BkA4V0jTSXMl7iJx3Tgx1/Ka3XDPk94nPRlHTy6K/haFgzh4elXcODyOIvfJbdHfsFRa/gXsZStj/bhaE3USeNGB1JfejHijU3QGe6BYdrmScE2q6r3sQi027Jk4SwtOdOSY5XpMW31Xnn62AS5k9nAPv00NZEISPQ/fC+MwCZbh2JambgkncoyG/v7+g4bHu7q67qo/09X4lM8xB6yi5sB01Pd+njrivdK/nLDtlelc98K/FkKaqzE5RSxpAaX683KvRG9xrrEEPsXVO9xU8RvxLAHxhAbOtzgsWvJLrdRrUbg3UviqCNPGtdZZ22e6zdmGN3U23X/SDakEtdBWqKfiP6a8OT+vrKYS/v+p3DhTy/JqDF9ePAZ1S6Wfcbhzb636djO7Zi31DNUjg37eSC8eaxy0U4bXs4jjwHMjPwpD9d/hH+N3YTA=
Thanks in advance. Z
polybomber
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Apr 12, 2020 11:24 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by polybomber »

I'm really liking the potential this mod has but one thing I'm trying to figure out is how do you get a vehicle to move from a deployer to a path waypoint automatically? I can use the vehicle remote controller to order a hauler to move to a path that it will then follow, but I'm trying to figure out a way to automate that so when a clock sends a signal the vehicle will move to a path waypoint.
TheBrain
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Apr 23, 2020 10:51 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by TheBrain »

Is there a way to get the highest unit-id? Just want to cycle all units to give them different orders with only one circuit.

ps: thanx for this great mod. I like to play around with it all day long ;)
John_McFist
Manual Inserter
Manual Inserter
Posts: 1
Joined: Thu Apr 30, 2020 6:07 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by John_McFist »

Let me start by saying this mod is fantastic and I love it. It makes so much sense to have automated vehicles for exploration, combat, and resource gathering; in a world where we're automating damn near everything, it fits perfectly.

Having said that, I take issue with the one weapon per vehicle restriction. I realize the AI can only handle using one weapon, but players should have no such restriction, especially with high-end vehicles like the tanks from HeavyTank or the flying fortress from Aircraft. It also breaks at least one modded vehicle, the Crawler Automated Base from Angel's Addons; the CAB has the ability to deploy, making it stationary until un-deployed but broadcasting power around itself so that you can run assemblers and such while far from home without your usual power grid. Problem is, the deployment mechanism is coded as two different weapons, one for deploy and one for undeploy. The weapon splitting code breaks it into two variants, one that can deploy only once and then stay there until mined, and one that can only undeploy, which does nothing.

So if you, like me, want to continue using vehicles (modded or otherwise) with multiple weapons, there is a way to do that; you have to remove a fairly sizable chunk of code from two files in the mod, entity-update and entity-update-externals, both located in /prototypes/entity/ from the root directory.

I did do this in a running save, and it hasn't broken anything that i can find, but do this at your own peril, obviously. I'd also love it if someone more talented than me with lua could figure out a way to do this better; maybe create exceptions for specific vehicles, or make single-weapon copies without removing the original, so you could make ones with specific weapons for the AI while keeping the full weapon suite for yourself.

Remove or comment out these lines from entity-update:

Code: Select all

-- only 1 gun per vehicle
    if vehicle.guns and #vehicle.guns > 1 then
        -- assume last gun is best?
        --vehicle.guns = {vehicle.guns[#vehicle.guns]}
        -- assume first gun is best?
        vehicle.guns = {vehicle.guns[1]}
    end

And these lines from entity-update-external:

Code: Select all

function aai_split_vehicle(vehicle_name, gun_names)

  local a_entity = data.raw.car[vehicle_name]
  if not a_entity then return end

  if not (gun_names and #gun_names >= 2) then return end

  log( "aai_split_vehicle: " .. vehicle_name )

  local valid_guns = {}
  for _, gun in pairs(gun_names) do
    if data.raw.gun[gun] then
      table.insert(valid_guns, gun)
      --log( "aai_split_vehicle gun: " .. gun )
    end
  end
  if #valid_guns < 2 then return end
  --log( "aai_split_vehicle: " .. vehicle_name .. " valid guns: " .. #valid_guns )

  local a_item
  for _, item in pairs(data.raw["item-with-entity-data"]) do
    if item.place_result and item.place_result == a_entity.name then
      a_item = item
      break
    end
  end
  if not a_item then
    for _, item in pairs(data.raw.item) do
      if item.place_result and item.place_result == a_entity.name then
        a_item = item
        break
      end
    end
  end
  if not a_item then return end
  --log( "aai_split_vehicle: " .. vehicle_name .. " found item" )

  local a_recipe
  for _, recipe in pairs(data.raw.recipe) do
    if (recipe.result and recipe.result == a_item.name)
      or (recipe.normal and recipe.normal.result and recipe.normal.result == a_item.name) then
        a_recipe = recipe
        break
    end
  end
  if not a_recipe then return end
  --log( "aai_split_vehicle: " .. vehicle_name .. " found recipe" )

  local a_tech
  for _, tech in pairs(data.raw.technology) do
    if tech.effects then
      for _, effect in pairs(tech.effects) do
          if effect.recipe and effect.recipe == a_recipe.name then
            a_tech = tech
            break
          end
      end
    end
    if a_tech then break end
  end
  if a_tech then
    --log( "aai_split_vehicle: " .. vehicle_name .. " found tech" )
  end

  -- modify a
  a_entity.guns = { valid_guns[1] }
  a_entity.localised_name = {"split-vehicle", {"entity-name.".. a_entity.name}, {"item-name."..valid_guns[1]}}
  a_item.localised_name = {"split-vehicle", {"entity-name.".. a_entity.name}, {"item-name."..valid_guns[1]}}
  --a_item.localised_name = {"split-vehicle", {"item-name.".. a_item.name}, {"item-name."..valid_guns[1]}}
  -- recipe gets auto-named

  for i = 2, #valid_guns, 1 do
    local b_gun = valid_guns[i]
    local b_entity = table.deepcopy(a_entity)
    local b_item = table.deepcopy(a_item)
    local b_recipe = table.deepcopy(a_recipe)

    b_entity.name = b_entity.name .. "-" .. b_gun
    b_entity.guns = { b_gun }
    b_entity.localised_name = {"split-vehicle", {"entity-name.".. a_entity.name}, {"item-name."..b_gun}}

    b_item.name = a_item.name .."-"..b_gun
    b_item.localised_name = {"split-vehicle", {"entity-name.".. a_item.name}, {"item-name."..b_gun}}
    b_item.place_result = b_entity.name
    b_entity.minable.result = b_item.name

    b_recipe.name = a_recipe.name .."-"..b_gun
    -- recipe gets auto-named
    if b_recipe.result then b_recipe.result = b_item.name end
    if b_recipe.normal and b_recipe.normal.result then b_recipe.normal.result = b_item.name end
    if b_recipe.expensive and b_recipe.expensive.result then b_recipe.expensive.result = b_item.name end

    if a_tech then
      table.insert(a_tech.effects, {
        type = "unlock-recipe",
        recipe = b_recipe.name
      })
    end
    data:extend({b_entity, b_item, b_recipe})
  end
end

-- aircraft mod
if data.raw.car["cargo-plane"] then
  -- hauler types should not have guns
  data.raw.car["cargo-plane"].guns = nil
end

-- more than 2 variants is excessive
if data.raw.car["gunship"] then
  data.raw.car["gunship"].guns = { "aircraft-machine-gun", "aircraft-rocket-launcher"}
end
if data.raw.car["jet"] then
  data.raw.car["jet"].guns = { "aircraft-machine-gun", "napalm-launcher"}
end
if data.raw.car["flying-fortress"] then
  data.raw.car["flying-fortress"].guns = { "aircraft-cannon", "flying-fortress-rocket-launcher"}
end

  -- bobs
--if data.raw.car["bob-tank-2"] and data.raw.gun["tank-artillery-1"] then data.raw.car["bob-tank-2"].guns = {"tank-artillery-1"} end
--if data.raw.car["bob-tank-3"] and data.raw.gun["tank-laser"] then data.raw.car["bob-tank-3"].guns = {"tank-laser"} end

local vehicles_to_process = {}
for _,vehicle in pairs(data.raw.car) do -- beware loop
    if (not string.find(vehicle.name, data_util.composite_suffix, 1, true))
    and (not string.find(vehicle.order or "", "no-aai", 1, true)) then
      if data_util.table_contains(aai_vehicle_exclusions, vehicle.name) then
        log("Exclude vehicle from gunsplit: " .. vehicle.name)
      else
        table.insert(vehicles_to_process, vehicle)
      end
    end
end

for _, vehicle in pairs(vehicles_to_process) do
    aai_split_vehicle(vehicle.name, vehicle.guns)
end
Sarxis
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat Feb 24, 2018 2:21 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Sarxis »

How can I change the default resource settings for vehicles? I want to be able to change what their defaults are when they are initially placed by hand. I'm ok with editing mod files to do that, I just don't see where the information is stored.

Maybe this question has been asked, but I've looked quite a bit and couldn't find the answer. Sorry if it is a well known secret!

-edit-

I think I found it all in the Control.lua

Lots of stuff for me to fiddle around with in there! Thanks for the mod! So fun commanding hoards of vehicles like it was Empire Earth! :D
Meculus
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Oct 29, 2019 12:58 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Meculus »

Hey, has anyone found a simple way to make a vehicle follow zone arrows? Mine failed, after trying to use a large amount of Decider combinators to detect direction.
donadona
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jun 09, 2020 6:09 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by donadona »

Hi, can anyone help me about laser tank?
I'm experiencing a friendly fire by laser tank when a group of the tanks were staying close to enemy base.
Tanks were aiming to a direction where only friendly tanks exists.
I noticed that the direction of the friendly fire seems to be always 225 deg.; which might mean this is a miss-fire; and the friendly was simply in the direction of the aim.
I have captured an example.

https://youtu.be/Ph29G9xbMV0

You can see that some tanks are shooting the friendly whom are in the middle of the troop; where no enemy exists.
Following is a slow-motion to see what is happening in a detail.

https://youtu.be/B77TwP6N9Bo

It seems like if the enemy which the tank was trying to shoot was already dead when the turret aimed to the direction, the tank shoots anyway and make the turret still rotating. And, when the turret angle became 225 deg., it shoots again, even though there is no enemy in the direction.
This is probably a bug, and might be a type which is a little bit difficult to fix...
So, I want to know if there are any idea to avoid this.

Text added:
Forgot to tell the version of MODs.
Factorio: 0.18.30
AAI Programmable Structures: 0.6.8
AAI Vehicles: Laser Tank: 0.5.1
Xavith
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Jun 10, 2020 2:55 pm
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Xavith »

Would it be possible to use any of the scanning equipment to set up a biter detection zone? If they're moving to attack an outpost for example. Or is it primarily for marking things as it scans them.
343N
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Feb 10, 2020 3:10 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by 343N »

I'm sure this has been suggested before but what about vehicles that can hold fluids? That have fluid tanks? Some fluids I can't barrel and so the only way to transfer them otherwise is with trains, but as with everything else in AAI I figured there'd be an alternative here but I can't find one.
TwoThrones
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Jun 17, 2020 10:09 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by TwoThrones »

Compatibility issue with Bob's Warfare
https://mods.factorio.com/mod/bobwarfare

without AAI Programmable Vehicles
1_1.jpg
1_1.jpg (650.46 KiB) Viewed 8872 times
1_2.jpg
1_2.jpg (681.49 KiB) Viewed 8872 times
with AAI Programmable Vehicles
2_1.jpg
2_1.jpg (588.09 KiB) Viewed 8872 times
2_2.jpg
2_2.jpg (600.83 KiB) Viewed 8872 times
Meculus
Burner Inserter
Burner Inserter
Posts: 5
Joined: Tue Oct 29, 2019 12:58 am
Contact:

Re: [MOD 0.14] AAI Programmable Vehicles

Post by Meculus »

Could you make it so that you could set certain vehicles to ignore the "only one weapon" thing? It breaks at least Angel's C.A.B., because the deploy and undeploy actions are counted as weapons.
Post Reply

Return to “Mods”