modding the tech tree: getting started

See Troller0001's post, your XML isn't being applied to the database at all due to the highlighted error
Yep, saw that this time :crazyeye:

There was this in the .modinfo file:
Code:
<Actions>
    <OnModActivated>
      [COLOR="Red"]<UpdateUserdata>[/COLOR]CIV5Technologies.xml[COLOR="red"]</UpdateUserdata>[/COLOR]
      <UpdateDatabase>Updates.sql</UpdateDatabase>
    </OnModActivated>
  </Actions>
which means you misclicked on 'UpdateUserdata' for the .xml file, while it should be "UpdateDatabase" (Go to the Actions-tab in modbuddy)

NOTE: While testing, I added (as in, stole them from atomic era technologies) text, descriptions, and icons to the new technologies. I also removed all the deletions of the starting tech. With all that changed, I was again able to scroll the tech tree.

EDIT: See Whoward's post too
Thanks for that and sorry for not getting back to you - i missed your post as I was responding to whoward69; Seems the updates are "working" correctly now. In the tech tree, there is an empty (non clickable) tech for fishing, hunting is not showing up and prereq techs are still not working. Also the classical era header is screwed up. I'll try adding some text fields for fishing etc to see if that resolves things. At least I know things are updating properly.

Thanks for pointing me in the right direction regarding the previous fixes :)
 
To better isolate the issues that I have been facing, I have decided to focus on getting one tech to work properly (fishing). I am omitting hunting for now. I have changed the structure of my mod to have 2 SQL files, one for insertions and the other for updates. I still have the XML but its not activated on mod load and I will phase it out later.

Here is whats working.

1) I have been able to get the tech to display in the tech tree.
2) The tech is clickable (yay)
3) The help text is working properly

Here is whats not working; both queries are in Updates.sql:

1) I can't associate the workboat unit with fishing:

UPDATE Units SET PrereqTech = 'TECH_FISHING' WHERE Type = 'UNIT_WORKBOAT';

2) I can't update the prereqtech for sailing and set it to fishing:

UPDATE Technology_PrereqTechs Set PrereqTech = 'TECH_FISHING' WHERE Type = 'TECH_SAILING';


I tried to debug the SQL but my breakpoint was not hit; not sure how that works. I have uploaded the full (updated) mod should anyone want to check it out.

EDIT: The update for the PrereqTech regarding fishing boats is now working. I have not done anything to make it work (code wise) minus restarting the entire game. Am continuing to invistigate why Technology_PrereqTechs is failing to update. I have not seen anything suspicious in the Database.log file.


EDIT2: Solved the second problem; was using Type instead of TechType. The log did not point that out to me though; I discovered it by chance. To save time in the future, I really need to find out how to debug or evaluate which SQL statements are not working and why. I'll look more into that tomorrow but sofar I have only found this.
 

Attachments

  • Ancient Techs Rebalanced (v 1).zip
    102 KB · Views: 29
I am doing the finishing touches of adding a tech in the tech tree. Right now I have 2 outstanding items;

1) Adding a portrait icon for the tech (I am using civ4's portrait headers)

2) Attaching a sound file to the quote (Again I am using civ4's mp3)

I found that PortraitIndex in the Technologies table represents the portrait for the tech in the tech tree and AudioIntro represents the audio; My questions are then the following;

i) What file format should the portrait for the tech image be?

ii) How do I tell the mod to use the graphics file that I have in my solution and associate that new file to the newly created portrait index?

iii) How do I the above with the audio file? I figure with the answer to the above I should figure the audio one out.
 
Thanks again for the input. Having installed the 32 bit version of gimp as per the instructions in this post, I proceeded to download the 32 bit dds plugin (a mere .exe that needs to be pasted in the C:\Program Files (x86)\GIMP 2\lib\gimp\2.0\plug-ins directory. Unfortunately the plugin simply does not work; In gimp with a file loaded, when choosing the "save by file type" in the save as menu, the dds extension simply does not show up.
I have tried to solve this relentlessly by jumping between versions to no avail.

EDIT: The plugin does show up in my plugin browser;

EDIT 2: I noticed that I am able to open dds files in gimp. Still working on figuring out how to save files as type dds.

EDIT 3: I found a workaround; you can export a file as dds format (not save as one). Seems this should solve my problem regarding saving dds files.
 
EDIT 3: I found a workaround; you can export a file as dds format (not save as one). Seems this should solve my problem regarding saving dds files.[/B]

It's not a workaround, it's intended to be like that ;) (it changed quite a few patches ago)
 
It's not a workaround, it's intended to be like that ;) (it changed quite a few patches ago)
Ok, that makes me feel better - I have not had much time to dedicate to modding these last couple of days but have beenr reading parts of whoward69's image tutorial. I am performing the "Adding Icons for Buildings" part. Will make another post in the next few days based on how it goes. Thanks again both of you for the continued feedback. Finding my way slowly but surely :)
 
I have completed the steps under "Adding Icons for Buildings" in whoward69's tutorial. When I test ran the game, the images appeared in the tech tree and in the help menu, but were offset and had some blue lines on them (see attached images).

I am guessing something got lost in translation when I saved the dds files, however opening the dds files independently seems to display correct (uncorrupted) images. I have attached the latest version of my mod for everyone's perusal - the IconTextureAtlases for the fishing icon are in GameData.xml and the fishing tech (with the corresponding atlas) created in Inserts.sql. That said I believe something is wrong with the dds file itself rather then the code.

If anyone has a quick answer to this based on previous similar experience i'd be glad to hear it.
 

Attachments

  • Ancient Techs Rebalanced (v 1).zip
    227 KB · Views: 28
  • FishingHelp.png
    FishingHelp.png
    300.7 KB · Views: 99
  • FishingTech.png
    FishingTech.png
    15.2 KB · Views: 43
See http://forums.civfanatics.com/showthread.php?t=499400

A 128x128 icon is not actually a circle of diameter of 128 pixels, but a circle of 86 pixels CENTRED in a box 128x128.

Looks like your icons are NOT centred in the appropriate sized boxes
What I did was extract a circle png from the square civ4 icon of and paste it in the empty circle of its appropriate size in the .xcf file. It fit perfectly in the white circle. So for a white circle of 128 pixels (xcf), my circle graphic should not be more than 86 pixels? I should have emtpy whitespace around the graphic after pasting it in? I guess I just don't get it.

Either way it looks like I need to do different resizing according to the excel file for tech icons.
 
I should have emtpy whitespace around the graphic after pasting it in?
Yes, you shouldn't crop it

So a single 256px* icon should look like this:
-------a line to show its height-------
--a line to show its width--
------another line to show its height---
Icon art was made by Keniisu for the Monaco Civ that we still haven't finished :mischief:


*The icon (as in, the circle) itself is actually only 172px wide
 
@Troller0001 / whoward69

Thanks again for the clarifications; I was able to resolve this problem (after re-reading your posts 100x; i'm a bit slow); I had cropped the image as was suggested earlier.

I now have the final outstanding item which is to add audio to the discovering of the fishing tech; I looked into tutorials in the subforum that whoward69 suggested however I only found this one which was about inserting music for leaders. So I took the approach of doing searches for sound tags in existing techs to understand how sound data is linked up. Here is my sql / xml:

Insertion of Fishing Tech (SQL):

Code:
INSERT INTO Technologies (Type, Cost, Description, Civilopedia, Help, Era, Trade, GoodyTech, GridX, GridY, Quote, PortraitIndex, IconAtlas, AudioIntro, AudioIntroHeader) 
VALUES ('TECH_FISHING', 20, 'TXT_KEY_TECH_FISHING_TITLE', 'TXT_KEY_TECH_FISHING_DESC', 'TXT_KEY_TECH_FISHING_HELP', 'ERA_ANCIENT', 1, 0, 0, 0, 
'TXT_KEY_TECH_FISHING_QUOTE', 0, 'FISHING_ICON_ATLAS', 'AS2D_TECH_FISHING', 'AS2D_HEADING_TECH_FISHING');

Insertion of Sound Data (XML) - I have a "Sound" folder with the TechFishing.mp3 file (VFS set to true):
Code:
<GameData>
	<SoundDatas>
		<Row>
			<SoundID>SND_TECH_FISHING</SoundID>
			[B]<Filename>Sound/TechFishing.mp3</Filename>[/B]
			<bDontCache />
			<bOnlyLoadOneVariationEachTime />
			<LoadType>DYNAMIC_RES</LoadType>
		</Row>
	</SoundDatas>
	<Script2DSounds>
		<Row>
			<!--AudioIntro -->
			<ScriptID>AS2D_TECH_FISHING</ScriptID>
			<SoundID>SND_TECH_FISHING</SoundID>
			<fTaperSoundtrackVolume>0.85</fTaperSoundtrackVolume>
			<SoundType>GAME_SPEECH</SoundType>
			<iMaxVolume>80</iMaxVolume>
			<iMinVolume>80</iMinVolume>
		</Row>
	</Script2DSounds>
</GameData>

Unfortunately the above does not work upon discovering the fishing tech. Let me know if I missed anything obvious, otherwise I'll take another look at it tomorrow and should eventually be able to figure it out.
 
Hmm I've never done anything like that, so I don't know.
(btw, did you fix the odd blue-line-issue on the icons)

EDIT: Also, do the logs say anything?
 
Unfortunately the above does not work upon discovering the fishing tech.
Did you check the "Reload Sound System" box in ModBuddy?
 
(btw, did you fix the odd blue-line-issue on the icons)

These are an artefact of the DDS image not being big enough for the UI <Image> container (ie an 86x86 pixel image in a 128x128 container). In this case the UI code duplicates the right hand and bottom edge pixels to fill the space
 
@Troller0001 / whoward69

Yes I did fix the blue line issue thanks to both of your clarifications :) The icons now fit perfectly! I was not clear that I had resolved this issue in my previous post.

@whoward69

No I did not check the "Reload Sound System". Where in modbuddy is this option residing?
 
After many attempts (and checking the log files) it became evident that I was trying to insert audio into tables that don't exist. I also came across this (read first item); dont' know if its accurate.
 
I also came across this (read first item); dont' know if its accurate.

Audio is possible - see tutorials such as http://forums.civfanatics.com/showthread.php?t=495838 and http://forums.civfanatics.com/showthread.php?t=493367

Edit: Also the Enlightenment Era mod adds techs with sound bites, so look to see how they do it
 
Audio is possible - see tutorials such as http://forums.civfanatics.com/showthread.php?t=495838 and http://forums.civfanatics.com/showthread.php?t=493367

Edit: Also the Enlightenment Era mod adds techs with sound bites, so look to see how they do it
The link examples that you pointed me to are about music (they require different configuration than game speech).

The Enlightenment Era mod on the other hand, was tremendously useful. Thanks to it, I know now that I am inserting the information correctly (the log files are not complaining any more). Upon tech discovery however, the sound is still not playing. You mentioned checking the Reload Sound System in modbuddy, however I still have not found out where to do that. Maybe thats whats missing.

Edit: found the reload sound system (didn't realize I could scroll down). Now the audio works!
 
I tried to re-implement the civ4's Technology_ORPrereqTechs which makes it possible for a technology to have 2 or more OPTIONAL prerequisite techs (researching any of them allows you to research the tech in question). While this technically worked, the tech tree was not graphically updated with the appropriate prerequisite lines arrows making the techs "float" in isolation (see pottery in attached pic - it can be researched either by having fishing or hunting yet there are no arrows to indicate that). After some searching, I noted that there is no actual civ5 tech that uses this. So it seems that Technology_ORPrereqTechs is partially implemented but not supported. So for now I will skip this step as I am getting stuck in over perfectionism mode.

Thus I have gone ahead and published this mod. I would like to thank in particular Troller0001 and whoward69 for your continued feedback which helped me navigate through the numerous issues that I faced. This mod would not have been possible without your contributions - I made sure to mention both your names in the mod description :)

I will continue to make small updates; I might reduce gold for furs and ivory (as players will have access to them much earlier) and set that gold back to normal level upon the discovery of trapping (to make trapping sexier). I'll also crop out the civ4 "ding" sound from the audio file that plays when you discover hunting / fishing.
 

Attachments

  • NoOrOption.jpg
    NoOrOption.jpg
    360.7 KB · Views: 98
Top Bottom