Trying to mod in a new unit

Modding, Map Editor, IES Scripting and Other Questions
crazyewok
Posts: 22
Joined: 03 Mar 2014, 11:23

Re: Trying to mod in a new unit

Post by crazyewok »

Ok new question.

How did you add the Radar/ Anti missile defence in?

I would like to add a similar thing into the realism mod.

I have the Radar in.  But the Atni missile  does not seem to attack incoming missiles.

I have add lines in the area affect files  similar to the 1.5 mod

DbAreaEffectInfo AntiMissileMember
{
button = ""
selectionType = None
     effects = [
EffectVisualGlow {
range = Unit
GlowType = Mixed
mask = TT_AirDefense3
player = Anybody
OwnerOnly = false
Icon = spr_game_antimissile
Tooltip = tt_power_antimissile
VTooltip = vtt_power_antimissile
}
           EffectShotSuccessRate {
range = Unit
mask = TT_AirDefense3
player = Anybody
affectedProjectileMoveTypes = [
GuidedMissile, // anti-missile
]
// allow 80% of shots to succeed
successRate = 0.8
}

           
]
}

DbAreaEffectInfo Radar
{
button = ""
selectionType = None
effects = [
EffectGiveLOS {
range = Global_Unit
player = NonSelf
mask = AwacsRuled2
}
         
]
}


-------------


For the unit files I have

UnitType AirDefense3
{
ownerType = PlayerOnly
parent = NoProduceBuilding
properties {
rps = AntiAircraft
SizeX = 1
SizeY = 1
FootprintSizeX = 2.5
FootprintSizeY = 2.5
OffsetX = 0.75
OffsetY = 0.75
mass = 1
hitpoints = 400
displayName = tx_utn_airdefense3_name
DisplayNameScenEdit = tx_utn_airdefense3_sname
VerboseTooltip = vtt_unit_AirDefense
}
sounds {
sndSelection = ["AirDefense_select"]
  }
abilities = [
AreaEffect {
effects = [
AntiMissileMember
]
}
// @AA - removed: 'missileName = "Flak01"' from attack ability, this one wants to have instant hits
Attack { damage = 250; range = 50; reloadTime = 10; angularRange = 360; applyDamageTime = 0.5; missileName = "SA2Missile"; ignoreBlocking = 1; turretControllerName = TankTurret; areaDamageRadius = 2; throwUnits = true }
LOS { range = 11 }
]
icon = icon_unit_airdefense_13
}



UpgradeAbilities AirDefense3Upgrade
{
upgradedAbilities = [
Attack { damage = 0; range = 0; reloadTime = 666; angularRange = 360; applyDamageTime = 0.5; missileName = "SA2Missile"; ignoreBlocking = 1; turretControllerName = TankTurret; areaDamageRadius = 2; throwUnits = true}
]
}



UnitModel AirDefense3
{
Parent = BuildingWithTurrets
DefaultModel = bld_sa2.NIF
States = [
{ StateName= Attack1 AnimName = lla11_aahalftrack_attack.KF
TextKeys = [
    { Name = PLAY_SOUND Data = fx_battle_rocket_launch KeyTime = 0.5 }
  ]
}

]
ChildNames = [ MediumGlow ExplSelectorBuild_Tiny ]
}

Name changed to AirDefense3 as there already was a AirDefense2

User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Trying to mod in a new unit

Post by Dr.MonaLisa »

And did you define "TT_AirDefense3" and "AwacsRuled2"?
They're defined in zips/dbunittypeattributes.ddf

Also check files:
epoch1_upgrades_15.ddf

Code: Select all

// UP1.5:
      RadarICBMTargEnable
      AirDefense2UpgradeEpoch13
upgrade_factorse5.csv

Code: Select all

//Unofficial Patch 1.5,,,,,,,,
RadarICBMTargEnable,,TT_AirDefense2,,0,ICBMTargetingProbability,Add,100,0
Without ICBMTargetingProbability it won't work Image
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
crazyewok
Posts: 22
Joined: 03 Mar 2014, 11:23

Re: Trying to mod in a new unit

Post by crazyewok »

Thats likley what I was missing so add this:
UnitTypeAttribute TT_AirDefense3 {
UnitTypeFamilies = [
AirDefense3
Radar
Thaad
]
}

UnitTypeAttribute AntiMissileDefense {
UnitTypeFamilies = [
AirDefense3
AirDefense
]
}

UnitTypeAttribute AwacsRuled2 {
UnitTypeFamilies = [
ICBM
MGMNuke
SubNuke
V2Nuke
Scud15Nuke
]

Rpelaces the Antiairdefence2 with 3?
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Trying to mod in a new unit

Post by Dr.MonaLisa »

Rpelaces the Antiairdefence2 with 3?
Depends on how you named UnitType of the new Air Defense (this big missile) Image
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
crazyewok
Posts: 22
Joined: 03 Mar 2014, 11:23

Re: Trying to mod in a new unit

Post by crazyewok »

Leader wrote:
Rpelaces the Antiairdefence2 with 3?
Depends on how you named UnitType of the new Air Defense (this big missile) Image
I named the unit type 3 due to 2 already in use.


-----------------


O and as its the expansion Im using should I not be using zips_ee2x unless im adding textures and graphic?


Please don't double/triple post. Your post need to be separated by 24 hours before bumping, replying or adding more information. Please use the edit button instead!
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Trying to mod in a new unit

Post by Dr.MonaLisa »

Use zips/dbunittypeattributes.ddf (not zips_ee2x), because this file is read by both: EE2 and EE2X.

Rest (epoch1_upgrades_15.ddf, upgrade_factorse5.csv) edit in EE2X_db_150.zip

Textures and graphics should be in zips/graphics_150, zips/textures_150 (not zips_ee2x). You can add it also to graphics_170, textures_170 or any other folder (to not mix it with UP1.5 textures/graphics).
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
crazyewok
Posts: 22
Joined: 03 Mar 2014, 11:23

Re: Trying to mod in a new unit

Post by crazyewok »

Ok after days of fiddling about I still cant get the anti missile ability in Image


The Radar building and anti missile building appear in the game fine with no crashing but without the ability.

Il post what I have edited. The building are named Radar and Anti air defence 3 have not changed the ability's names.

for unit file in the zips_ee2x\EE2X_db.zip\EE2X_db\Units file.



UnitType Bld_radar
{
parent = NoProduceBuilding
properties {
SizeX = 1
SizeY = 1
rps = Building
mass = 1
displayName = tx_radar_name
DisplayNameScenEdit = tx_radar_name
VerboseTooltip = vtt_radar
HitPoints = 3000
}
sounds {
sndSelection = ["radar_select01" "radar_select02" "radar_select03" "radar_select04"]
}
abilities = [
Attack { range = 9999; reloadTime = 20; applyDamageTime = 0.5; damage = 0; missileName = "FastRocket4"; angularRange = 360; throwUnits = true }
LOS { range = 14 }
]
icon = icon_unit_outpost_7
}

UnitModel Bld_radar
{
Parent = BaseBuilding
DefaultModel = Bld_radar.nif
States = [
{ StateName="Idle" }
{ StateName = Attack1
TextKeys = [
{ Name = START_SOUND Data = fx_nuclear_siren KeyTime = 0 }
]
}
]
}



UnitType Radar
{
icon = icon_unit_monasradar
ownerType = PlayerOnly
parent = NoProduceBuilding
properties {
rps = LandNonCombat
SizeX = 2.5
SizeY = 4.0
mass = 1
displayName = tx_radar_name
DisplayNameScenEdit = tx_radar_name
VerboseTooltip = vtt_radar
HitPoints = 5500
stance = Aggressive
}
sounds {
sndSelection = ["radar_select01" "radar_select02" "radar_select03" "radar_select04"]
}
fullMapOverlay { sprite = spr_fullmap_house }
abilities = [
LOS { range = 15 }
AreaEffect {
effects = [
AntiMissileMember
//SuperVision
]
}
Attack { damage = 0; range = 150; reloadTime = 17; angularRange = 360; applyDamageTime = 0.5; missileName = "FastRocket5"; ignoreBlocking = 1; throwUnits = true}
Convertable {
convertTimeModifier = 100.0; //
garrisonedUnitModifier = 0.0; // 10% increase in capture time
garrisonedUnitDamage = 0.0; // hitpoints subtracted from capturer per round per garrisoned unit
damageRate = 0.0; // hitpoints subtracted from capture target hitpoints per round

}
]

}

UnitModel Radar
{
Parent = BaseBuilding_NoFoundation
DefaultModel = Bld_radar15.NIF
ChildNames = [ MediumGlow ExplSelectorBuild_Tiny ]
States = [
{ StateName = Idle AnimName = mona_radar_rotation_15.kf }
{ StateName= Attack1 TextKeys = [
{ Name = START_SOUND Data = fx_nuclear_siren2 KeyTime = 0 }
]
}

]
DamageDecalsSetName = BuildingDamageDecals
}

UnitType AirDefense3
{
ownerType = PlayerOnly
parent = NoProduceBuilding
properties {
rps = AntiAircraft
SizeX = 1
SizeY = 1
FootprintSizeX = 2.5
FootprintSizeY = 2.5
OffsetX = 0.75
OffsetY = 0.75
mass = 1
hitpoints = 400
displayName = tx_utn_airdefense3_name
DisplayNameScenEdit = tx_utn_airdefense3_sname
VerboseTooltip = vtt_unit_AirDefense
}
sounds {
sndSelection = ["AirDefense_select"]
}
abilities = [
AreaEffect {
effects = [
AntiMissileMember
]
}
// @AA - removed: 'missileName = "Flak01"' from attack ability, this one wants to have instant hits
Attack { damage = 250; range = 50; reloadTime = 10; angularRange = 360; applyDamageTime = 0.5; missileName = "SA2Missile"; ignoreBlocking = 1; turretControllerName = TankTurret; areaDamageRadius = 2; throwUnits = true }
LOS { range = 11 }
]
icon = icon_unit_airdefense2
}

UpgradeAbilities AirDefense2Upgrade
{
upgradedAbilities = [
Attack { damage = 0; range = 0; reloadTime = 666; angularRange = 360; applyDamageTime = 0.5; missileName = "SA2Missile"; ignoreBlocking = 1; turretControllerName = TankTurret; areaDamageRadius = 2; throwUnits = true}
]
}


UnitModel AirDefense3
{
Parent = BuildingWithTurrets
DefaultModel = bld_sa2.NIF
States = [
{ StateName= Attack1 AnimName = lla11_aahalftrack_attack.KF
TextKeys = [
{ Name = PLAY_SOUND Data = fx_battle_rocket_launch KeyTime = 0.5 }
]
}

]
ChildNames = [ MediumGlow ExplSelectorBuild_Tiny ]
}


For
C:\Users\michael\Downloads\EEmod\zips_ee2x\EE2X_db.zip\EE2X_db\TechTree\ upgrade_factorset

added to bottom line
RadarICBMTargEnable TT_AirDefense3 0 ICBMTargetingProbability Add 100 0 None


in epoch1_upgrades

/ Main1
UpgradeRefSet MainEpoch1 {
upgrades = [
AdvanceEpoch1
CityPlazaUpgradeEpoch1
CitizenUpgradeEpoch1
CitizenFUpgradeEpoch1
RegionPowerUpgrade_1
RadarICBMTargEnable
AirDefense3UpgradeEpoch13

PalisadeFragmentUpgradeEpoch1 // @TODO we should have a TT node for wall fragment, and just specify this there


Then
C:\Users\michael\Downloads\EEmod\zips_ee2x\EE2X_db.zip\EE2X_db\AreaEffects

DbAreaEffectInfo AntiMissileMember
{
button = ""
selectionType = None
effects = [
EffectVisualGlow {
range = Unit
GlowType = Mixed
mask = TT_AirDefense3
player = Anybody
OwnerOnly = false
Icon = spr_game_antimissile
Tooltip = tt_power_antimissile
VTooltip = vtt_power_antimissile
}
EffectShotSuccessRate {
range = Unit
mask = TT_AirDefense3
player = Anybody
affectedProjectileMoveTypes = [
GuidedMissile, // anti-missile
]
// allow 80% of shots to succeed
successRate = 0.8
}


]
}

DbAreaEffectInfo Radar
{
button = ""
selectionType = None
effects = [
EffectGiveLOS {
range = Global_Unit
player = NonSelf
mask = AwacsRuled2
}

]
}

Now I gone to C:\Users\michael\Downloads\EEmod\zips\db.zip\db\Simulation\dbunittypeattributes.ddf


added in
UnitTypeAttribute TT_AirDefense3 {
UnitTypeFamilies = [
AirDefense3
Radar
Thaad
]
}

UnitTypeAttribute AntiMissileDefense {
UnitTypeFamilies = [
AirDefense3
AirDefense
]
}

UnitTypeAttribute AwacsRuled2 {
UnitTypeFamilies = [
ICBM
MGMNuke
SubNuke
V2Nuke
Scud15Nuke
]
}

C:\Users\michael\Downloads\EEmod\zips_ee2x\EE2X_db.zip\EE2X_db\UI\UnpackedSprites\dbsprite_unitIcons.csv

added in bottom line:
spr_game_antimissile icon_antimissile.tga 0 0 32 32 0




Now im likely missing one simple thing......
User avatar
Dr.MonaLisa
High Representative
Posts: 8697
Joined: 17 Jun 2010, 11:21
Location: Poland
Has thanked: 49 times
Been thanked: 108 times

Re: Trying to mod in a new unit

Post by Dr.MonaLisa »

Once again, you didn't use excel right?
It looks a little incorrect for me:

Code: Select all

RadarICBMTargEnable   TT_AirDefense3   0   ICBMTargetingProbability   Add   100   0   None
No commas? How did you edit upgrade_factorset?
You're editing on the Realistic Mod, not EE2 1.5, right?

I think you shouldn't add RadarICBMTargEnable in upgrade_factorset at the end of the file, but for example after this:

Code: Select all

//General Use Upgrades,,,,,,,,,
TurnOffOutpostAttackAbility,,TT_Outpost,,0,LatentAttackAbility,Set,1,0,None
From my experience I know that if the new value is at the end of the file it's often not read by game...

Btw, you can ignore "UnitType Bld_radar" and "UnitModel Bld_radar" totally. It's just a model of the Radar from the Pre-Alpha release of UP1.5, and it's ugly.

Code: Select all

Now I gone to C:\Users\michael\Downloads\EEmod\zips\db.zip\db\Simulation\dbunittypeattributes.ddf
No, wait. EE2X won't read this file. It would read if "dbunittypeattributes.ddf" was in the zips folder (not db.zip). So in this case edit this file in: EE2X_db.zip\EE2X_db\Simulation\dbunittypeattributes.ddf

I did many tricks with files in EE2 1.5 to not edit db.zip and EE2X_db.zip. Othervise I wouldn't be able to support all languages. That's why it's so messed up.
Best regards,
Dr.MonaLisa
Ministry of Game Affairs
Department of Control and Complains
Post Reply

Return to “Questions”