Mod-Modders Guide to Fall Further

That's what I'd assume too but I don't want to mess with that file unless I know for sure. :lol:
It's in it:
Code:
#Awakened display

		screen.hide( "SRText" )
		screen.hide( "Awakenedchance" )
		if (not CyInterface().isCityScreenUp() and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_HIDE_ALL and CyInterface().getShowInterface() != InterfaceVisibility.INTERFACE_ADVANCED_START and CyInterface().getShowInterface() == InterfaceVisibility.INTERFACE_SHOW):	
			pPlayer = gc.getPlayer(gc.getGame().getActivePlayer())
			if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_SCIONS') and pPlayer.getNumCities() > 0:
			
 #figuring spawn chance

				fSpawnOdds = cf.doChanceAwakenedSpawn(-1)
				fFirstPart = fSpawnOdds / 100
				fSecondPart = fSpawnOdds - (fFirstPart * 100)
#/figuring spawn chance
				if fFirstPart + fSecondPart > 0:

					SRstr = u"<font=2i>%s</font>" %(str(" ") + str(fFirstPart) + str(".") + str(fSecondPart) + str("% "))
					screen.setImageButton("Awakenedchance", "Art/Interface/Buttons/Units/Scions/awake.dds", 84, 106, 16, 16, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.setText( "SRText", "Background", SRstr, CvUtil.FONT_LEFT_JUSTIFY, 103, 104, 0.5, FontTypes.GAME_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
					screen.setHitTest( "SRText", HitTestTypes.HITTEST_NOHIT )
				else:
					screen.hide( "Awakenedchance" )
					screen.hide( "SRText" )
#/Awakened display
Shouldn't be hard to understand and to adapt ;)
 
Sigh. My plans keep making me go to files I hate. :lol:

Thanks for find that! I was still working on the actual spawning when I posted. :p
You're welcome! I don't have much to do yet... or rather I can't since my computer is currently used by someone else. I got new things to think about so it's not that bad :)

I'm eager to try your new features :goodjob:
 
Is there a problem with this function?
Code:
def spellStopSinging(caster):
	lSongs = [gc.getInfoTypeForString('PROMOTION_IS_SINGING_MELODIES_OF_LIFE'),\
		  gc.getInfoTypeForString('PROMOTION_IS_SINGING_WHISPERS'),\
		  gc.getInfoTypeForString('PROMOTION_IS_SINGING_THE_IMPREGNABLE'),\
		  gc.getInfoTypeForString('PROMOTION_IS_SINGING_EYES_OF_THE_SEA')]
	for i in range(len(lSongs)):
		if caster.isHasPromotion(lSongs[i]):
			caster.setHasPromotion(lSongs[i], false)
I guess it's the way I did my list. I think I read on a tutorial that it's possible to set it up like that, although it may have been only showed with tuples, the things with parenthesis instead of brackets. When I click on that spell, Civ4 goes nuts and crash, taking my computer with it! :lol:
 
Yeah, the list looks wrong. The way I've always used it would be

Code:
def spellStopSinging(caster):
    sValidSongs = ['IS_SINGING_MELODIES_OF_LIFE', 'IS_SINGING_WHISPERS', 'IS_SINGING_THE_IMPREGNABLE'), IS_SINGING_EYES_OF_THE_SEA']
    iValidSongs = [gc.getInfoTypeForString('PROMOTION_' + sSong) for sSong in sValidSongs]
    for i in range(len(iValidSongs)):
        if caster.isHasPromotion(iValidSongs[i]):
            caster.setHasPromotion(iValidSongs[i], false)

The way I did it is quite possibly wrong, as I've used it for terrains and units but never promotions.... Not quite sure how to specify a promotion type, aside from isHasPromotion, which doesn't work like getTerrainType or UnitType.
 
I changed it this way:
Code:
def reqStopSinging(caster):
	lSongs = []
	lSongs.append(gc.getInfoTypeForString('PROMOTION_IS_SINGING_MELODIES_OF_LIFE'))
	lSongs.append(gc.getInfoTypeForString('PROMOTION_IS_SINGING_WHISPERS'))
	#lSongs.append(gc.getInfoTypeForString('PROMOTION_IS_SINGING_THE_IMPREGNABLE'))
	#lSongs.append(gc.getInfoTypeForString('PROMOTION_IS_SINGING_EYES_OF_THE_SEA'))
	iValue = 0
	for i in range(len(lSongs)):
		if caster.isHasPromotion(lSongs[i]):
			iValue += 1
	if iValue > 0:
		return true
	return false
I commented out those two lines because the promotion aren't done yet... and I think that may have messed it all before. So maybe the way I did it before wasn't that bad.

Anyway, thanks for showing me this bit of code as I had already thought of doing something similar but had no idea how to do it. Basically, I would want to trade the PROMOTION_ of some "promotions" to SONG_, for example. Would it work? I mean, starting promotions by PROMOTIONS_ is required or is it just a convention?
 
As far as I am aware, the second way works because you're getting the information, and THEN storing it to the list, rather than trying to get it from inside the list. Basically the reverse of how I did it, but it apparently works just as well.. Never knew you could do it like that. :lol:

The way I did it, you have to use PROMOTION_, not SONG_, because the game doesn't know what a SONG is. :lol:
 
The way I did it, you have to use PROMOTION_, not SONG_, because the game doesn't know what a SONG is. :lol:
Of course. But I wondered if setting a promotion as SONG_ITS_RAINING_MEN instead of PROMOTION_ITS_RAINING_MEN in the CIV4PromotionInfos.xml file would work or not. I didn't look at the source code for promotions but if there is no check that a promotion starts with PROMOTION_, then it is but a convention and can be changed if wanted. For example, iirc, there is some promotions that begins with EQUIPMENT_ rather than PROMOTION_. Had it required DLL changes? If not, then it's very interesting to have the possibility to create promotions that don't begin with PROMOTION_, if just for the "category" sake.
 
Ok, caught up with the rest of the posts since my last blunder. You can name a promotion (or anything in the game) absolutely whatever you want to. PROMOTION_ is used just so we humans can quickly decide what is what out there. If you really wanted to, you could call a promotion UNIT_MARGALARDS_LITTLE_BROTHER. It would work just fine, but people reading your python would wonder why you are checking pUnit.isHasPromotion(gc.getInfoTypeFor('UNIT_...')


Anyway, end of story is: Name it what you like. You could even name it <Type>x</Type>
 
i have what hopefully is a simple question.

In my modmod (seems like everyone has a modmod nowadays) im trying to add a new civ.
so far it works well, but i have a little problem with the unit buttons.
to be precise my unique buttons for the standard units (scout, warriors, workers, ect) display everywhere correctly, except in the build choices (in the city and popup) where there look like the normal ones.

I know im probably missing something simple, but i seriously can't find it.
 
Actually, at least the Balseraph do it and it works for them. Their scout and warrior have unique buttons. Thats what had me so confused, because i looked at their entries in the art defines and couldn't find anything different to what i did.

Anyway, i found a way. Since i have a new racial promotion i changed the artstyle on that one. That seems to work. They now display everwhere correctly.

Although its weird because the balseraph don't have a racial promotion and it works for them anyway.
 
Craps, maybe I did import it proper then and it just isn't working in some places. I know a few people commented on it a while ago, but I hadn't had the time to look into things yet. Good to know about the Balseraphs, may help me sort it all out.
 
In attempting to set up the SDK, I'm encountering difficulties. I noticed these three posts that seem to have something to do with my problem:
Nope. Honestly, I have no idea what I'm doing lol. Says I need to open CvGameCoreDLL.vcproj, but that file only exists in the BTS directory... All I could think to do was copy it to the FFPlus dll directory and load it, says it can't find windows.h and halts the compile.

Oh yeah, right now we don't distribute EVERYTHING you need to compile. Next full release we will though. You need to have a directory which can already handle compiling code (FfH download or the BtS one) and then dump our code over the top of it. Oops, and you'll have to manually include the CyMapInterface1.cpp and CyMapInterface2.cpp files in your project, and remove CyMapInterface.cpp


So yeah... next full release (sometime after 041 of FfH so we get the nice repack on that side as well) it should be easier to handle our code.

Ugh. Still get fatal error C1083: Cannot open include file: 'window.h': No such file or directory

So I did all of that, I tried compiling the FF code by itself, and then i tried copying the BTS code and pasting the FF files over then, but still no luck. The error I get is
"fatal error C1034: windows.h: no include path set"
no matter what I do. I've verified that the file exists and that Code::Blocks is being correctly told where it is. I've even tried moving windows.h into the same folder as the rest of the DLL files. What do I need to do to make it work?

EDIT: just thought of one more thing to test - compiling the normal BTS DLL. While it didn't work, the error I got was a completely different one and happened at the end of the compiling process, so whatever problem I'm having right now has to do with the FF code.
 
Back
Top Bottom