Why not figuring luxury as a propaganda form (newspapers, radio signals, etc) ?
You pathed the way to it . Please keep going with these playtest reviews. That's both making us drool and emulate creativity !That's actually a great idea, thank you!
error: bad return value #-1 from 'onChooseDefender' (civ.unit expected, got nil)
@Prof. Garfield I'm getting this error when I make repeated attacks with aircraft at 202,192 - there are 2x air units in the tile and 3x ground units in the tile. The first time that a fighter attacks, it does not produce the error, however it produces the error every time after that. The combat takes place, and the air unit is not the first chosen defender, instead the ground units below are killed one by one.
This is the entirety of the error. Any thoughts?
local function onChooseDefender(defaultFunction,tile,attacker,isCombat)
-- compute the desired defender
return desiredDefender
end
local function chooseDefender(defaultFunction,tile,attacker,isCombat)
--transport.onChooseDefender(defaultFunction,tile,attacker,isCombat)
local function hasAirGroundStack(tile)
local groundOrSea = false
local air = false
if tile.city or gen.hasAirbase(tile) then
return false
end
for unit in tile.units do
if gen.isCarryAir(unit.type) then
return false
end
if unit.type.domain ==1 and unit.type.range >= 2 then
air = true
else
groundOrSea = true
end
end
return air and groundOrSea
end
local function adjustedAttack(unit)
local attack = unit.type.attack
if unit.veteran then
attack = attack*1.5
end
return attack
end
-- note: this doesn't factor in much,
-- since air units don't gain terrain
-- bonus, and don't have a vs air bonus
local function adjustedDefense(airUnit)
local defense = airUnit.type.defense
if airUnit.veteran then
defense = defense*1.5
end
return defense
end
local function defenseRating(airUnit)
return adjustedDefense(airUnit)*(airUnit.hitpoints)//(airUnit.type.hitpoints)
end
local function selectAirDefender(tile)
local unitChosen = nil
local defensiveValue = 0
for airUnit in tile.units do
if airUnit.type.domain ==1 and airUnit.type.range >= 2 then
local ad = defenseRating(airUnit)
if ad > defensiveValue then
defensiveValue = ad
unitChosen = airUnit
end
end
end
return unitChosen
end
if gen.isAttackAir(attacker.type) and hasAirGroundStack(tile) then
return selectAirDefender(tile)
else
return defaultFunction(tile,attacker)
end
end
civ.scen.onChooseDefender(chooseDefender)
local defensiveValue = -1
if ad > defensiveValue then
defensiveValue = ad
unitChosen = airUnit
end
return selectAirDefender(tile)
return selectAirDefender(tile) or defaultFunction(tile,attacker)
And what does Gefechtsverband mean?
Interesting. Can you replenish your fuel supplies by capturing Baku and/or Iraqi cities?
Near as I can tell, it was what the air wing equivalent of a "Kampfgruppe" would be. In this scenario, your 4 general units are able to hastily scrape together a group of ground forces or an air wing. It's expensive, given the 5,000 cost, but can help restore a situation or help prepare for an important operation. To use it, your general has to have full movement points and you need the available fuel. You also can't form one in England, Africa, or North America.