i want to make buildings auto repair when near certain buildings just like how troops get auto healed when near town center, however i cant seem to figure ut out how. any leads ?
// city-related area effect
DbAreaEffectInfo CityHeal
{
name = text_uarea_cityheal_name
desc = text_uarea_cityheal_desc
button = ""
selectionType = None
effects = [
// One for me...
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = LandRPS
player = Self
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
}
// One for mah homies... yeeeah
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = LandRPSNoSpy // Don't heal allies' spies.
player = Allies
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
EffectHeal {
}
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Self
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
}
// One for mah homies... yeeeah
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Allies
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
}
]
}
this is what i have done, tried to integrate auto repair to city heal, but apparently it didnt worked, looks like i have UPGRADEFACTOR wrong, any leads on this will be appreciated
Buildings Auto Repair
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Buildings Auto Repair
If you use Unofficial Patch 1.5 (non developers version), then you need to add this effect to file:
\zips\dbareaeffects_unittype.ddf
for both, EE2 and AOS use the same file!
Then you need to attach this effect to some unit, for example city center. So you should edit file:
\zips\db_155.zip\db\Units\city_center_15.ddf
Change:
to:
Then the game should read your effect and repair buildings (if the effect is correct).
If the game crashes on launch after your modification, then the effect has some errors that you need to find and fix.
\zips\dbareaeffects_unittype.ddf
for both, EE2 and AOS use the same file!
Then you need to attach this effect to some unit, for example city center. So you should edit file:
\zips\db_155.zip\db\Units\city_center_15.ddf
Change:
Code: Select all
effects = [
CityHeal
CityResistCapture
]
Code: Select all
effects = [
CityHeal
CityResistCapture
YourNewEffectName
]
If the game crashes on launch after your modification, then the effect has some errors that you need to find and fix.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Buildings Auto Repair
well, i did all that but it didnt worked, no crashes, i think i really need to what what type of upgradefactor i should add o.o
here's the code
added that to outpost
here's the code
Code: Select all
DbAreaEffectInfo AutoRepair
{
name = text_uarea_cityheal_name
desc = text_uarea_cityheal_desc
button = ""
selectionType = None
effects = [
// One for me...
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Self
upgradeFactor = RepairRate
applyEffectHealRateModifier = true
}
// One for mah homies... yeeeah
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Allies
upgradeFactor = RepairRate
applyEffectHealRateModifier = true
}
]
}
Code: Select all
abilities = [
Attack { range = 0; reloadTime = 1; applyDamageTime = 0.0; damage = 0; missileName = "Arrow"; angularRange = 360 }
LOS { range = 0 }
AreaEffectCity {
CityRadius = 15.0
RepairRate = 12 // per second
effects = [
AutoRepair
]
}
]
}
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Buildings Auto Repair
Then your effect is incorrect maybe?
I found some auto-repair effect from iwanicki's Realistic mod:
Try to re-make it to work with city centers and buildings you want to repair.
I found some auto-repair effect from iwanicki's Realistic mod:
Code: Select all
DbAreaEffectInfo FactoryRepair
{
button = ""
selectionType = None
effects = [
EffectVisualGlow {
range = RadiusFromUnit
radius = 7
mask = FactoryRepairUnits
player = Self
OwnerOnly = true
Icon = spr_game_unitinfFacRep
Tooltip = tt_power_factory_fallout
VTooltip = vtt_power_factory_fallout
}
EffectHeal {
range = RadiusFromUnit
radius = 7
mask = FactoryRepairUnits
player = Self
healRate = 30
}
]
}
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Re: Buildings Auto Repair
finally got it to work
that will give area effect healing to the buildings nearby
Code: Select all
DbAreaEffectInfo AutoRepair
{
name = text_uarea_cityheal_name
desc = text_uarea_cityheal_desc
button = ""
selectionType = None
effects = [
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Self
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
}
EffectHeal {
range = CityUnitIsIn
radius = 0 // implied through range
mask = Buildings
player = Allies
upgradeFactor = CityHealRate
applyEffectHealRateModifier = true
}
]
}
- Dr.MonaLisa
- High Representative
- Posts: 8708
- Joined: 17 Jun 2010, 11:21
- Location: Poland
- Has thanked: 49 times
- Been thanked: 108 times
Re: Buildings Auto Repair
I would modify it a little. You don't need separated player for Allies and Self. There are options for both. I don't remember now but it can be found in hdrs.zip.
Also how many health points are restored by this effect?
Also how many health points are restored by this effect?
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains