1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[WIP] Converting Wonders to Tiles

Discussion in 'Civ5 - Creation & Customization' started by Ekmek, Apr 12, 2014.

  1. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    Especially for Pazyryk


    I'll post the tutorial soon but what I did needs testing.


    Attached are the gr2s for the the pyramids to work as wonder tiles - hb (halfbuit), pyramids, and the pillaged (pl) files (note this is just a copy of the pyramids gr2 since we don't have pillaged graphics but we are going to have smoke coming out anyways).

    I have most of the work done for the "how to convert" part but need to actually get this in game which means I need someone to do the fxsxml files and the xml work. I included the holysite.fxsxml since that is what its based on but that model doesn't have an hb fxsxml so someone needs to make it and have it trigger.

    Hopefully Pazyryk or someone else can take this up.
     
  2. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    The good news is that completed and under construction look different. But it has some problems. The top and left are completed. The lower right is under construction:



    Here are the fxsxml files I used...

    pyramidsTI.fxsxml
    Code:
    <Asset>
      <Mesh file="PyramidsTI.gr2" source="Max" />
      <Texture file="FX_Blk_Blk4x4.dds" source="Max" />
      <Texture file="Holy_Site_GRND_H.dds" source="Max" />
      <Texture file="Religious_Landmark_DIFF.dds" source="Max" />
      <Texture file="Religious_Landmark_GRND_DIFF.dds" source="Max" />
      <Texture file="Religious_Landmark_SREF.dds" source="Max" />
      <Texture file="Unit_Environment_Dull.dds" source="Max" />
      <Texture file="Unit_Environment_Sharp.dds" source="Max" />
      <Texture file="Unit_Irradiance.dds" source="Max" />
    </Asset>
    hb_pyramidsTI.fxsxml
    Code:
    <Asset>
      <Mesh file="PyramidsTI_hb.gr2" source="Max" />
      <Texture file="FX_Blk_Blk4x4.dds" source="Max" />
      <Texture file="Holy_Site_GRND_H.dds" source="Max" />
      <Texture file="Religious_Landmark_DIFF.dds" source="Max" />
      <Texture file="Religious_Landmark_GRND_DIFF.dds" source="Max" />
      <Texture file="Religious_Landmark_SREF.dds" source="Max" />
      <Texture file="Unit_Environment_Dull.dds" source="Max" />
      <Texture file="Unit_Environment_Sharp.dds" source="Max" />
    </Asset>
    I didn't add in the pillaged to test it yet.
     

    Attached Files:

  3. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
  4. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
  5. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    I added it into my existing mod. In addition to fxsxml files above, these are the sql commands to get it into the game:

    Code:
    INSERT INTO Improvements (Type,	Description,		Civilopedia,	ArtDefineTag,	Water, PillageGold, Permanent,	DestroyedWhenPillaged,	PortraitIndex,	IconAtlas) VALUES
    ('IMPROVEMENT_PYRAMID',	'TXT_KEY_EA_PYRAMID',	'TXT_KEY_EA_PYRAMID_PEDIA',	'ART_DEF_IMPROVEMENT_PYRAMID',			0,	10,	1,	0,	0,	'BW_ATLAS_2'	);
    Code:
    INSERT INTO Improvement_ValidTerrains (ImprovementType, TerrainType) VALUES
    ('IMPROVEMENT_PYRAMID',			'TERRAIN_GRASS' ),
    ('IMPROVEMENT_PYRAMID',			'TERRAIN_PLAINS'),
    ('IMPROVEMENT_PYRAMID',			'TERRAIN_DESERT'),
    ('IMPROVEMENT_PYRAMID',			'TERRAIN_TUNDRA'),
    ('IMPROVEMENT_PYRAMID',			'TERRAIN_SNOW'	);
    Code:
    INSERT INTO Builds (Type,	PrereqTech,						DisallowTech,			PrereqPolicy,		DisallowPolicy,		Time,	ImprovementType,				Description,							Help,										Recommendation,								EntityEvent,				HotKey,	CtrlDownAlt,	CtrlDown,	AltDown,	HotKeyPriority,	OrderPriority,	IconIndex,	IconAtlas			) VALUES
    ('BUILD_PYRAMID',			NULL,							NULL,					NULL,				NULL,				400,	'IMPROVEMENT_PYRAMID',			'TXT_KEY_EA_BUILD_PYRAMID',				NULL,										NULL,										'ENTITY_EVENT_MINE',		'KB_P',	0,				0,			0,			0,				96,				0,			'BW_ATLAS_2'		);
    Code:
    INSERT INTO Unit_Builds (UnitType, BuildType) VALUES
    ('UNIT_WORKERS_MAN', 'BUILD_PYRAMID');
     
  6. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    ok, I'm not up on sql so I'm trying to put together a quick mod with xml

    I think the issue is the rotation when I imported so it should be an easy fix.
     
  7. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    I got my improvement to build but it won't show and for some reason it won't give me a free starting worker in the ancient era. But I'm not an aml or mod guy. I'm better at graphics.

    Please take a look and let me know whats wrong with my test mod so I can I test the wonder graphics out.

    thx
     
  8. TPangolin

    TPangolin Just the worst person

    Joined:
    May 23, 2013
    Messages:
    4,029
    Location:
    Sydney, Australia
  9. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
  10. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    Ok, I think I positioned them right but don't have a mod to view it. Please let me know if it works.
     
  11. Horem

    Horem Emperor

    Joined:
    Apr 1, 2010
    Messages:
    1,720
    Location:
    Wales, UK
    Wondering if this is down to the "state" defaulting to half built. You can see in the wonder defines:-
    Code:
    <WonderArtState state="Any">
    Whole Entry:-
    Spoiler :
    Code:
    <WonderArtInfo>
    <Type>STONEHENGE</Type>
    <WonderArtState state="Any">
    <fScale>0.05</fScale>
    <Granny>Assets/Buildings/Wonders/Stonehenge/Stonehenge.fxsxml</Granny>
    </WonderArtState>
    </WonderArtInfo>

    "Any" defaulting to Half Built? The Built switching I guess is handled by the graphic.dll? I know we can add multiple "states" for resources and features what about this? TBH Im still wrapping my head around all this.
     
  12. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    I think its because the wonder graphic uses 3 skeletons where as a resources uses one with multiple meshes. So the tile graphics engine is only pulling the graphic from the first wonder skeleton.

    My best guess is that firaxis had different modellers/coders doing different graphics so the handling is different. I really wish they got rid of wonders and do what weare trying here - make the graphics tileimps. It would be real cool if we code the tileimps to give the wonder effect if worked.

    So no one tried my updated gr2 files?
     
  13. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Hey it worked!



    ...looks a little big in that image but they scale just fine (image above is with Scale = 1; looks good to me at about 0.6).

    Pillage state isn't working now (no smoke). The problem might be in my pl_pyramidsTI.fxsxml file so I'll fiddle around with that a little to see if I can get it working.
     

    Attached Files:

  14. Craig_Sutter

    Craig_Sutter Deity

    Joined:
    Aug 13, 2002
    Messages:
    2,753
    Gender:
    Male
    Location:
    Calgary, Canada
    I use stonehenge from the mod on steam you cited. The improvement model comes out in only the in construction state.

    I am following this discussion... am I correct in thinking that you have solved this problem?

    If so, might I ask that you do up a stonehenge improvement? One that has all the states working in good order?

    I have to say, if you have this working, I am quiet excited as it vastly increases the number of possible tile improvements available. A coastal lighthouse comes to mind for instance... and I am looking for an improvement that would work as a sacred grove. Maybe there's a wonder that might work for that.
     
  15. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    @Craig_Sutter

    Yeah, there's nothing new in that Workshop mod. That's where we've been for over 2 yrs now. If I understand correctly, Ekmek took apart the original graphic (a single gr2) and rebuilt it as three separate gr2 files for the 3 states. But only for pyramids.


    @Ekmek

    Still can't get pillaged state to animate. Here's my pl_pyramidsTI.fxsxml file:
    Code:
    <Asset>
    	<Mesh file="PyramidsTI_pl.gr2" source="Max" />
    	<Texture file="FX_Blk_Blk4x4.dds" source="Max" />
    	<Texture file="Holy_Site_GRND_PIL_DIFF.dds" source="Max" />
    	<Texture file="Holy_Site_GRND_PIL_H.dds" source="Max" />
    	<Texture file="Holy_Site_PIL_DIFF.dds" source="Max" />
    	<Texture file="Religious_Landmark_SREF.dds" source="Max" />
    	<Texture file="Unit_Environment_Dull.dds" source="Max" />
    	<Texture file="Unit_Environment_Sharp.dds" source="Max" />
    	<Texture file="Unit_Irradiance.dds" source="Max" />
    	[COLOR="Red"]<DecisionTree file="StaticLandmarkDecisionTree.ddtxml" source="Tool" />
    	<TimedTrigger file="FX_Triggers_Holy_Site_PIL.ftsxml" source="Tool" model="Box01" state="0,1,2,3"/>	
    	<BoneUsage>
    		<Bone name="FX_PillagedSmoke" />
    		<Bone name="Point01" />
    	</BoneUsage>[/COLOR]
    </Asset>
    Are "Box01" and "Point01" correct for this model?
     
  16. TPangolin

    TPangolin Just the worst person

    Joined:
    May 23, 2013
    Messages:
    4,029
    Location:
    Sydney, Australia
    Alright... That is so, unbelievably cool. Now someone make a mod that replaces all the wonders as Improvements that require the same build time as they would in a city. I kid (still would be really baller).

    The Stonehenge with some forest would work as a Sacred Grove.
     
  17. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    I'm still convinced that the pillage not working is due to my fxsxml file. Here's the relavant part from holy_site_pil.fxsxml:

    Code:
      <BoneUsage>
        <Bone name="FX_PillagedSmoke" />
      </BoneUsage>
      <TimedTrigger file="FX_Triggers_Holy_Site_PIL.ftsxml" source="Tool" model="Box01" state="0,1,2,3"/>
    And from two other improvements (tried both and neither worked):

    Code:
    	<TimedTrigger file="FX_Triggers_Chateau_PIL.ftsxml" source="Tool" model="main" state="0,1,2,3" />
    	<BoneUsage>
    		<Bone name="FX_PillagedSmoke" />
    	</BoneUsage>
    Code:
      <TimedTrigger file="FX_Triggers_Plantation_MID_Citrus_PIL.ftsxml" source="Tool" model="Banana_group_08" state="0,1,2,3" />
      <BoneUsage>
        <Bone name="FX_PillagedSmoke" />
      </BoneUsage>
    And some others I haven't tried:

    Code:
      <TimedTrigger file="FX_Triggers_Chateau_PIL.ftsxml" source="Tool" model="Object08" state="0,1,2,3" />
      <BoneUsage>
        <Bone name="FX_Pillaged_Smoke" />
      </BoneUsage>
    Code:
      <BoneUsage>
        <Bone name="FX_Pillaged_Smoke" />
      </BoneUsage>
      <TimedTrigger file="FX_Triggers_Kasbah_PIL.ftsxml" source="Tool" model="Fort" state="0,1,2,3" />
    It seems clear from all these examples that the difference is in the "model". Perhaps "Box01" no longer exists in the modded pyramid (even though you started with that)? So what should I use there for model? I really don't know how to look at gr2 files to figure that out... :(
     
  18. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    nexusbuddy will say the mesh names but not the bones. I didn't rename any bones though - the building still uses 'Point01'

    I wonder if scale has anything to do with it. maybe put the holysite pillage.gr2 in for the pyramid one in your fxsxml and see if it animates. that would atleast determine if its my gr2 or your fxsxml
     
  19. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    I'll try your suggestion when I can get back to modding. But I'm sure my fxsxml file is "functional". You can see the graphic "blink" when it is pillaged / unpillaged (via Fire Tuner). The pillaged fxsxml is able to draw the pyramid. But not smoke. And I'm testing on a much smaller scale that image above (Scale = 0.5) so it's not that the smoke is hidden by the structure.

    I removed the line <Bone name="Point01" /> for most tests. It's there in some improvement pl fxsxml files (at least lumbermill), but not in others. I think it's more likely that model is the problem. You can see examples above (mostly GP builds):

    model="Box01"
    model="main"
    model="Banana_group_08"
    model="Object08"
    model="Fort"

    The first one is from the pillaged holy site. But is "Box01" really still there in your modded gr2? If not, what should I use for model?
     
  20. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,058
    Location:
    San Diego, California
    Box01 is the mesh name and I have it rigged to point01 just like th holysite.

    If those things don't work it may be because the model is too big in the gr2. the smoke might be happening underneath it and I don't think changing the scale in xml will do anything. So I'll shrink the pyramis to be close to the holysite's size and see it it shows. from there if you want to make it bigger you can scale it. FYI - to make the wonder fit the holysite size I reduced to 10% of size - so I have to make it even smaller. crazy.
     

Share This Page