if UnitBlueprint.CategoriesHash.TECH1 then
UnitBlueprint.General.UnitWeight = 1
end
Statistics: Posted by Uveso — 12 Mar 2018, 20:51
Statistics: Posted by speed2 — 12 Mar 2018, 19:54
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local ScenarioFramework = import('/lua/ScenarioFramework.lua')
function OnPopulate()
ScenarioUtils.InitializeArmies()
ScenarioFramework.SetPlayableArea('AREA_1', false)
local oldDamageArea = DamageArea
local radius = 25
local self = import('/lua/sim/Entity.lua').Entity()
local damage = 30
for k = 1, 1 do
local DAMAGEAREAName = 'DAMAGEAREA_' .. k
local location = ScenarioUtils.MarkerToPosition(DAMAGEAREAName)
local px, py, pz = unpack(location)
end
end
DamageArea = function(instigator, location, radius, damage, type, damageAllies, damageSelf, brain, army)
local army = ListArmies()
local rect = Rect(px-radius, pz-radius, px+radius, pz+radius)
local units = GetUnitsInRect(rect) or {}
local damageAllies = true
local damageSelf = true
for _, u in units do
if table.find(u:GetBlueprint().Categories,'MOBILE') then
continue
end
if VDist3(u:GetPosition(), location) > radius then
continue
end
if instigator == u then
if damageSelf then
local vector = import('/lua/utilities.lua').GetDirectionVector(location, u:GetPosition())
-- need this ugliness due to Damage() refuse to damage when instigator == u
instigator:OnDamage(instigator, damage, vector, 'Reclaimed')
end
elseif damageAllies or not IsAlly(army, u:GetArmy()) then
Damage(instigator, location, u, damage, 'Reclaimed')
end
end
local reclaim = GetReclaimablesInRect(rect) or {}
for _, r in reclaim do
if IsProp(r) and VDist3(r:GetPosition(), location) <= radius then
Damage(instigator, location, r, damage, 'Reclaimed')
end
end
-- Get rid of trees
oldDamageArea(instigator, location, radius, 1, 'Reclaimed', false, false)
end
function OnStart(self)
end
Statistics: Posted by Ghoustaq — 12 Mar 2018, 16:33
Statistics: Posted by Ghoustaq — 11 Mar 2018, 10:32
Statistics: Posted by speed2 — 11 Mar 2018, 09:51
Statistics: Posted by Ghoustaq — 11 Mar 2018, 09:27
GetArmyUnitCapCost()
GetArmyUnitCap()
SetArmyUnitCapCost()
SetArmyUnitCap()
SetArmyUnitCap( brain:GetArmyIndex() , ScenarioInfo.Options.UnitCap )
Statistics: Posted by Uveso — 11 Mar 2018, 02:46
Statistics: Posted by Sprouto — 10 Mar 2018, 20:48
Statistics: Posted by Ghoustaq — 10 Mar 2018, 18:23
Statistics: Posted by DDDX — 10 Mar 2018, 00:42
function EditBlueprints(self)
for UnitID, UnitBlueprint in __blueprints do
if (UnitID == 'xsb2401') then -- Yolona Oss
UnitBlueprint.Intel.VisionRadius = 5
UnitBlueprint.Defense.Health = 22000
UnitBlueprint.Defense.MaxHealth = 22000
end
end
end
__blueprints['xsb2401'].Defense.Health = 22000
Statistics: Posted by Uveso — 09 Mar 2018, 23:55
function OnStart(self)
LOG("----- Survival MOD: Initializing game start sequence...");
ForkThread(Survival_Tick);
EditBlueprints(self)
end
function EditBlueprints(self)
for UnitID, UnitBlueprint in __blueprints do
if (UnitID == 'XSB2401') then -- Yolona
XSB2401_unit.bp.Defense.Health = 22000; -- tried with UnitBlueprint.Defense.Health etc, nope
XSB2401_unit.bp.Defense.MaxHealth = 22000;
end
end
end
Statistics: Posted by DDDX — 09 Mar 2018, 21:35
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
function OnPopulate()
ScenarioUtils.InitializeArmies()
end
function OnStart(self)
EditBlueprints(self)
end
function EditBlueprints(self)
for UnitID, UnitBlueprint in __blueprints do
-- If we have no Categories then skip this unit and continue with the next unit
if not UnitBlueprint.Categories then
continue
end
-- Generate the CategoriesHash for non FAF game
UnitBlueprint.CategoriesHash = {}
for _, cat in UnitBlueprint.Categories do
UnitBlueprint.CategoriesHash[cat] = true
end
-- fist check if we have a UnitBlueprint.Intel table, then check if we have a VisionRadius table inside UnitBlueprint.Intel
if UnitBlueprint.Intel and UnitBlueprint.Intel.VisionRadius then
LOG('Unit '..UnitID..' has a value of '..UnitBlueprint.Intel.VisionRadius..' as VisionRadius')
if UnitBlueprint.CategoriesHash.TECH1 then
LOG('Unit '..UnitID..' is a TECH1 unit. Seting VisionRadius to 1')
UnitBlueprint.Intel.VisionRadius = 1
end
if UnitBlueprint.CategoriesHash.TECH2 then
LOG('Unit '..UnitID..' is a TECH2 unit. Seting VisionRadius to 2')
UnitBlueprint.Intel.VisionRadius = 2
end
if UnitBlueprint.CategoriesHash.TECH3 then
LOG('Unit '..UnitID..' is a TECH3 unit. Seting VisionRadius to 3')
UnitBlueprint.Intel.VisionRadius = 3
end
if UnitBlueprint.CategoriesHash.HYDROCARBON then
LOG('Unit '..UnitID..' is a HYDROCARBON unit. Seting VisionRadius to 5')
UnitBlueprint.Intel.VisionRadius = 5
end
else
LOG('Unit '..UnitID..' don\'t has a VisionRadius')
end
end
end
Statistics: Posted by Uveso — 08 Mar 2018, 04:08