Modding the HUD -- a diary/discussion

I don't think anyones done it Gaius, I was a little surprised to see you posting here. ;) Well that question would be aimed at a coder, 3 files directories and contents would need to be changed era to era. You may have problems with it, because the HUD loads with the start of the game.
 
Good luck, you'll get some screwy spit in the process.

If you need any answers to questions PM me.
 
Yes, but the interface is redrawn every 250 ms so I suppose you could override it somehow... I'd have to think.

I've made a new interface for the Main Interface in the relevant .py file. I just made new panels with other .dds files. I do a check for what Civ the player is playing as and change the color and some images (like showing the leaders face) of the interface depending on the active Civ and Leader.

I could easily do the same but for eras instead. Just do a check for what era it is and change the image accordingly. For example:

Code:
iEra = CyGame().getActivePlayer().getCurrentEra()

screen.addPanel("InterfaceTopLeft", u"",u"", True, False,   4,yResolution +4, 256, 128,PanelStyles.PANEL_STYLE_EMPTY)
screen.addDDSGFC( "InterfaceTopLeft", 'Art/Interface/Screens/MainScreen/[COLOR=Blue]Topleft_'+str(iEra)+'.dds'[/COLOR], 1, 1, 256, 128, WidgetTypes.WIDGET_GENERAL, -1, -1 )
screen.hide( "InterfaceTopLeft" )
And then have an image for every era with the name Topleft_#.dds where # is that era's index.

You can even update the interface on every frame by calling on the screen in your onUpdate() event function in your eventManager.

Code:
def onUpdate(self, argsList):
     'Called every frame'
     self.parent.onUpdate(self, argsList)
     fDeltaTime = argsList[0]
     global TARGETING
     global CLICKED_ON_PLOT
     global UNLOADING
            
     if not gc.getGame().GetWorldBuilderMode():
          screen = CyGInterfaceScreen( "MainInterface", MAIN_INTERFACE )
          screen.hide( "InterfaceDamageOverlay" )
          screen.hide( "DamageOverlayTitle" )

          mousePos = CyInterface().getMousePos()
          overlayX = mousePos.x+20
          overlayY = mousePos.y+10
I use this to update the stars you see in the screenshots below, and for the Damage Overlay seen, to follow the cursor.
 

Attachments

  • max_orange_star.jpg
    max_orange_star.jpg
    265.3 KB · Views: 373
  • eagle_green_earth.jpg
    eagle_green_earth.jpg
    227.6 KB · Views: 429
I agree, bravo, Grey Fox! That's precisely along the lines I was thinking. :)

One other question: I noticed in those screenshots that you have units with extra elements, such as "fuel" and "health." How did you manage that? (SDK work, I know...) I'm curious because I might be able to use that for the Quantitative Resources project, particularly the oil counter I am working on. Is there anyplace I can download the source code? :mischief:
 
I will share the code once it's stable enough.

But while I am here with internet access, I might make a modcomp with the fuel part.

The health is basically the old strength attribute just renamed. The reason I use it as health (with a new icon) is cause I don't use it all for combat anymore (I got a completely new combat system in place).

And the ammo system is a bit harder to make into a modcomp since it's part of my new combat system.

So I'll see about doing a fuel modcomp.
 
Good, it would be interesting to see how our two different systems compare. :D From the screenshot, I take it that you've made it unit-specific, so that each army has its own supplies lines and fuel reserve. The way I plan to do it in QR, based on Duke176's oil counter, it's a civ-wide reserve, so that movement takes fuel from a national stockpile.

I don't know how you've arranged it exactly, but I'm curious as to how you addressed the resupply and micromanagement issues. Is there just a set range based on borders and cities, where a unit is "in supply", and if it leaves that area, it's out of supply? Or is it deducted per turn? Anyways, looks to be very good stuff. :D
 
Land units and sea units lose 1 fuel per turn, and 1 fuel per tile moved. Air units lose 2 fuel per turn, and 1 fuel per tile moved. Sea units are the same as land units except for submerged submarines that lose 5 fuel per turn. (They start surfaced and are not invisible like that)

Infantry use the same function as other land units, Fuel is just renamed Rations in the Hud.

Units can resupply in the appropriate city type, Land units in cities and bases, air units in airports and sea units in ports. APCs can also resupply all unit types (with the resupply mission which resupplies all units in the 4 directions N, S, E and W. And also, all units situated next to the APC at beginning of turn gets resupplied automatically)

Air units and sea units with 0 Fuel at beginning of turn falls from the sky or sink. Land units just can't move.
 
Wow! I'm pretty impressed! I thought I was the only one working on a complex HUD, but apparently I am mistaken. I must hurry and finish mine before someone does something more impressive. :p
 
Well, I was going to wait until it was complete to show this, but I'm so close to being finished that I might as well post an example. This is what I've managed to achieve with a little knowledge of the thm files and python, a few games with good graphics to steal, photoshop and a lot of patience.

http://i270.photobucket.com/albums/jj106/The_Mattastic/CityScreen.jpg

I'm pretty fond of the progress bars. I think I've done a good job. :)
 
wow real impressive
 
Good, it would be interesting to see how our two different systems compare. :D From the screenshot, I take it that you've made it unit-specific, so that each army has its own supplies lines and fuel reserve. The way I plan to do it in QR, based on Duke176's oil counter, it's a civ-wide reserve, so that movement takes fuel from a national stockpile.

That's basically what I've done in the modcomp I promised. No supply lines or anything, but that can be added easily through python or additional changes in the SDK.

Download it here (Unit Fuel Mod)
 
Great job @ Mattastic!!!

I came to this thread because I am working on a mod for Diplomacy games, and the main title image is green, dark brown, and gold. Which just so happen to be the same colors used in that image you posted. Would you mind if I used it for our mod? I'll give credit obviously, because that looks fantastic!

I just realized how long ago he posted that, and that he didn't seem to have uploaded anything. :(

Well back to the drawing board.
 
Good evening everyone!

I am so incredibly glad to see that my old project on this has spawned enough interest to become a core part of many of the great Civ4 Mods out there.

Sadly I haven't touched Civ4 in quite some time - I've fiddled a little here and there when the new expansions were released, but thanks to numerous changes in personal life, time is just so hard to come by.

I managed to find a copy of Civ Revolution for Xbox 360 recently, and started thinking of this old HUD-modding project I had started back in the old early days of the game, and wanted to touch base with everyone who had seen this and thanked me and took my work a step further.

First, my apologies for dropping the whole thing without warning. When I had originally started this project, I was a store manager at EBGames/GameStop. Losing that job caused a flurry of activites that, two years later, has resulted in my current occupation in the United States Air Force as an F-15 Mechanic.

Unfortunately, my new career is infinitely time consuming. But my love of gaming has never died down, and I intend to take Civ4 off the shelf, dust it off a bit and give it another go. Between two MMO's that I currently play, and a handful of console games as well, though, I cannot say that I'll be able to do any sort of modding work.

I wish everyone luck in their modding endeavors, and perhaps some day in Civ5 I'll find a way to get elbows deep in code again :D

-- Rayanth
 
Top Bottom