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

Attitude Icons

Discussion in 'Civ4 - Mod Components' started by Porges, Apr 15, 2006.

  1. Porges

    Porges Chieftain

    Joined:
    Mar 28, 2006
    Messages:
    50
    Ok, so I took the idea from SimCutie's main interface mod, simplified it a bit and here it is:

    Find CvMainInterface.py (in CustomAssets/python/screens), or if you have 12Monkey's PLE installed, to PLEMainInterface.py (CustomAssets/python/screens also). If you don't have either, just copy the file from your main CivIV directory.

    Directly after the line:
    Code:
    szTempBuffer = u"%d: %s" %(gc.getGame().getPlayerScore(ePlayer), gc.getPlayer(ePlayer).getName())
    Put the following code:
    Code:
    #attitude icons - start					
    
    								if not gc.getPlayer(ePlayer).isHuman():
    
    									iAtt = gc.getPlayer(ePlayer).AI_getAttitude(gc.getGame().getActivePlayer())
    
    									att =  unichr(ord(unichr(CyGame().getSymbolID(FontSymbols.POWER_CHAR) + 4)) + iAtt)
    
    									szTempBuffer = szTempBuffer + ( u" : %s" % att )
    #attitude icons - end
    If you want to hide dead players from the list, also scroll up a little and change:
    Code:
    if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv()):
    to
    Code:
    if (gc.getPlayer(ePlayer).isEverAlive() and not gc.getPlayer(ePlayer).isMinorCiv() and gc.getPlayer(ePlayer).isAlive()):#hide the dead ones
    Download the attached font files and stick them in CustomAssets/res/fonts/

    Looks like this (friendly icon not shown):
     

    Attached Files:

  2. Caesium

    Caesium Radiant!

    Joined:
    Jan 14, 2006
    Messages:
    526
    Wow, looks good.
     
  3. TheLopez

    TheLopez Deity

    Joined:
    Jan 16, 2006
    Messages:
    2,525
    Location:
    Oregon
    Or you can use my Dead Civ Scoreboard mod which can do this or some other little things like grey out dead players, etc.
     
  4. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    I like it! Very cool.
     
  5. Spocko

    Spocko Warlord

    Joined:
    Dec 18, 2005
    Messages:
    168
    Location:
    Dover, New Hampshire
    This mod is great - love the icons! However, my gamefont.tga file contains modded images that I need to retain - and I don't have the tools I need to copy the five smilies over to my current gamefont.tga. My gamefont files have the icons associated with Alulim's Alt Religion mod.

    Those of you in the know recognize I'm fighting against Alpha Channels. I don't have a graphics background, so it is beyond my abilities to knowingly wade through the zillions of options available to us in these graphic programs. I'm using PaintShop Pro 5.

    Now, it would be nice to upload these two tga files and ask for one of you wizards to make a quick edit, but CF won't let me upload tga files.

    How can I best get help on copying the smilies from Porges' gamefont files to my own?
     
  6. Porges

    Porges Chieftain

    Joined:
    Mar 28, 2006
    Messages:
    50
    Whereabouts are the additional religion icons? You could try selecting the region around them to the edge of the TGA, then copy and paste it over the top of mine, lining up the edges of the pasted area and the image.

    Failing that, find somewhere to upload them and I'll do it :)
     
  7. Spocko

    Spocko Warlord

    Joined:
    Dec 18, 2005
    Messages:
    168
    Location:
    Dover, New Hampshire
    Thanks for the offer Porges. I've tried cutting and pasting, and it was easy for me to line up the image - the problem has been having them (the attitude smilies) display via CvMainScreen. There was one time when CvMainScreen displayed all kinds of junk on the game screen, but mostly CvMainScreen displays all icons correctly except the smilies I pasted in the gamefont and gamefont75 files.

    I played around with PSP5 and got the Alpha Channel to show up (lots of gray boxes behind very crisp icon graphics), but when I tried to paste onto the layer with the gray boxes, it would paste the magenta outlines as well, along with all the black dithering outside adjacent icon images.

    Anyway, I don't know how to work with this - and I think I'll see if I can learn how to do it through GIMP (because I eventually want to build new flags, new leaders, new civs that are not from Earth's history).

    So, I've zipped the two gamefont files together - hopefully CF will let me upload ZIP files :) My gamefonts contain Alulim's Alt Religion mod icons instead of the vanilla religion icons (they're located at the same place in the gamefonts as the vanilla religion icons).

    While I fumble around with learning GIMP, maybe you could quickly copy your smilies into my gamefont files?

    A hearty Thank You!
    Spocko
     

    Attached Files:

  8. Porges

    Porges Chieftain

    Joined:
    Mar 28, 2006
    Messages:
    50
    Actually, I'm pretty sure that only the _75 version is used by my mod, so I just edited that one. If it turns out I'm wrong I'll upload the other as well :)
     

    Attached Files:

  9. Spocko

    Spocko Warlord

    Joined:
    Dec 18, 2005
    Messages:
    168
    Location:
    Dover, New Hampshire
    Works great!!

    Thank you!
    Spocko
     
  10. Porges

    Porges Chieftain

    Joined:
    Mar 28, 2006
    Messages:
    50
    Good :)

    I've updated the ones attached to my post, turns out the smilies were one pixel off :)
     
  11. Agent 009

    Agent 009 Civ 4 Addict

    Joined:
    Mar 28, 2006
    Messages:
    346
    Location:
    In a virtual Civ 4 Environment.
    I really like this idea, however, it isn't working for me.

    Do I have to put the CvMainInterface.py file into the custom assets or can I just put it in it's respective place for my mod?

    I'd like to add this component into my mod but the problem I am having is that the smilies don't appear. I get a blank space where they should be.

    Is this because of the file location or is because I loaded a previously saved game?


    EDIT: I just thought maybe it was the way I entered the coding... and well now I lost the interface altogether... not sure why. :(
    EDIT2: Well I fix the lost interface problem but still don't have the icons showing up... Is it because of the location of the icons in the TGA file perhaps?
     
  12. Agent 009

    Agent 009 Civ 4 Addict

    Joined:
    Mar 28, 2006
    Messages:
    346
    Location:
    In a virtual Civ 4 Environment.
    OMG... you won't believe what the problem was...

    I made my own icons and didn't use your game font file. Well that was it... for some odd reason it was just not seeing my icons... I put them in exactly the same place as you had yours and it didn't work.

    Now I am going to just fix it up to have the icons I wanted in there and I'll be happy. :D
     
  13. jgbaxter

    jgbaxter Warlord

    Joined:
    Apr 23, 2006
    Messages:
    202
    Ah, this was just what I was looking for. :)

    However, I can't get it to work. :(

    What happens is that I get neither the score/name/emotes shown, I only get displayed the trade route icon and the religion icon.

    Ideas?
     
  14. Agent 009

    Agent 009 Civ 4 Addict

    Joined:
    Mar 28, 2006
    Messages:
    346
    Location:
    In a virtual Civ 4 Environment.

    It is probably the was you put the code into the file. Python is very unpredictable and must be perfect... one thing out of place and you get strange effects like that.

    Last night I was having trouble getting this to work also... and because the emotes weren't showing up I thought it was the code... so I tried to fix it, not actually changing any of the code itself but rearranged it to look neater. Well, I lost the entire interface as a direct result, and because I had gone into world builder to place an AI unit near my first city to see if the emotes were working... I couldn't get out of the WB and so I had to alt-tab out and do the 3 finger salute. :p

    Suffice it to say I suggest opening up the file again and paste the code exactly as it is without changing the way it is arranged and place it exactly after the line mentioned above. It works perfectly over here. So I don't think you'll have any problems if you try redoing it. ;)
     
  15. DrJambo

    DrJambo Crash-test dummy

    Joined:
    Dec 27, 2001
    Messages:
    1,027
    Location:
    Athens of the North (Edinburgh)
    I have to say, this is a really useful mod! No idea why Firaxis don't have something similar in the vanilla version.
     
  16. DrJambo

    DrJambo Crash-test dummy

    Joined:
    Dec 27, 2001
    Messages:
    1,027
    Location:
    Athens of the North (Edinburgh)
    I take it this will work ok for Warlords?
     
  17. Epicurist

    Epicurist Chieftain

    Joined:
    Dec 3, 2001
    Messages:
    60
    no..it doesnt work with warlords yet..we're all trying to get it worked out..

    right now it works unitl u build a wonder in that city..then it starts messing up
     
  18. turlute

    turlute Chieftain

    Joined:
    Feb 23, 2006
    Messages:
    18
    Works just fine with Warlords for me.
     
  19. Epicurist

    Epicurist Chieftain

    Joined:
    Dec 3, 2001
    Messages:
    60
    Well for the rest of the Warlords players (as discussed in other threads)

    What it does is..when u first play..it works fine...but build a wonder in a city then go into the city screen. Notice a small delay? Now look in the bottom right side, it still shows the icons over the workers/people.

    The cities with non-wonders work fine..but as you build wonders in towns, it starts slowing the fps in the city screens etc..
     
  20. turlute

    turlute Chieftain

    Joined:
    Feb 23, 2006
    Messages:
    18
    Are u sure u modified the right CvMainInterface.py and not just copied the 'non-warlods' one over ?
    I just finished a game and opened several city screen with wonders or not, never noticed a delay and I dont see the icons on top of it.
     

Share This Page