[MOD 0.14] AAI Programmable Vehicles
-
- Inserter
- Posts: 23
- Joined: Fri Jun 02, 2017 1:21 pm
- Contact:
Re: [MOD 0.14] AAI Programmable Vehicles
you can already provide distance and angle signals to a follow unit or player signal to make a custom formation
Re: [MOD 0.14] AAI Programmable Vehicles
I guess it's questionable whether this is a mod issue, but when I removed the AAI mod set from my save (since I wasn't using it this game), Factorio deleted my cars & tanks, including trunk contents (fuel & ammo stockpiles, mostly). I assume this is because AAI replaced the vanilla versions I had built before installing the mods with custom entities (would explain why my tank went from three weapons to one). Not sure if there's anything to be done from the mod side about this (since by the time the mod is deleted, you can't run any migration scripts!), but thought it warranted a mention.
Re: [MOD 0.14] AAI Programmable Vehicles
Something seems wrong with blueprint building. I managed to gather up some virtual objects somehow, and the scanners on my stamped down blueprint don't seem to work.
Re: [MOD 0.14] AAI Programmable Vehicles
I finally got back into the save....sumdawgy wrote: IT worked fine before i got a decider connected to it....hm.
IT WAS the decider...must've been half asleep. I inserted it into the logic flow in an off cycle/tick from the rest of the data. Did it twice...but got lucky with the first one's timing....
thanks guys!
Re: [MOD 0.14] AAI Programmable Vehicles
Found a bug with Aircraft Mod and AAI PV:
I built an airplane with rocket weapon, placed it down, put "Vehicle Fuel" on it, after it used fully the 2nd unit of fuel, the vehicle just stop completely and didn't want to move again even picking it up and popping it down didn't make it move. The vehicle could turn but not move forward or backwards. Vehicle itself is the Flying Fortress. Tried putting other types of fuel on it and it didn't fill the fuel bar. I installed Electric Vehicles mod, put the electric engine on the plane and then it filled the fuel bar and started to move again.
I built an airplane with rocket weapon, placed it down, put "Vehicle Fuel" on it, after it used fully the 2nd unit of fuel, the vehicle just stop completely and didn't want to move again even picking it up and popping it down didn't make it move. The vehicle could turn but not move forward or backwards. Vehicle itself is the Flying Fortress. Tried putting other types of fuel on it and it didn't fill the fuel bar. I installed Electric Vehicles mod, put the electric engine on the plane and then it filled the fuel bar and started to move again.
Re: [MOD 0.14] AAI Programmable Vehicles
Did you already have the Electric Vehicles mod or did you only install that after the problem started?Mobius1 wrote:Found a bug with Aircraft Mod and AAI PV:
I built an airplane with rocket weapon, placed it down, put "Vehicle Fuel" on it, after it used fully the 2nd unit of fuel, the vehicle just stop completely and didn't want to move again even picking it up and popping it down didn't make it move. The vehicle could turn but not move forward or backwards. Vehicle itself is the Flying Fortress. Tried putting other types of fuel on it and it didn't fill the fuel bar. I installed Electric Vehicles mod, put the electric engine on the plane and then it filled the fuel bar and started to move again.
Re: [MOD 0.14] AAI Programmable Vehicles
After the problem. Also I'm running a shitload of mods:Earendel wrote:Did you already have the Electric Vehicles mod or did you only install that after the problem started?
mods
- regedit2000
- Inserter
- Posts: 20
- Joined: Mon May 23, 2016 4:00 pm
- Contact:
Re: [MOD 0.14] AAI Programmable Vehicles
fixed function in control.lua:Earendel wrote:Did you already have the Electric Vehicles mod or did you only install that after the problem started?Mobius1 wrote:Found a bug with Aircraft Mod and AAI PV:
I built an airplane with rocket weapon, placed it down, put "Vehicle Fuel" on it, after it used fully the 2nd unit of fuel, the vehicle just stop completely and didn't want to move again even picking it up and popping it down didn't make it move. The vehicle could turn but not move forward or backwards. Vehicle itself is the Flying Fortress. Tried putting other types of fuel on it and it didn't fill the fuel bar. I installed Electric Vehicles mod, put the electric engine on the plane and then it filled the fuel bar and started to move again.
Code: Select all
local function consume_fuel_or_equipment (unit)
if unit.vehicle.grid and unit.vehicle.grid.available_in_batteries > 10000 then
--Added by Undarl; basic battery fueling logic courtesy of Sirenfal
---Modified by the Nexela
local player = game.players[1]
player.print("consume_fuel_or_equipment")
unit.vehicle.burner.currently_burning = high_fuel_item
local energy_deficit = game.item_prototypes[high_fuel_item].fuel_value - unit.vehicle.burner.remaining_burning_fuel
local batteries = table.filter(unit.vehicle.grid.equipment, function(v) return v.type == "battery-equipment" end)
if batteries then player.print("batteries is present(" .. #batteries .. ") energy = " .. unit.vehicle.grid.available_in_batteries) end
local num_batteries = #batteries
while num_batteries > 0 and energy_deficit > 0 do
local battery = batteries[num_batteries]
local energy_used = math.min(battery.energy, energy_deficit)
player.print("energy_deficit(" .. energy_deficit .. ") energy battery = " .. battery.energy)
player.print("energy_used(" .. energy_used .. ")")
battery.energy = battery.energy - energy_used
unit.vehicle.burner.remaining_burning_fuel = unit.vehicle.burner.remaining_burning_fuel + energy_used
energy_deficit = energy_deficit - energy_used
num_batteries = num_batteries - 1
end
else
for _, inv_num in pairs(inv_nums) do
local inventory = unit.vehicle.get_inventory(inv_num)
if inventory then
local contents = inventory.get_contents()
local fuel_item = get_fuel.item(contents)
if fuel_item then
if inv_num ~= defines.inventory.fuel then
if contents[fuel_item.name] > 1 then
-- move fuel to fuel inventory
unit.vehicle.burner.currently_burning = fuel_item.name
unit.vehicle.burner.remaining_burning_fuel = unit.vehicle.burner.remaining_burning_fuel + fuel_item.fuel_value
local fuel_inv = unit.vehicle.get_inventory(defines.inventory.fuel)
local inserted = fuel_inv.insert{name = fuel_item.name, count = contents[fuel_item.name] -1}
if inserted > 0 then
inventory.remove({name = fuel_item.name, count = inserted})
end
else
unit.vehicle.burner.currently_burning = fuel_item.name
unit.vehicle.burner.remaining_burning_fuel = unit.vehicle.burner.remaining_burning_fuel + fuel_item.fuel_value
inventory.remove({name=fuel_item.name, count=1})
end
else
-- burning from correct slot
unit.vehicle.burner.currently_burning = fuel_item.name
unit.vehicle.burner.remaining_burning_fuel = unit.vehicle.burner.remaining_burning_fuel + fuel_item.fuel_value
inventory.remove({name=fuel_item.name, count=1})
return true
end
end
end
end
end
end
Re: [MOD 0.14] AAI Programmable Vehicles
My game currently crashes a few moments in this savegame. No entry in the log is detectable, unfortunately. I strongly suspect it is AAI, as some tanks are getting orders right then, but I have no idea how to debug it.
Edit: It does seem to happen when one tank paths into some walls
Edit: It does seem to happen when one tank paths into some walls
- Attachments
-
- buggedSavegame.zip
- (14.06 MiB) Downloaded 124 times
Idle Signal.
Would be possible to add one more signal to the unit scanner reads. An IsIdle signal? so you don't have to "guess" base on the last command or with some math on the X and Y if the last command was done.
Something like a signal that appears as 1 [or total idle time] since the last command was completed (when the unit has stopped all actions like [not shotting, not moving, not mining, or whatever]).
Something like a signal that appears as 1 [or total idle time] since the last command was completed (when the unit has stopped all actions like [not shotting, not moving, not mining, or whatever]).
Re: [MOD 0.14] AAI Programmable Vehicles
How to setup vehicle color? I see colored vehicles on your screens, but cant get it too.
And is there any signal to cancel current order? I wanted to send Speed 0 but than realized its not signal at all, than I tried signal X and Y of that vehicle, but instead of just stop its "moving" on place...
And is there any Discord channel for AAI?
And is there any signal to cancel current order? I wanted to send Speed 0 but than realized its not signal at all, than I tried signal X and Y of that vehicle, but instead of just stop its "moving" on place...
And is there any Discord channel for AAI?
Re: [MOD 0.14] AAI Programmable Vehicles
Thanks, added.regedit2000 wrote: fixed function in control.lua:
There is time since last moved and time since last targeted enemy. It's not aware of things like mining or other things that special vehicles do.Sworn wrote:Would be possible to add one more signal to the unit scanner reads. An IsIdle signal? so you don't have to "guess" base on the last command or with some math on the X and Y if the last command was done.
Something like a signal that appears as 1 [or total idle time] since the last command was completed (when the unit has stopped all actions like [not shotting, not moving, not mining, or whatever]).
The API limitation means that the vehicle color can only be changed by a player getting in, there's not much I can do about that.Berkys32 wrote:How to setup vehicle color? I see colored vehicles on your screens, but cant get it too.
And is there any signal to cancel current order? I wanted to send Speed 0 but than realized its not signal at all, than I tried signal X and Y of that vehicle, but instead of just stop its "moving" on place...
And is there any Discord channel for AAI?
A speed of 1 or -1 is so slow that it will never actually move (due to pixel snapping) so that's effectively stopped.
There's no discord channel, but I am discord.
Re: [MOD 0.14] AAI Programmable Vehicles
Could you explain how the [Time since moved tile] is updated? I was making some test with it and build the following setup:Earendel wrote:regedit2000 wrote:There is time since last moved and time since last targeted enemy. It's not aware of things like mining or other things that special vehicles do.Sworn wrote:Would be possible to add one more signal to the unit scanner reads. An IsIdle signal? so you don't have to "guess" base on the last command or with some math on the X and Y if the last command was done.
Something like a signal that appears as 1 [or total idle time] since the last command was completed (when the unit has stopped all actions like [not shotting, not moving, not mining, or whatever]).
GO: define if an hauler is idle.
Test: At first I tried with the speed signal [speed signal = 0], but some times the vehicle stop during turns [maybe for path finding].
So i tried to combine the [speed] signal with the [Time since moved tile] signal. That seems to work but some times it gave me a false idle hauler.
Setup: First decider output A = 1 when the speed = 0, second decider output A = 1 when [Time since moved tile] > 400. Final the last decider output I = 1 when A = 2.
But sometimes the [Time since moved tile] has pass the 400 before reseting during the path and once it hits more then 1k.
I'm currently using the [Time since moved tile] greater then 1k, but it depends on how the signal is updated.
Last edited by Sworn on Sun Jul 02, 2017 9:20 pm, edited 1 time in total.
Re: [MOD 0.14] AAI Programmable Vehicles
Signal "Time since moved tile" > 500 seems quite enough for me, even in case it got stuck bcs of tree...
Im not sure what do you mean by "move to tile" signal. You mean go to x/y pos?
Im not sure what do you mean by "move to tile" signal. You mean go to x/y pos?
Re: [MOD 0.14] AAI Programmable Vehicles
Berkys32 wrote:Signal "Time since moved tile" > 500 seems quite enough for me, even in case it got stuck bcs of tree...
Im not sure what do you mean by "move to tile" signal. You mean go to x/y pos?
ops, was supposed to be "Time since moved tile", forgot the name of the signal, thanks i'll correct it.
Re: [MOD 0.14] AAI Programmable Vehicles
The movement timer gets reset if the XY tile changes. Subtile changes don't reset it, it has to actually move from 1 square to another on the grid that you see with F5. If a vehicle is slow the timer can get higher. If a vehicle gets nudged by damage it usually won't reset the timer but can if it was on the edge.
Re: [MOD 0.14] AAI Programmable Vehicles
Got it. thanks that explain why some times it goes really high and some times reset before 10.
Re: [MOD 0.14] AAI Programmable Vehicles
Would it be possible to add a setting to toggle the 1-weapon-per-vehicle mechanic? It's possible to disable it by deleting a few bits in entity-update and entity-update-external but its kind of annoying doing it after every update.
-
- Inserter
- Posts: 23
- Joined: Fri Jun 02, 2017 1:21 pm
- Contact:
Re: [MOD 0.14] AAI Programmable Vehicles
how feasable is it to allow vehicles with a color signal or something similar to take on that color on their exterior, similar to how when a player of a particular color is controlling them?
it would be nice to visually organize them
it would be nice to visually organize them
Re: [MOD 0.14] AAI Programmable Vehicles
Which bits exactly have to be deleted? I broke the mod trying to accomplish that.buggy123 wrote:Would it be possible to add a setting to toggle the 1-weapon-per-vehicle mechanic? It's possible to disable it by deleting a few bits in entity-update and entity-update-external but its kind of annoying doing it after every update.