Posted by: Annihilationzh - Sunday, August 14, 2011 12:11:36 PM
I am writing this assuming you have moderate experience with INI code.
[u][size=6][b]Objects and Modules[/b][/size][/u]
There are three things you can do with Modules.
Add:
[code] AddModule ModuleTag_XX
Behavior = YYY ModuleTag_XX
[parameters]
End
[You can put other modules here]
End[/code]
Remove:
[code] RemoveModule ModuleTag_XX[/code]
The easy one. It simply removes a module, so nothing else needs to be stated in the code.
There is also a replace module that should never be used:
[code] ReplaceModule ModuleTag_XX_Override
Behavior = YYY ModuleTag_XX
[parameters]
End
End[/code]
This module causes crashes with some modules. Just use Remove and Add if you want to replace a module.
Other code, such as ArmorSet, WeaponSet, and geometry do not need any extra code. They can be copied directly from normal INI code. There is an exception with locomotors, which require the AIUpdate to be replaced before the locomotor is specified. The same is true in reverse, if you replace an AIUpdate, you need to include the locomotor. Remember, locomotors always go AFTER the AIUpdate.
[u][size=6][b]OCLs, CommandButtons, and more[/b][/size][/u]
Most other code (code not in the Object folder of the INI files), from OCLs to CommandButtons and CommandSets can be used the same way they would be in the INI files. For example:
[code=java]ObjectCreationList SUPERWEAPON_AnthraxBombGamma
DeliverPayload
Transport = GLAJetCargoPlane
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes
MaxAttempts = 1
DropOffset = X:0 Y:0 Z:-10
Payload = AnthraxBombGamma
DeliveryDistance = 140
DeliveryDecalRadius = 200
DeliveryDecal
Texture = SCCAnthraxBomb_GLA
Style = SHADOW_ALPHA_DECAL
OpacityMin = 25%
OpacityMax = 50%
OpacityThrobTime = 500
Color = R:33 G:255 B:67 A:255
OnlyVisibleToOwningPlayer = Yes
End
End
DeliverPayload
Transport = AmericaJetB3
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes
MaxAttempts = 1
DropOffset = X:0 Y:0 Z:-10
Payload = MOAB
DeliveryDistance = 160
PreOpenDistance = 160
DeliveryDecalRadius = 170
DeliveryDecal
Texture = SCCFuelAirBomb_USA
Style = SHADOW_ALPHA_DECAL
OpacityMin = 25%
OpacityMax = 50%
OpacityThrobTime = 500
Color = R:255 G:0 B:0 A:255
OnlyVisibleToOwningPlayer = Yes
End
End
DeliverPayload
Transport = ChinaJetCargoPlane
StartAtPreferredHeight = Yes
StartAtMaxSpeed = Yes
MaxAttempts = 4
DropOffset = X:0 Y:0 Z:-2
DropVariance = X:20 Y:20 Z:0
Payload = EMPPulseBomb 1
DeliveryDistance = 150
DeliveryDecalRadius = 200
DeliveryDecal
Texture = SCCEMPPulse_China
Style = SHADOW_ALPHA_DECAL
OpacityMin = 25%
OpacityMax = 50%
OpacityThrobTime = 500
Color = R:40 G:110 B:210 A:255
OnlyVisibleToOwningPlayer = Yes
End
End
End[/code]
This will replace the anthrax bomb with three planes, one drops the anthrax bomb, another drops a MOAB, and the final one drops an EMP bomb.
[u][size=6][b]Examples and applicable topics[/b][/size][/u]
For a great example of map.ini code to learn from, I suggest Beng's Bushehr: Operation Partisans' Challenge, which you can download here:
http://www.cnclabs.com/downloads/details.aspx?id=274
Here's an in-depth explanation thread with examples:
http://www.cnclabs.com/forums/cnc_postst11271_I-need-help-with-a-map-ini.aspx
[u][size=6][b]Glitches[/b][/size][/u]
Map.inis are prone to glitches. Some bugs include:
Unit costs and build times cannot be altered. They will display a new price in game, but not change anything.
Unit limits also have a glitch. They will allow you to queue as many as you want to until you have actually reached the limit on the map. For example, if you add a limit of 1 to rangers, you will be able to queue 9 rangers per barracks until the first one is finished.
[u][size=6][b]Questions and closing statements[/b][/size][/u]
Please do not ask for help in this topic. Please start your own topic in the Mapping or modding forum sections.
I hope to update this as I remember other things you can do with a Map.ini. Please, if you're reading this and know of anything I've missed out, do not be reluctant to comment.
Posted by: Annihilationzh - Sunday, July 22, 2012 6:49:57 PM
[code=java]CommandSet AirF_AmericaAirfieldCommandSet
3 = SupW_Command_ConstructAmericaJetAurora
5 = Nuke_Command_ConstructChinaJetMIG
6 = Infa_Command_ConstructChinaVehicleHelix
End
CommandSet AirF_AmericaDozerCommandSet
1 = AirF_Command_ConstructAmericaAirfield
2 = Command_ConstructGLAVehicleCombatBikeRocket
3 = AirF_Command_ConstructAmericaSupplyCenter
4 = Command_ConstructGLAVehicleCombatBikeRocket
5 = Command_ConstructGLAVehicleCombatBikeRocket
6 = Command_ConstructGLAVehicleCombatBikeRocket
7 = Command_ConstructGLAVehicleCombatBikeRocket
8 = Command_ConstructGLAVehicleCombatBikeRocket
9 = Command_ConstructGLAVehicleCombatBikeRocket
11 = Command_ConstructGLAVehicleCombatBikeRocket
13 = Command_ConstructGLAVehicleCombatBikeRocket
End
CommandSet AirF_AmericaSupplyCenterCommandSet
2 = Infa_Command_ConstructChinaInfantryMiniGunner
3 = AirF_Command_ConstructAmericaDozer
4 = AirF_Command_ConstructAmericaInfantryPathfinder
End
Object AirF_AmericaSupplyCenter
EnergyProduction = 0
Prerequisites
End
End
Object AirF_AmericaInfantryPathfinder
Prerequisites
End
End
Object AirF_AmericaVehicleDozer
ArmorSet
Conditions = None
Armor = AvengerArmor
DamageFX = TankDamageFX
End
End
Object SupW_AmericaJetAurora
UpgradeCameo1 = AirF_Upgrade_Countermeasures
Prerequisites
End
AddModule ModuleTag_Laser_One_Override
Behavior = PointDefenseLaserUpdate ModuleTag_Laser_One
WeaponTemplate = AirF_PointDefenseLaser
PrimaryTargetTypes = BALLISTIC_MISSILE SMALL_MISSILE
ScanRate = 0
ScanRange = 200.0
PredictTargetVelocityFactor = 1.0
End
End
End
Object Infa_ChinaInfantryMiniGunner
UpgradeCameo1 = Infa_Upgrade_Fanaticism
UpgradeCameo2 = Infa_Upgrade_Fanaticism
Prerequisites
End
RemoveModule ModuleTag_06
RemoveModule ModuleTag_08
End
Object TechOilDerrick
ArmorSet
Conditions = None
Armor = BattleBusStructureArmorToughPlusTwo
DamageFX = StructureDamageFXNoShake
End
ReplaceModule ModuleTag_03
Body = ActiveBody ModuleTag_03_Override
MaxHealth = 6000.0
InitialHealth = 6000.0
End
End
AddModule ModuleTag_Heal_Override
Behavior = AutoHealBehavior ModuleTag_Heal
HealingAmount = 100
HealingDelay = 1000
StartsActive = Yes
End
End
End
Object AirF_AmericaAirfield
ArmorSet
Conditions = None
Armor = BattleBusStructureArmorToughPlusTwo
DamageFX = StructureDamageFXNoShake
End
ReplaceModule ModuleTag_10
Body = StructureBody ModuleTag_10_Override
MaxHealth = 3000.0
InitialHealth = 3000.0
SubdualDamageCap = 3101
SubdualDamageHealRate = 500
SubdualDamageHealAmount = 100
End
End
AddModule ModuleTag_1_Override
Behavior = GrantUpgradeCreate ModuleTag_1
UpgradeToGrant = Upgrade_AmericaRadar
ExemptStatus = UNDER_CONSTRUCTION
End
End
AddModule ModuleTag_2_Override
Behavior = RadarUpdate ModuleTag_2
RadarExtendTime = 4000
End
End
AddModule ModuleTag_3_Override
Behavior = RadarUpgrade ModuleTag_3
TriggeredBy = Upgrade_AmericaRadar
End
End
AddModule ModuleTag_4_Override
Behavior = GrantUpgradeCreate ModuleTag_4
UpgradeToGrant = Upgrade_InfantryCaptureBuilding
ExemptStatus = UNDER_CONSTRUCTION
End
End
Prerequisites
End
EnergyProduction = 0
End
Object Nuke_ChinaJetMIG
UpgradeCameo1 = Nuke_Upgrade_ChinaAircraftArmor
UpgradeCameo2 = Nuke_Upgrade_ChinaAircraftArmor
RemoveModule ModuleTag_04
RemoveModule ModuleTag_10
ReplaceModule ModuleTag_02
Body = ActiveBody ModuleTag_02_Override
MaxHealth = 240.0
InitialHealth = 240.0
End
End
WeaponSet
Conditions = None
Weapon = PRIMARY Nuke_NukeMissileWeapon
End
Prerequisites
End
AddModule ModuleTag_Laser_One_Override
Behavior = PointDefenseLaserUpdate ModuleTag_Laser_One
WeaponTemplate = AirF_PointDefenseLaser
PrimaryTargetTypes = BALLISTIC_MISSILE SMALL_MISSILE
ScanRate = 0
ScanRange = 200.0
PredictTargetVelocityFactor = 1.0
End
End
End
Object Infa_ChinaHelixBattleBunker
AddModule ModuleTag_01a_Override
Draw = W3DDependencyModelDraw ModuleTag_01a
OkToChangeModelColor = Yes
AttachToBoneInContainer = CHASSISBONE
ConditionState = NONE
Model = NVHELIX_S
Animation = NVHELIX_S.NVHELIX_S
AnimationMode = LOOP
End
ConditionState = REALLYDAMAGED
Model = NVHELIX_SD
ParticleSysBone = Smoke01 SmolderingSmoke
ParticleSysBone = Smoke02 SmolderingSmoke
ParticleSysBone = Flame01 SmolderingFire
ParticleSysBone = Flame01 SmolderingFlameCore
ParticleSysBone = Spark01 LiveWireSparks
End
ConditionState = NIGHT
Model = NVHELIX_S
Animation = NVHELIX_S.NVHELIX_S
AnimationMode = LOOP
End
End
End
AddModule ModuleTag_01b_Override
Draw = W3DDependencyModelDraw ModuleTag_01b
OkToChangeModelColor = Yes
AttachToBoneInContainer = CHASSISBONE
DefaultConditionState
Model = NVHelix_G
Turret = TURRET01
TurretPitch = TURRETEL
WeaponFireFXBone = PRIMARY Muzzle
WeaponMuzzleFlash = PRIMARY MuzzleFX
End
ConditionState = CONTINUOUS_FIRE_SLOW
Model = NVHelix_G
Animation = NVHelix_G.NVHelix_G
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.1 0.1
End
ConditionState = CONTINUOUS_FIRE_MEAN
Model = NVHelix_G
Animation = NVHelix_G.NVHelix_G
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.2 0.2
End
ConditionState = CONTINUOUS_FIRE_FAST
Model = NVHelix_G
Animation = NVHelix_G.NVHelix_G
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.3 0.3
ParticleSysBone = Muzzle01 GattlingMuzzleSmoke
ParticleSysBone = Muzzle02 GattlingMuzzleSmoke
End
ConditionState = REALLYDAMAGED
Model = NVHelix_GD
Turret = TURRET01
TurretPitch = TURRETEL
WeaponFireFXBone = PRIMARY Muzzle
WeaponMuzzleFlash = PRIMARY MuzzleFX
ParticleSysBone = Smoke01 SmokeFactionMedium
ParticleSysBone = Smoke02 SmokeFactionMedium
ParticleSysBone = Smoke03 SmokeFactionMedium
ParticleSysBone = SparkM01 SparksMedium
ParticleSysBone = SparkM02 SparksMedium
End
ConditionState = CONTINUOUS_FIRE_SLOW REALLYDAMAGED
Model = NVHelix_GD
Animation = NVHelix_GD.NVHelix_GD
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.1 0.1
End
ConditionState = CONTINUOUS_FIRE_MEAN REALLYDAMAGED
Model = NVHelix_GD
Animation = NVHelix_GD.NVHelix_GD
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.2 0.2
End
ConditionState = CONTINUOUS_FIRE_FAST REALLYDAMAGED
Model = NVHelix_GD
Animation = NVHelix_GD.NVHelix_GD
AnimationMode = LOOP
AnimationSpeedFactorRange = 0.3 0.3
ParticleSysBone = Muzzle01 GattlingMuzzleSmoke
ParticleSysBone = Muzzle02 GattlingMuzzleSmoke
End
End
End
WeaponSet
Conditions = None
Weapon = PRIMARY GattlingBuildingGun
PreferredAgainst = PRIMARY INFANTRY
Weapon = SECONDARY GattlingBuildingGunAir
PreferredAgainst = SECONDARY BALLISTIC_MISSILE AIRCRAFT
End
AddModule ModuleTag_SDU_Override
Behavior = StealthDetectorUpdate ModuleTag_SDU
DetectionRate = 1500
DetectionRange = 200
CanDetectWhileGarrisoned = Yes
CanDetectWhileContained = Yes
End
End
AddModule ModuleTag_Gatt_Override
Behavior = AIUpdateInterface ModuleTag_Gatt
Turret
ControlledWeaponSlots = PRIMARY
TurretTurnRate = 60
TurretPitchRate = 60
AllowsPitch = Yes
End
AutoAcquireEnemiesWhenIdle = Yes
End
End
AddModule ModuleTag_Prop_Override
Behavior = PropagandaTowerBehavior ModuleTag_Prop
Radius = 150.0
DelayBetweenUpdates = 2000
HealPercentEachSecond = 1%
PulseFX = FX_HelixPropagandaTowerPropagandaPulse
UpgradeRequired = Upgrade_ChinaSubliminalMessaging
UpgradedHealPercentEachSecond = 2%
UpgradedPulseFX = FX_HelixPropagandaTowerSubliminalPulse
End
End
End
Object Infa_ChinaVehicleHelix
Prerequisites
End
ReplaceModule ModuleTag_03
Body = ActiveBody ModuleTag_03_Override
MaxHealth = 400.0
InitialHealth = 400.0
End
End
ReplaceModule ModuleTag_29
Behavior = HelixContain ModuleTag_29_Override
Slots = 8
DamagePercentToUnits = 100%
AllowInsideKindOf = INFANTRY DOZER
ForbidInsideKindOf = AIRCRAFT
ExitDelay = 100
NumberOfExitPaths = 1
PassengersAllowedToFire = No
End
End
End[/code]
Posted by: Gameanater - Saturday, November 29, 2014 8:53:40 PM
Sorry to reply to an ancient topic, but I don't know what you mean by "PDL" in your sample Map.ini code.
Posted by: UTD^Force - Sunday, November 30, 2014 8:01:31 AM