| 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 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
Trying ot change the "General" of the GG Bar to an icon...
As the title says, that's what I'm trying to do. I'd much prefer a Great General icon instead of the word "General". Unfortunately, it's not as easy as just defining:
Code:
def getGreatGeneralText(iNeededExp):
sGreatGeneralIcon = u"%c" % ArtFileMgr.getUnitArtInfo("ART_DEF_UNIT_WARLORD_COUNTER").getButton()
return BugUtil.getText("INTERFACE_NEXT_GREAT_GENERAL_XP", (sGreatGeneralIcon, iNeededExp,))
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#2 |
|
Time Lord
Join Date: Feb 2008
Location: between time and space
Posts: 344
|
That's in the feature tracker for BUG but maybe there are reasons why the actual implementation takes so long.
__________________
"Doctor? Doctor who...?" The Beyond the Sword Unaltered Gameplay (BUG) Mod
"It'll blow your mind!" - Sid M. Check out BAT and BULL, too. ![]() |
|
|
|
|
|
#3 |
|
Chieftain
Join Date: Oct 2008
Location: Covington, WA
Posts: 33
|
Its not working because your trying to shove an art file into a text string. The only "pictures" you can use in strings are the ones from the GameFont.tga file.
Try something like this Code:
def getGreatGeneralText(iNeededExp):
icon = u"%c" % CyGlobalContext().getGame().getSymbolID(FontSymbols.GREAT_PEOPLE_CHAR)
text = icon + " : " + str(iNeededExp)
return text
|
|
|
|
|
|
#4 |
|
Deity
Join Date: Jul 2006
Location: England
Posts: 2,972
|
I could add a GG glyph to the font file if you want. It would be pretty painless.
__________________
My work: Units - Leaderheads - Expanded Natives and Scandinavia Expansion (WIP) for BAT
The BtS Unaltered Gameplay (BUG) Project Forum - BUG 4.4, BAT 3.0.1 and BULL 1.2 Now Out! |
|
|
|
|
|
#5 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
Wow! Three answers! Cool!
![]() @ Doc, sorry I don't get you... ![]() @ Del69, that code looks (from my extremely limited understanding of Python) like it would probably work. One question though: GREAT_PEOPLE_CHAR defines slot 13,13 in the two GameFont files. And I know that in BtS, the FontButtonIndex tag of CIV4ArtDefines_Bonus.xml indicates which icon in GameFont to use for resources. But where are the definitions for everything else, and how to I tell the game that slot 13,24 (after the lightning bolt) is GREAT_GENERAL_CHAR? @ NikNaks, I think I'm ok with the graphic. I was able to take the GG icon from WarlordsAtlas_1 slot 5,10, and take out the background, so it's just the Generals head, with the rest transparent. Looks nice, if I do say so myself . So I have a template to work from, and I think I should be ok. But thank-you for the offer, and if I have trouble sizing it down, I will definately take you up on it.
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#6 |
|
Deity
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
|
I tried this before, and you can embed images into text using "<img src=/Art/Foo/Bar.dds></img>" or something similar. The problem was that when doing so, images get shifted a bit above the baseline of the text, making it look ugly.
My next thought was to simply place an icon as an image next to the text, but I got side-tracked with other things. This would still work, but I think NikNaks's suggestion of putting the image you've yanked out into the font file is the best route. It will align nicely with the baseline and be quite easy. I think it would be useful elsewhere, too, e.g. the CDA for settled specialists. Oh, I suppose you could embed the settled Military Instructor instead of the GG for the CDA thing, NN. Both is probably best.
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground. Silly monkeys, give them thumbs they make a club and beat their brother down. BUG Mod - BTS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ] |
|
|
|
|
|
#7 |
|
Radiant!
Join Date: Jan 2006
Posts: 526
|
|
|
|
|
|
|
#8 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
Ok, here are the two GameFont files with a GG icon added in.
fonts.rar I still odn't know how to tell the game where the new icon is located... I thought there would be a file somewhere in the BUG mod specifying the six new smilies on the last line of GameFont_75, but I can't find anything...
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#9 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
OK, so I thought I had it figured out, when I saw all the FontSymbols definitions at the end of CvUtil.py. But no, it doesn't work either.
Adding the line Code:
'great general' : FontSymbols.GREAT_GENERAL_CHAR, So, commenting out the line in CvUtil.py, and using this Code:
def getGreatGeneralText(iNeededExp):
sGreatGeneralChar = u"%c" % CyGame().getSymbolID(FontSymbols.OCCUPATION_CHAR)
return BugUtil.getText("INTERFACE_NEXT_GREAT_GENERAL_XP", (sGreatGeneralChar, iNeededExp,))
Code:
<TEXT> <Tag>INTERFACE_NEXT_GREAT_GENERAL_XP</Tag> <English>%s1 (%d2)</English> As you can see above, I have added a GG icon to the GameFont files, and the game seems fine loading those files instead of ones without the GG. But getting the game to recognize the existence of that icon is proving difficult. So, I don't know where to go from here. Any advice?
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#10 | |
|
Deity
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
|
Quote:
Well, now it is! I present to you the new FontUtil module. I just committed this to our code repository, so you'll need to be using the latest version from SVN. To define a constant, add the <symbol> tag to init.xml. Code:
<symbol id="greatgeneral" name="GREAT_GENERAL" from="POWER" offset="1"/> Code:
sGreatGeneralChar = FontUtil.getChar(FontSymbols.GREAT_GENERAL_CHAR)
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground. Silly monkeys, give them thumbs they make a club and beat their brother down. BUG Mod - BTS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ] Last edited by EmperorFool; Nov 02, 2008 at 11:49 PM. |
|
|
|
|
|
|
#11 |
|
Deity
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
|
BTW, the latest SVN version added some new font symbols itself, so just use your own file for your testing or modify my code above (offset = 2) if you put your icon next to the new Generic Citizen icon.
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground. Silly monkeys, give them thumbs they make a club and beat their brother down. BUG Mod - BTS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ] |
|
|
|
|
|
#12 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
EmperorFool, firstly, you are a coding genius. Thank-you.
Secondly, if adding new icons to the GameFont files is so difficult, how did you guys get the game to recognize your new War & Peace icons used by the Advanced Scoreboard? Thirdly, the download of the nightly update of BUG is broken. It presents this instead: Code:
An error has been encountered in accessing this page. 1. Server: civ4bug.sourceforge.net 2. URL path: /daily_build/ 3. Error notes: NONE 4. Error type: 403 5. Request method: GET 6. Request query string: NONE 7. Time: 2008-11-03 08:15:14 UTC (1225700114) Reporting this problem: The problem you have encountered is with a project web site hosted by SourceForge.net. This issue should be reported to the SourceForge.net-hosted project (not to SourceForge.net). If this is a severe or recurring/persistent problem, please do one of the following, and provide the error text (numbered 1 through 7, above): Contact the project via their designated support resources. Contact the project administrators of this project via email (see the upper right-hand corner of the Project Summary page for their usernames) at user-name@users.sourceforge.net If you are a member of the project that maintains this web content, please refer to the Site Documentation regarding the project web service for further assistance. NOTE: As of 2008-10-23 directory index display has been disabled by default. This option may be re-enabled by the project by placing a file with the name ".htaccess" with this line: Options Indexes
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#13 |
|
Deity
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
|
Hmm, I don't know why the nightly snapshot (a.k.a. daily build) is broken, but I highly recommend using SVN directly. It's not very difficult (easier than what you've done already I suspect), and the instructions are in the first post of the Download thread.
This will allow you to use a program like TortoiseSVN to get updates much more easily. In the meantime, however, to fix your code using the old way (the way I originally did the other new icons), change you code like so: Code:
sGreatGeneralChar = u"%c" % ( CyGame().getSymbolID(FontSymbols.OCCUPATION_CHAR) + 2 ) Why did I add this new method of doing it in XML? Mostly for convenience and fun. The problem is that when merging other mods that might define their own new symbols, the positions in the files may clash. Moving those to XML makes it much easier for modders to merge font file constants--not the files themselves, though, but they're just images so that part isn't too bad. I got sick of seeing font symbols for unrelated symbols, e.g. the War icon used to grab the CvYieldInfo object for and then offset it 25 positions in Python. That's a nightmare to explain to someone trying to do a merge that may have very limited Python skills. But telling them to modify an XML attribute from "25" to "26" is much safer.
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground. Silly monkeys, give them thumbs they make a club and beat their brother down. BUG Mod - BTS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ] |
|
|
|
|
|
#14 |
|
Prince
Join Date: Jan 2007
Location: Ottawa
Posts: 438
|
Absolutely I agree with you. The new way will definately be easier to explain to noobies. In the meanwhile, this works like a charm. Just great! Thanks again!
__________________
The Modiki (seen above) still needs detailes on the XML files. Please help in transferring data from the old Civ IV Wiki. Thank-you. Impaler[WRG]'s Upgrade Cost Modifier, updated for BtS v3.19, TheLopez's Great Generals from Barbarian Combat Mod, updated to BtS v3.19 English Spelling Mod "It's not your blue blood, your pedigree or your college degree. It's what you do with your life that counts." - Millard Fuller "Imagination is the foundation of reality." - Dylan Henry |
|
|
|
|
|
#15 |
|
Radiant!
Join Date: Jan 2006
Posts: 526
|
OK, so, when will the generals' icon be added to bug?
|
|
|
|
|
|
#16 |
|
Deity
Join Date: Mar 2007
Location: Mountain View, California
Posts: 9,624
|
Done. 8910
__________________
Monkeys killing monkeys killing monkeys over pieces of the ground. Silly monkeys, give them thumbs they make a club and beat their brother down. BUG Mod - BTS Unaltered Gameplay [ Forum | Download | FAQ | Known Issues | Troubleshooting | Modding Tutorial ] |
|
|
|
|
|
#17 |
|
Radiant!
Join Date: Jan 2006
Posts: 526
|
That's great
|
|
|
|
|
|
#18 | |
|
Priest of Hiroshima
Join Date: Jan 2004
Location: Bay Area, California
Posts: 2,515
|
Quote:
__________________
My misconception is closest to the truth... Beyond the Sword Unaltered Gameplay Project - BUGs, and BATs, and BULLs... oh my! How to Release Your Mod! لآ اِلَهَ اِلّا اللّهُ مُحَمَّدٌ رَسُوُل اللّهِ |
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Real 'Near Future': "Mechs","Super Tanks","Super Soldiers","Space Elevator",Etcetera | Wade. | Civ4 - General Discussions | 89 | Jul 15, 2009 08:20 PM |
| The "No T&L" Bar is Now Open... | agoodfella | Civ4 - Technical Support | 21 | Oct 28, 2005 11:01 PM |
| Culture bar doesn't "fill up" | Don Uittone | Civ3 Conquests - Bug Reports | 3 | Jul 30, 2004 01:36 PM |
| Petition to rename OT to "Metaphysics Flame-Bait" | Kilroy | Site Feedback | 9 | Sep 05, 2003 04:39 AM |