| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
Ethnic Buildings Mod
===============================
= Ethnic Buildings by Asaf (version 0.1) = =============================== Download here This Mod component enables a modder to have different art for the same building for different civilizations, the same way units art works in BTS. Building art info defined that way is displayed at the following places: - On the map view - as a 3D model in the city (3D model) - Inside the city screen, as a building production order button (button image) - Inside the city screen, when the is building currently in queue (3D model) - On the map in the city bar, when the building is currently being built (button image) - On the popup where the player can select the next city production (button image) - On the minimized production popup (if used) (button image) This art is not used in the civilopedia (since it is not connected to a specific player). Other places which are not in Vanilla BTS (such as in BUG) are not defined here, but can be easily modded. All the changes I made (C++, Python and XML files) are marked with an 'Ethnic Buildings' comment. Modders how-to: XML Spoiler:
Python Spoiler:
Credits: ======== DannyDaemonic - the fast Makefile (1.0). Downloaded from: http://forums.civfanatics.com/showthread.php?t=370861 j_mie6 - For the idea (requested this Mod) EDIT: You are more than welcome to use this mod component in your own mods, but if you do - please let me know.
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
Last edited by Asaf; Dec 09, 2010 at 02:54 AM. |
|
|
|
|
|
#2 |
|
godless Heathen
Join Date: Jan 2001
Location: Washington, DC
Posts: 8,957
|
So basically this just shows the ethnic improvement art (say from a mod like Cultural Citystyles) in the Civilopedia and City Screen?
I was wondering if this could be altered to make wonders ethnic as well? For instance could there be an ethnic wonder for the Great Wall, like the Romans would get Hadrian's wall instead or is that way too complex to do?
__________________
Religion flies men into buildings, science flies men to the moon... Check out my stuff!!! UNITS | LEADERHEADS | DIPLOMACY II |
|
|
|
|
|
#3 | |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
Quote:
And not improvements (as in tile improvements - farm, mine, etc.) but buildings built in the city. Wonders are basically buildings for which the building class has iMaxGlobalInstances=1, so yes, they will be ethnic as well. The movies, however, are not included in the 'ethnic art'. I guess it's doable, but I haven't seen many movie makers for mods, so I'm not sure if it's needed. Specifically for the Great Wall, the art of displaying the wall around the cultural borders is not included in the ethnic buildings since it's not part of the art assets (as far as I know), and not part of the BuildingArtInfo.
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
|
|
|
|
|
|
|
#4 |
|
Deity
|
Great work I'm sure that many people (including myself), will be very happy to see this!
I will have a play on friday!
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator![]() Yay! 2 A* Grades, 6 A Grades and 2 B Grades!![]() State Property, the new Forbidden Palace?![]() |
|
|
|
|
|
#5 |
|
Say No 2 Net Validations
![]() ![]() |
The sad part here: That was already possible in standard BtS
.The good part here: That implementation is definitely better and should have been done in that way by default .
|
|
|
|
|
|
#6 |
|
Deity
|
yer but the other way is very complicated and this would be so much better for new modders
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator![]() Yay! 2 A* Grades, 6 A Grades and 2 B Grades!![]() State Property, the new Forbidden Palace?![]() |
|
|
|
|
|
#7 | |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
Oh.
![]() How? (Probably something that has to do with LSystem, which I could never understand) Quote:
![]() Maybe I should open a thread for every mod comp I intend to make before I make it...
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
Last edited by Asaf; Dec 09, 2010 at 01:00 AM. |
|
|
|
|
|
|
#8 | ||
|
Say No 2 Net Validations
![]() ![]() |
Quote:
Quote:
![]() If you make more, then maybe one big thread for all is better, then you also have your own "discussion" ground, that's maybe easier .
|
||
|
|
|
|
|
#9 |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
If it's that complicated, maybe this mod will be useful after all
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
|
|
|
|
|
|
#10 |
|
Deity
|
oh it is! You have given alot of new modders a great new asset previously too scary for them to handle!
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator![]() Yay! 2 A* Grades, 6 A Grades and 2 B Grades!![]() State Property, the new Forbidden Palace?![]() |
|
|
|
|
|
#11 |
|
Chieftain
Join Date: Oct 2010
Posts: 18
|
ummm I just downloaded complete edition, new to the game, can anyone tell me how to install mods? I download the file, and unzip it where??
|
|
|
|
|
|
#12 |
|
Deity
|
unzip to your documents and drag the intire file to computer/program files/2k games/civilization complete/beyond the sword/mods or somethign simmilar
(you only have to past in documents if you are on vista)
__________________
My mods = Jamie's Rome Mod 1.3.2, No Global Warming Mod My units = Great Generals, Ninja!, Desert Marine, African Marines, Chinese Rocketeer My utilities: XML text cleaner, City Optimiser/Simulator![]() Yay! 2 A* Grades, 6 A Grades and 2 B Grades!![]() State Property, the new Forbidden Palace?![]() |
|
|
|
|
|
#13 |
|
Chieftain
Join Date: Oct 2010
Posts: 18
|
What about these files? Do they go to in the Custom Assests? The Ethnic buildings are more just graphics than gameplay enhancers right? So if i unzip to mods, wont i have to load it every time?
|
|
|
|
|
|
#14 |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
This mod doesn't have any graphics of its own. It's just a mod component to make it easier for other modders to assign specific building art to specific civilizations.
Unless you have art files of your own (or somebody else's) that you want to use, you really don't need this mod.
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
|
|
|
|
|
|
#15 |
|
Deity
Join Date: Mar 2007
Posts: 2,151
|
Interesting... I would like to switch to this for my Magyar Mod, but there are some cons. But I have some questions.
1.) You said that this enables art for different eras which is misleading. Eras would be like ERA_INDUSTRIAL, but I see your point. Nevertheless, I would need eras in the actual sense as for some buildings I have art allowing me to flavor buildings more precisely. I have no clue about python modding, but I believe that the definitions for the eras should already be available as the game already uses them. For the XMLs, it should be rather unimportant what kind of eras you use. So, could you update this to use eras in the actual sense? Only then, I would use this. 2.) Does this support modular modding? I assume so. 3.) Is it multiplayer save? 4.) Would it be possible to flavour the citysets, too? I mean, not only those buildings that the player wants to build at some point, but also those generic houses? Even if not, This file would simplify my mod and merging it, so I could live without it. So, if you could update this so that point 1 to 3 are fulfilled, I'd gladly use this...
__________________
"Nobody can take us our history away. But it is ours only if we know it." –István Nemeskürty ![]() "If one man dreams, it's only a dream. If a lot of men dream, it's the beginning of a new reality." Join the hungarian forum http://civilizacio.road2us.com/ today! |
|
|
|
|
|
#16 | ||
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
Quote:
It could be done, but unfortunately I simply don't have time to mod, and will probably won't have time in the near future. So if someone else wants to do it - you're more than welcome to. I guess so, but I've never tried it like that myself. It should be. I don't see a reason it won't be. But again, never tested. Quote:
Sorry I couldn't be more helpful...
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
|
||
|
|
|
|
|
#17 |
|
Deity
Join Date: Mar 2007
Posts: 2,151
|
I see... I might try to get help with this from other users. Sounds like that would be okay to you.
__________________
"Nobody can take us our history away. But it is ours only if we know it." –István Nemeskürty ![]() "If one man dreams, it's only a dream. If a lot of men dream, it's the beginning of a new reality." Join the hungarian forum http://civilizacio.road2us.com/ today! |
|
|
|
|
|
#18 |
|
Deity
Join Date: Mar 2007
Posts: 2,151
|
So I've started to work on this. I think I successfully merged your package with WoC Lite, now I'm working on the era thing. Basically, I replace all the early, middle and late functions / calls with ancient, classical, medieval, renaissance, industrial, modern and future counterparts. It basically works, but there are two problems. A basic problem is that the game crashes if there is an invalid artdef referenced in the buildingartstyletype file, even without telling the user why. It would be the best if we would get a parse error if such things happen or at least if we simply don't show any building. Hints? These are the errors I got when the game crashed and debug mode was enabled:
Spoiler:
The second problem is that the modern and the future eras don't work properly. I assume it is because of the following code (CvInfos.cpp): Spoiler:
which replaced Spoiler:
I was assuming GC.getNumEraInfos() returns 7 for default BtS games as there are 7 eras. Dividing it by 2 returns 3.5, thus 4, 5 and 6 make the expression true. Late therefor stood for industrial, modern and future. Dividing it by 4 makes 1,75 and as 4, 5 and 6 are already out, 2 and 3 make the expression true. Thus, Medieval and Renaissance make up what was middle before or is for units. 0 and 1 thus stand for ancient and classical. Am I right? I have used fixed numbers to get this work for all the eras (I used >= 6 to have the code keep working if someone hacked the eras). Did I make any msitake?
__________________
"Nobody can take us our history away. But it is ours only if we know it." –István Nemeskürty ![]() "If one man dreams, it's only a dream. If a lot of men dream, it's the beginning of a new reality." Join the hungarian forum http://civilizacio.road2us.com/ today! |
|
|
|
|
|
#19 |
|
Deity
Join Date: Mar 2007
Posts: 2,151
|
Seems like I was wrong and the selection of the building art in-deed works as expected. My problem was only that in workbuilder I had choosen the wrong technologies, so the future era was never actually reached. After I added a breakpoint, I noticed that the function I cited from was never called as I had expected it. After selecting a few techs more the function got called and everything worked as expected. Now I will try to find a way to avoid a crash if an artdef is invalid or at least tell the user about the reasons. Besides of this, the new modcomp is functional and if anyone cares, I could upload it already so you can test it...
EDIT: I believe I found an acceptable solution using this code: Spoiler:
The ARTFILEMGR.getBuildingArtInfo(getXYZArtDefineTag(e Style)); will return NULL if the artdef is invalid, so we'll save the return value in dummy and then evaluate it. If it isn't NULL, everything was okay and we can leave the function returning dummy's value, otherwise we will stay in the function. Next and last thing the function will try is retrieving the buildings default artdef and return that. If there is no default artdef, I think the game would have thrown an error at us at mod loading phase, although I'm not too sure about that. At least, this should be a far more obvious xml mistake then a typo in the eras artdefs. To summarize it up, the game now should fall back to the default artdef if no valid artdef is available for the desired era. This ways, the modder might not even notice that there is an error, but that's still better than a crash. Also, if I'm not mistaken, it should be possible to just not give an artdef for certain eras that shall use the default art. Haven't tried what would have happened with asafs original dll and what happens now in this case though. Let me know if you guys see any problem with this code.
__________________
"Nobody can take us our history away. But it is ours only if we know it." –István Nemeskürty ![]() "If one man dreams, it's only a dream. If a lot of men dream, it's the beginning of a new reality." Join the hungarian forum http://civilizacio.road2us.com/ today! Last edited by cool3a2; May 16, 2011 at 03:13 AM. |
|
|
|
|
|
#20 |
|
Sleep Deprived
Join Date: Mar 2010
Posts: 1,315
|
In C++, the result of dividing an int is always rounded down - the non-integer part is truncated. So when you divide 7 by 2 you get 3, not 4.
As for the crush - I think that's true for all the art definitions in the game, even for the original DLL (unit art style etc.). If you want to solve this, you could probably assign a default art style when the art style is invalid. If it's working - sure! post your mod comp, and add a link here.
__________________
Civ IV Mod components: Power Up | Civics Dependency | Ethnic Buildings | My Custom DLL (Ver 7) | Fourth Yield | Unique Civics Civ IV Modding Tutorials: Compiling the DLL (including Using Visual Studio & Debugging), Version Control with TSVN New: A Game Font Editor for Civ IV (version 0.6, updated 15-Aug-2012)
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|