View Full Version : How to replace the spaceship with a different graphic?
ambrox62 Nov 29, 2009, 12:16 PM I would replace the whole spaceship management with a different concept, because I'm working on a ancient mod and a spaceship is absolutely out of place.
On details, I would replace the spaceship with a "silk road", removing from the game each graphic related to spaceship, and replacing it with still pictures for each outpost along the route.
I would replace the current spaceship management with a row of projects: first the "silk road", then eight outposts. Each project requires the previous and leads to the following one. When a project ends I would show a picture, and when you click on the spaceship screen you should see the "silk road" current status instead.
When you complete the last one you will win the game (the same as space race victory).
Does anyone have a idea about what and where I should modify?
Thanks in advance
Ajidica Nov 29, 2009, 12:29 PM Changing the projects themselves is easy, simply edit projectinfos and victoryinfos. CHanging the spaceship graphic, I'd be interested in learning that.
ambrox62 Nov 29, 2009, 02:49 PM Changing projects has already done.
Now would be great having a Silk Road BG instead of the spaceship one, and when clicking the zoom button of each project, the corrisponding BG of the outpost should replace the previous one.
How that can be done? :confused:
deanej Nov 29, 2009, 07:29 PM I don't know if anyone has an idea. You might be better off ditching the graphic and just requiring the projects for the victory. See how the space race victory works on vanilla and Warlords.
Tholish Nov 30, 2009, 02:07 AM In XML/Art/InterfaceInfos you have this that might be helpfull
<InterfaceArtInfo>
<Type>SPACESHIP_PROGRESS_BG</Type>
<Path>Art/Interface/Screens/Spaceship/SS_Background.dds</Path>
</InterfaceArtInfo>
Maybe you could just make a series of national wonders that require each other as prereqs (the somewhere kind, not the same city kind), the last of which gives you an otherwise unavailable resource, "SilkTrade" that you need to build a project that allows victory like the astral gate in final frontier (ie without being a spaceship part). To make the victory project require a bonus as a pre req you would of course require my modcomp for that.
http://forums.civfanatics.com/showthread.php?t=341636
However, thats a make do solution. I also want to be able to replace spaceship art.
In my mod the Spaceship victory is won by colonizing space generally, and each part is a fleet of ships you send out. In my attempts to alter the art, I simply got rid of the parts, so when the spaceship if finally launched it is just a skeleton. Not satisfactory.
deanej Nov 30, 2009, 03:31 PM You can make projects require other projects and be required for victory withought them being spaceship parts. I don't think anyone actually knows how the spaceship screen works as it's in a part of the game that is either not touched or removed by mods.
ambrox62 Nov 30, 2009, 03:38 PM Spaceship has python and xml codes working together, because I have got python errors as result of my attempts to modify xmls :sad:
Tholish Dec 01, 2009, 05:37 AM Also in Python/CvVictoryScreen there's this
# spaceship art
self.X_BG = 150
self.Y_BG = 150
self.W_BG = 720
self.H_BG = 480
self.X_DETAIL = 452
self.Y_DETAIL = 52
self.W_DETAIL = 150
self.H_DETAIL = 150
self.locations = [[171, 88, 442, 350, "Art/Interface/Screens/SpaceShip/SS_Casing.dds", "Art/Interface/Screens/SpaceShip/SS_Casing_Callout.dds", "TXT_KEY_PROJECT_SS_CASING"],
[28, 15, 320, 280, "Art/Interface/Screens/SpaceShip/SS_Thrusters.dds", "Art/Interface/Screens/SpaceShip/SS_Thrusters_Callout.dds", "TXT_KEY_PROJECT_SS_THRUSTERS"],
[144, 106, 96, 124, "Art/Interface/Screens/SpaceShip/SS_Engine.dds", "Art/Interface/Screens/SpaceShip/SS_Engine_Callout.dds", "TXT_KEY_PROJECT_SS_ENGINE"],
[309, 232, 99, 107, "Art/Interface/Screens/SpaceShip/SS_DockingBay.dds", "Art/Interface/Screens/SpaceShip/SS_DockingBay_Callout.dds", "TXT_KEY_PROJECT_SS_DOCKING_BAY"],
[453, 352, 122, 107, "Art/Interface/Screens/SpaceShip/SS_Cockpit.dds", "Art/Interface/Screens/SpaceShip/SS_Cockpit_Callout.dds", "TXT_KEY_PROJECT_SS_COCKPIT"],
[373, 284, 112, 114, "Art/Interface/Screens/SpaceShip/SS_LifeSupport.dds", "Art/Interface/Screens/SpaceShip/SS_LifeSupport_Callout.dds", "TXT_KEY_PROJECT_SS_LIFE_SUPPORT"],
[221, 167, 110, 137, "Art/Interface/Screens/SpaceShip/SS_StasisChamber.dds", "Art/Interface/Screens/SpaceShip/SS_Stasis_Callout.dds", "TXT_KEY_PROJECT_SS_STASIS_CHAMBER"] Which looks like you could just replace the look of parts with another dds.
Unfortunately, the context in which the spaceship parts get assembled is hard coded in the DLL in CvInfos.cpp with stuff like this:
bool CvSpaceShipInfo::read(CvXMLLoadUtility* pXML)
{
if (!CvInfoBase::read(pXML))
{
return false;
}
CvString szTextVal;
pXML->GetChildXmlValByName(szTextVal, "NodeName");
setNodeName(szTextVal);
pXML->GetChildXmlValByName(szTextVal, "ProjectName");
setProjectName(szTextVal);
//up axis
pXML->GetChildXmlValByName(szTextVal, "CameraUpAxis");
if(szTextVal.CompareNoCase("AXIS_X") == 0)
m_eCameraUpAxis = AXIS_X;
else if(szTextVal.CompareNoCase("AXIS_Y") == 0)
m_eCameraUpAxis = AXIS_Y;
else if(szTextVal.CompareNoCase("AXIS_Z") == 0)
m_eCameraUpAxis = AXIS_Z;
else
{
FAssertMsg(false, "[Jason] Unknown Axis Type.");
}
pXML->GetChildXmlValByName(&m_iPartNumber, "PartNumber");
pXML->GetChildXmlValByName(&m_iArtType, "ArtType");
pXML->GetChildXmlValByName(&m_iEventCode, "EventCode");
//type
pXML->GetChildXmlValByName(szTextVal, "InfoType");
if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_FILENAME") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_FILENAME;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_ALPHA_CENTAURI") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_ALPHA_CENTAURI;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_LAUNCH") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_LAUNCH;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_LAUNCHED") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_LAUNCHED;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_ZOOM_IN") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_ZOOM_IN;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_ZOOM_MOVE") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_ZOOM_MOVE;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_COMPONENT_OFF") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_COMPONENT_OFF;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_COMPONENT_APPEAR") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_COMPONENT_APPEAR;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_COMPONENT_PREVIEW") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_COMPONENT_PREVIEW;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_COMPONENT_ON") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_COMPONENT_ON;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_LIGHT_OFF") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_LIGHT_OFF;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_GANTRY_SMOKE_ON") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_GANTRY_SMOKE_ON;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_IN_SPACE_SMOKE_ON") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_IN_SPACE_SMOKE_ON;
else if(szTextVal.CompareNoCase("SPACE_SHIP_INFO_TYPE_IN_GAME_SMOKE_ON") == 0)
m_eSpaceShipInfoType = SPACE_SHIP_INFO_TYPE_IN_GAME_SMOKE_ON;
else
This could probably be eliminated and replaced with something like a simple dds wonder "movie" for each part.
An even crazier part is the spaceship launch itself.
Lord Tirian Dec 01, 2009, 02:41 PM A way to do it might be removing the spaceship screen and creating your own screen from scratch... There are a couple of mods using custom screens (sometimes even including viewports for 3D graphics), so I assume it's doable - but I'm no expert for Python stuff.
Cheers, LT.
ambrox62 Dec 02, 2009, 12:24 AM There are a couple of mods using custom screens
Which mods have replaced the whole SS management yet?
Lord Tirian Dec 02, 2009, 02:34 AM Which mods have replaced the whole SS management yet?None, because none of them use the SS management system as victory condition - that's why I suggest ditching it completely instead of trying to modify/piggyback on it.
Several mods use buildings/wonders as victory conditions (FfH2: Altar of Luonnatar, Tower of Mastery; Planetfall: Subspace Generator, requiring 7 prereq buildings).
Several mods have elaborate custom screens (RevDCM has the revolution advisor, Dune Wars has a homeworld screen for buying units, FfH2 has freaking Somnium as minigame, Test of Time has the equipment manager), that can pull in all sorts of information from the game.
So buildings/projects as victory condition is feasible, creating custom screens checking game data is possible as well.
Hence, I suggest is making the silk road victory a set of X buildings/wonders/projects - and the custom screen would then check the number of these buildings/wonders/projects and display a graphic/model depending on the number of silkroad projects you have built.
Cheers, LT.
Tholish Dec 02, 2009, 02:48 AM The problem with that is that the Spaceship is more than just a project that lets you win. There is already stuff in place to use it, like tags to let buildings increase spaceship production, tags to let buildings appear only in games in which the spaceship victory type is enabled, and the fact that it is set up as something you can customize in a custom game--unless its a spaceship, can you turn off Silk Road Victory?
ambrox62 Dec 02, 2009, 04:39 AM Hence, I suggest is making the silk road victory a set of X buildings/wonders/projects - and the custom screen would then check the number of these buildings/wonders/projects and display a graphic/model depending on the number of silkroad projects you have built.
Ok, I'll follow your suggestion, although it means a huge effort for myself in order to learn XML and python advanced programming :crazyeye:
ambrox62 Dec 02, 2009, 04:44 AM can you turn off Silk Road Victory?
Usually I play scenarios having such victory turn on, thus I never think to that before now
|
|