Open xezon opened 2 years ago
ExperienceValue = 20 20 40 60 ;Experience point value at each level
ExperienceRequired = 0 100 200 400 ;Experience points needed to gain each level
IsTrainable = Yes ;Can gain experience
CrushableLevel = 0 ;What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = ChinaInfantryTankHunterCommandSet
; *** AUDIO Parameters ***
VoiceSelect = TankHunterVoiceSelect
VoiceMove = TankHunterVoiceMove
VoiceAttack = TankHunterVoiceAttack
VoiceAttackAir = TankHunterVoiceAttack
VoiceGuard = TankHunterVoiceMove
VoiceFear = TankHunterVoiceFear
UnitSpecificSounds
VoiceCreate = TankHunterVoiceCreate
VoiceGarrison = TankHunterVoiceGarrison
VoiceEnter = TankHunterVoiceMove
VoiceEnterHostile = TankHunterVoiceMove
VoiceGetHealed = TankHunterVoiceMove
End
ExperienceValue = 20 20 40 60 ; Experience point value at each level
ExperienceRequired = 0 100 200 400 ; Experience points needed to gain each level
IsTrainable = Yes ; Can gain experience
CrushableLevel = 0 ; What am I?: 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = ChinaInfantryTankHunterCommandSet
; *** AUDIO Parameters ***
VoiceSelect = TankHunterVoiceSelect
VoiceMove = TankHunterVoiceMove
VoiceAttack = TankHunterVoiceAttack
VoiceAttackAir = TankHunterVoiceAttack
VoiceGuard = TankHunterVoiceMove
VoiceFear = TankHunterVoiceFear
UnitSpecificSounds
VoiceCreate = TankHunterVoiceCreate
VoiceGarrison = TankHunterVoiceGarrison
VoiceEnter = TankHunterVoiceMove
VoiceEnterHostile = TankHunterVoiceMove
VoiceGetHealed = TankHunterVoiceMove
End
Normally not a fan of aligned assignments in programming, because they cause big diffs if a key was added that is longer than the previous keys. Since the names are hardcoded instead of variables, I guess it can work here.
Wild idea, ccgzh.ini is essentially some custom data format rather than a language. Could these be represented by some modern object notation that is then transpiled to .ini? I think it would be neat to make use of inheritance:
{
"GLAVehicleQuadCannon": {
"Module_Tag1": {blah},
...
"Faction": "GLA",
"Cost": 700,
},
"Chem_GLAVehicleQuadCannon": {
"#inherits": "GLAVehicleQuadCannon",
"Faction": "GLAToxinGeneral",
"Cost": 750,
}
}
It would get rid of a shitton of duplicated code and be less error prone.
Ouf. I do see the benefit of doing that. The JSON Format you used above would lose all comments though.
Perhaps instead of introducing entirely new format, the INI syntax could be just extended and then transformed from Modified INI source into game INI format on build step. This way you could add that inheritance feature selectively. And no one has to relearn INI syntax because of it.
Or just stop trying to reinvent the wheel?
As for pure formatting, there are probably ways to define a format rule set for Visual Studio Code and then just apply that to all files.
Rather than aligning all the "=", I'd prefer to just clean/group the lines better so that they're easier to find like so:
ExperienceValue = 20 20 40 60
ExperienceRequired = 0 100 200 400
IsTrainable = Yes
CrushableLevel = 0 ; 0 = for infantry, 1 = for trees, 2 = general vehicles
CommandSet = ChinaInfantryTankHunterCommandSet
; *** AUDIO PARAMETERS ***
VoiceSelect = TankHunterVoiceSelect
VoiceMove = TankHunterVoiceMove
VoiceAttack = TankHunterVoiceAttack
VoiceAttackAir = TankHunterVoiceAttack
VoiceGuard = TankHunterVoiceMove
VoiceFear = TankHunterVoiceFear
UnitSpecificSounds
VoiceCreate = TankHunterVoiceCreate
VoiceGarrison = TankHunterVoiceGarrison
VoiceEnter = TankHunterVoiceMove
VoiceEnterHostile = TankHunterVoiceMove
VoiceGetHealed = TankHunterVoiceMove
End
A lot of these lines are their own parameter and don't really need to be compared to the ones around them, so there's not much point in aligning all the "="s imo
I much prefer the '=' aligned for readability, but that's just me
Fix all indentation and spacing in all INI files. Maybe also unify linefeeds between definition blocks. Build a script and apply to original and edited INI files for both Zero Hour and Generals. Ideally the result increases readability.