SQL & Worker unit Graphic

Patum333

Chieftain
Joined
Jan 25, 2012
Messages
63
Location
Bremen
Hello civfanatics,

next civilian unit is uploaded.

http://forums.civfanatics.com/downloads.php?do=file&id=25202

But I need a good advise to use separate worker unit graphics for each civilization. I tried to handle with the brilliant RED-Mod Create UnitGraphicConfiguration table structure. It didded worked with workers.
Maybe the problem is the vanilla suffix "Euro" in the worker member 'ART_DEF_UNIT_MEMBER_WORKER_EURO'. I stuck to write SQL for using Civ5 Netherlands Worker unit Graphic only for the Netherlands.

Let's take a look:

UPDATE ArtDefine_UnitMemberInfos SET Model = 'CIV5Nedwo.fxsxml' WHERE Type = 'ART_DEF_UNIT_MEMBER_WORKER_EURO';
---INSERT INTO "ArtDefine_UnitMemberInfos" ('Type','fScale','Granny','Combat')
---SELECT REPLACE("Type", 'ART_DEF_UNIT_MEMBER_WORKER_EURO', 'ART_DEF_UNIT_MEMBER_WORKER'), "fScale", "Granny", "Combat"
---FROM "ArtDefine_UnitMemberInfos" WHERE Type = 'ART_DEF_UNIT_MEMBER_WORKER_EURO';
---INSERT INTO "ArtDefine_UnitMemberInfos" ('MemberType','MemberCount')
---SELECT REPLACE("MemberType", 'ART_DEF_UNIT_MEMBER_WORKER_EURO', 'ART_DEF_UNIT_MEMBER_WORKER'), "MemberCount"
---FROM "ArtDefine_UnitMemberInfos" WHERE Type = 'ART_DEF_UNIT__WORKER'
---DELETE FROM ArtDefine_UnitInfoMemberInfos WHERE UnitInfoType='ART_DEF_UNIT__WORKER';
---INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT__WORKER','ART_DEF_UNIT_MEMBER_WORKER_EURO',"8");
---UPDATE ArtDefine_UnitMemberInfos SET Type = 'ART_DEF_UNIT_MEMBER_WORKER' WHERE Type = 'ART_DEF_UNIT_MEMBER_WORKER_EURO';

SELECT 'NETHERLANDS', 'NETHERLANDS', 'CIV5Nedwo.fxsxml', 'ART_DEF_UNIT__WORKER', 'ART_DEF_UNIT_MEMBER_WORKER_EURO', 8, NULL, 0 UNION ALL

Any ideas? :dunno:
 
There's a number of issues here.

Are you using this is in conjunction with R.E.D. Modpack or Ethnic Units, or is this meant to be standalone? If the latter, you need to change the suffix for Netherlands in the Civilizations table.

The biggest problem, though, is that you can only have ONE of UnitArtInfoCulturalVariation and ..EraVariation (if you set both to 1 in the Units table you'll get ..EraVariation only). You'll need to enable the one and disable the other, but then the workers won't change from tunics to overalls in the Industrial era.

The newest version of R.E.D. is forthcoming (I know I've been saying that for some time, but, no, really it's soon!) which makes revisions even easier, and I'm testing what side effects I get from automatically making dummy units to convert to as a way to have both era+cultural diversity.
 
Are you using this is in conjunction with R.E.D. Modpack or Ethnic Units, or is this meant to be standalone?
Yes, I used this in conjunction with R.E.D. Modpack.

---INSERT INTO "ArtDefine_UnitMemberInfos" ('Type','fScale','Granny','Combat')
---SELECT REPLACE("Type", 'ART_DEF_UNIT_MEMBER_WORKER_EURO', 'ART_DEF_UNIT_MEMBER_WORKER'), "fScale", "Granny", "Combat"
---FROM "ArtDefine_UnitMemberInfos" WHERE Type = 'ART_DEF_UNIT_MEMBER_WORKER_EURO';
---INSERT INTO "ArtDefine_UnitMemberInfos" ('MemberType','MemberCount')
---SELECT REPLACE("MemberType", 'ART_DEF_UNIT_MEMBER_WORKER_EURO', 'ART_DEF_UNIT_MEMBER_WORKER'), "MemberCount"
---FROM "ArtDefine_UnitMemberInfos" WHERE Type = 'ART_DEF_UNIT__WORKER'
---DELETE FROM ArtDefine_UnitInfoMemberInfos WHERE UnitInfoType='ART_DEF_UNIT__WORKER';
---INSERT INTO ArtDefine_UnitInfoMemberInfos VALUES ('ART_DEF_UNIT__WORKER','ART_DEF_UNIT_MEMBER_WORKE R_EURO',"8");
---UPDATE ArtDefine_UnitMemberInfos SET Type = 'ART_DEF_UNIT_MEMBER_WORKER' WHERE Type = 'ART_DEF_UNIT_MEMBER_WORKER_EURO';

This was my try to put the Netherlands worker to the Dutch. All trials failed.
Now I think of a way to replace the unit_member from the unit worker and named it only 'ART_DEF_UNIT_MEMBER_WORKER' without a suffix. In that case the R.E.D. Modpack will work with the suffix for CulturalVariation. What do you think about that?

...you can only have ONE of UnitArtInfoCulturalVariation and ..EraVariation (if you set both to 1 in the Units table you'll get ..EraVariation only). You'll need to enable the one and disable the other,...
Hm, not sure about that. Do you realy think it's posible to influence the EraVariation like in CIV4? Do you mean different unit graphics for ONE unit is posible for era times? That would be GREAT!

...but then the workers won't change from tunics to overalls in the Industrial era.
That's not what I want to do :think:

The newest version of R.E.D. is forthcoming
This is really good news :beer:
...to convert to as a way to have both era+cultural diversity.
I keep fingers crossed that it works :religion:

Thanks for your comment so far.
 
replace the unit_member from the unit worker and named it only 'ART_DEF_UNIT_MEMBER_WORKER' without a suffix. In that case the R.E.D. Modpack will work with the suffix for CulturalVariation.
No, unlike the ART_DEF assigned by the UnitArtInfo entry in the Units table, the member name doesn't have any suffix code. It's just a name.

Do you mean different unit graphics for ONE unit is posible for era times?
Yeah, it works. That's how Firaxis does it for workers and great people and trade units. As of BNW, you can use the era name as suffix (e.g., _CLASSICAL, _MEDIEVAL, _MODERN, _POSTMODERN, etc., with _LATE being an alias for _INDUSTRIAL) [and they added a place to assign new alternative Portraits in the Unit panel].
 
No, unlike the ART_DEF assigned by the UnitArtInfo entry in the Units table, the member name doesn't have any suffix code. It's just a name.
Hm, and the R.E.D. Modpack entry in the UC_MemberSuffix caused what?:confused:

INSERT INTO UnitGraphicConfiguration
( UC_CivSuffix, UC_MemberSuffix,

UC_MemberSuffix = UnitMemberType:confused:


Yeah, it works. That's how Firaxis does it for workers and great people and trade units.
Okay right, the camel and the late truck of course!:thumbsup:
 
Hm, and the R.E.D. Modpack entry in the UC_MemberSuffix caused what?:confused:

INSERT INTO UnitGraphicConfiguration
(UC_CivSuffix,UC_MemberSuffix,

UC_MemberSuffix = UnitMemberType:confused:

"Suffix" in that case is just the last part of the MemberType name, but it doesn't have to have a relationship with anything else; it's just convenient to figure out what's what. It could be anything. See Firaxis' inconsistent naming of the settler MemberType names, or notice that in many cases in the resulting art define tables (after UnitGraphicConfiguration, which is an intermediate table that R.E.D. invents, has been processed by the SQL code), civs with different UnitArtInfo suffixes are sharing the same MemberType names.
 
"Suffix" in that case is just the last part of the MemberType name, but it doesn't have to have a relationship with anything else; it's just convenient to figure out what's what. It could be anything. See Firaxis' inconsistent naming of the settler MemberType names, or notice that in many cases in the resulting art define tables (after UnitGraphicConfiguration, which is an intermediate table that R.E.D. invents, has been processed by the SQL code), civs with different UnitArtInfo suffixes are sharing the same MemberType names.

Thanks Nutty, now i'm just a little bit wiser. But not sure to handle the problem with unit worker or settler graphics to force to each civilization.
 
For workers, you either have to turn off Era Variation or you have to do as I am doing, and roll your own function in Lua to convert between dummy unit copies with different art defines (or just wait for R.E.D. to include it ;-) ).

As for settlers (did you post some new settlers?!), they should work just fine. You just have to update the art defines.
 
Top Bottom