Custom Air Unit Art Defines?

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
So unit art is now fully moddable, much different than the previous method of copying the entire file and modding it that way.

Only one problem - I can't find any documentation on exactly how to do it.

So I got the unit model in game and it works, using Tiny Death Robots as a template. Except he only shrunk an existing model, and I'm using air units, so when I attack a unit, they charge up and don't shoot their target, they just kinda sit there in limbo and wait for combat to complete.

I want my air units to conduct the same attack patterns as the ones in the game do. How would I accomplish this? Alternatively, is it still possible to edit the existing file (Where I would just put my aircraft files in there and use theirs as a template)? That would be much easier for me.


There seems to be custom tables in use for modular art defines, but I can't find the XML table they come from...could anyone help me out? (Specifically talking about ArtDefine_UnitInfos and ArtDefine_UnitInfoMemberInfos tables).
 
Sorry, have not looked into that thread for a while.

For what it is worth, here is how I do it, but I use my own static counters, so animations are not important to me. 4 SQL entries to get one unit in the game. Have a look at the relevant tables in SQLite Manager to get a better ID of how the default air units are structured.

Code:
-- AIRCRAFT ---------------------------------------------------------------------------------------------------------
INSERT INTO "ArtDefine_UnitInfos" VALUES('ART_DEF_UNIT_ITA_FIG_C202',1,'FighterDiamond');
INSERT INTO "ArtDefine_UnitInfoMemberInfos" VALUES('ART_DEF_UNIT_ITA_FIG_C202','ART_DEF_UNIT_MEMBER_ITA_FIG_C202',1);
INSERT INTO "ArtDefine_UnitMemberInfos" VALUES('ART_DEF_UNIT_MEMBER_ITA_FIG_C202',7,12,'Air','Ita_Fig_C202.fxsxml','METAL','METALLRG');
INSERT INTO "ArtDefine_UnitMemberCombats" VALUES('ART_DEF_UNIT_MEMBER_ITA_FIG_C202','Idle Attack Bombard Death Run','',NULL,NULL,NULL,45,NULL,2.5,NULL,0.25,0.5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'');
 
There seems to be custom tables in use for modular art defines, but I can't find the XML table they come from...could anyone help me out? (Specifically talking about ArtDefine_UnitInfos and ArtDefine_UnitInfoMemberInfos tables).

They are probably packed in the .fpk files. But you don't need the original files, you can just check the database content in SQLite Manager.
 
Putmalk, you're adding a new unitclass, or want to replace an existing unit with a new model ?
 
Putmalk, you're adding a new unitclass, or want to replace an existing unit with a new model ?

I'm adding a new unit (unique unit, replaces a unit class). The new unit has old unit stats, but it is being replaced with a new unit model. Unit model loads fine in game, but it does not have the combat animations correct. I want it to act like a Triplane does in game right now (shoots/bomb units, intercepts aircraft, etc.) But as of right now it acts like a melee unit (flies up to unit, stands still, waits for units to fight, then retreats).
 
I'm using SQL to copy needed tables row for my new units.

Here's an example from R.E.D Modpack for a fighter replacement (without the code for defining it as an UU for a civ, I suppose you've already have that part)

Spoiler :
Code:
INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("[COLOR="Red"]ART_DEF_UNIT_FIGHTER_GERMANY[/COLOR]"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "[COLOR="red"]ART_DEF_UNIT_FIGHTER[/COLOR]");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	("[COLOR="red"]ART_DEF_UNIT_FIGHTER_GERMANY[/COLOR]"), ("[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER_GERMANY[/COLOR]"), "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "[COLOR="red"]ART_DEF_UNIT_FIGHTER[/COLOR]");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER_GERMANY[/COLOR]"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER[/COLOR]");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER_GERMANY[/COLOR]"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER[/COLOR]");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER_GERMANY[/COLOR]"), "Scale", "ZOffset", "Domain", 
			("[COLOR="red"]Focke-Wulf_Fw-190.fxsxml[/COLOR]"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "[COLOR="red"]ART_DEF_UNIT_MEMBER_FIGHTER[/COLOR]");

edit: added a bit of color for clarity
 
Okay I'll try that and let you know of the results.

Appreciate the help.

So "Unit Art is now fully moddable" means it's only available through SQL? Or is there an XML way of accomplishing modding unit art?
 
XML works, it's just that I find SQL much more useful in my case.


edit : updating via XML tags works, not replacing the complete file, that doesn't work anymore.
 
Yes! It worked! Thanks Gedemon, appreciate that a lot.

I'll use that template from now on.

I'll assume this works for tanks as well? Or different SQL commands are needed?
 

Attachments

  • test.jpg
    test.jpg
    217.7 KB · Views: 53
Okay yeah the tank stuff doesn't work, which leads me to believe I need to rearrange the tags around. I'll poke around and see what tanks require.
 
Okay yeah the tank stuff doesn't work, which leads me to believe I need to rearrange the tags around. I'll poke around and see what tanks require.

I'm using that for tanks and other units too, see R.E.D. Modpack.
 
Here is the problem I am having using the Whippet tank (from Danrell's WW2 mod).

Here is my code for the art defines:

Spoiler :

Code:
-- English Whippet

INSERT INTO "ArtDefine_UnitInfos" ('Type','DamageStates','Formation')
	SELECT	("ART_DEF_UNIT_U_ENGLISH_WHIPPET"), "DamageStates", "Formation"
	FROM "ArtDefine_UnitInfos" WHERE (Type = "ART_DEF_UNIT_TANK");
INSERT INTO "ArtDefine_UnitInfoMemberInfos" ('UnitInfoType','UnitMemberInfoType','NumMembers')
	SELECT	("ART_DEF_UNIT_U_ENGLISH_WHIPPET"), ("ART_DEF_UNIT_MEMBER_U_ENGLISH_WHIPPET"), "NumMembers"
	FROM "ArtDefine_UnitInfoMemberInfos" WHERE (UnitInfoType = "ART_DEF_UNIT_TANK");
INSERT INTO "ArtDefine_UnitMemberCombats" ('UnitMemberType', 'EnableActions', 'DisableActions', 'MoveRadius', 'ShortMoveRadius', 'ChargeRadius', 'AttackRadius', 'RangedAttackRadius', 'MoveRate', 'ShortMoveRate', 'TurnRateMin', 'TurnRateMax', 'TurnFacingRateMin', 'TurnFacingRateMax', 'RollRateMin', 'RollRateMax', 'PitchRateMin', 'PitchRateMax', 'LOSRadiusScale', 'TargetRadius', 'TargetHeight', 'HasShortRangedAttack', 'HasLongRangedAttack', 'HasLeftRightAttack', 'HasStationaryMelee', 'HasStationaryRangedAttack', 'HasRefaceAfterCombat', 'ReformBeforeCombat', 'HasIndependentWeaponFacing', 'HasOpponentTracking', 'HasCollisionAttack', 'AttackAltitude', 'AltitudeDecelerationDistance', 'OnlyTurnInMovementActions', 'RushAttackFormation')
	SELECT	("ART_DEF_UNIT_MEMBER_U_ENGLISH_WHIPPET"), "EnableActions", "DisableActions", "MoveRadius", "ShortMoveRadius", "ChargeRadius", "AttackRadius", "RangedAttackRadius", 
			"MoveRate", "ShortMoveRate", "TurnRateMin", "TurnRateMax", "TurnFacingRateMin", "TurnFacingRateMax", "RollRateMin", "RollRateMax", "PitchRateMin", "PitchRateMax", "LOSRadiusScale", "TargetRadius", "TargetHeight", "HasShortRangedAttack", "HasLongRangedAttack", "HasLeftRightAttack", "HasStationaryMelee", "HasStationaryRangedAttack", "HasRefaceAfterCombat", "ReformBeforeCombat", "HasIndependentWeaponFacing", "HasOpponentTracking", "HasCollisionAttack", "AttackAltitude", "AltitudeDecelerationDistance", "OnlyTurnInMovementActions", "RushAttackFormation"
	FROM "ArtDefine_UnitMemberCombats" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_TANK");
INSERT INTO "ArtDefine_UnitMemberCombatWeapons" ('UnitMemberType', 'Index', 'SubIndex', 'ID', 'VisKillStrengthMin', 'VisKillStrengthMax', 'ProjectileSpeed', 'ProjectileTurnRateMin', 'ProjectileTurnRateMax', 'HitEffect', 'HitEffectScale', 'HitRadius', 'ProjectileChildEffectScale', 'AreaDamageDelay', 'ContinuousFire', 'WaitForEffectCompletion', 'TargetGround', 'IsDropped', 'WeaponTypeTag', 'WeaponTypeSoundOverrideTag')
	SELECT ("ART_DEF_UNIT_MEMBER_U_ENGLISH_WHIPPET"), "Index", "SubIndex", "ID", "VisKillStrengthMin", "VisKillStrengthMax", "ProjectileSpeed", "ProjectileTurnRateMin", "ProjectileTurnRateMax", "HitEffect", "HitEffectScale", "HitRadius", "ProjectileChildEffectScale", "AreaDamageDelay", "ContinuousFire", "WaitForEffectCompletion", "TargetGround", "IsDropped", "WeaponTypeTag", "WeaponTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberCombatWeapons" WHERE (UnitMemberType = "ART_DEF_UNIT_MEMBER_TANK");
INSERT INTO "ArtDefine_UnitMemberInfos" ("Type", "Scale", "ZOffset", "Domain", "Model", "MaterialTypeTag", "MaterialTypeSoundOverrideTag")
	SELECT	("ART_DEF_UNIT_MEMBER_U_ENGLISH_WHIPPET"), "Scale", "ZOffset", "Domain", 
			("MK_A_Whippet.fxsxml"), "MaterialTypeTag", "MaterialTypeSoundOverrideTag"
	FROM "ArtDefine_UnitMemberInfos" WHERE (Type = "ART_DEF_UNIT_MEMBER_TANK");


I don't exactly know why its bugged like this. I also tried it with WW1_Tank, but the model and animations themselves seem to be bugged.

Any pointers, perhaps?
 

Attachments

  • whippetjpg.jpg
    whippetjpg.jpg
    108.3 KB · Views: 76
It worked, thanks Gedemon, appreciate it. :)
 
Back
Top Bottom