Mod-Modders Guide to Fall Further

I did what you said Sephi and it didn't worked. Well, it did, as I didn't have the math non-defined error anymore but the function didn't worked... Turns out I needed to specify iLevel as a float instead, because when dividing the integer it was by 4, it only resulted in 0 or 1. Now it works great. Thanks :goodjob:
 
May have worked with just rounding if you had been a float instead of an int as well, I'd test that out and not import Math if you don't need to. That is, IF you want true rounding and not to just always use Ceiling function to round up. You can also trick rounding into working like Ceiling since you know what you are dividing by:

(iLevel+3)/4

Should give the same results as

math.ceil(fLevel/4)

Note that I don't have to specify that it should round the value off in the first case because it is still an integer, and will give an integer result automatically.

Python trick IIRC:

(iLevel)//4

This will still use "Integer math" where the answer WILL BE an integer, but instead of truncating the remainder, it moves to the nearest decimal in the direction of positive infinity (so for positive numbers it gives you the ceil() result)
 
I'll test then.

Anything about too much comment in python files?
Opera said:
If I had too much comments in python (for documentation sake), would the processing speed be altered?
 
Oh, this // operator seems very interesting!
Tested, didn't seem to work. I still get 0 for 0.25, 0.5 and 0.75.
Code:
iValue = caster.getLevel() // 4
Anyway, I'm glad to hear that I can comment at will :goodjob:

But the +3 trick works :)
 
By the way, is there a way to get the tier of a unit in python? I tried getTier() but it doesn't seem to work. The error log says that it doesn't exist.
Code:
def spellFieryWangole(caster):
	pPlot = caster.plot()
	iChance = CyGame().getSorenRandNum(100, "Tier 1 are weak!")
	for i in range(pPlot.getNumUnits()):
		pUnit = pPlot.getUnit(i)
		if pUnit.getTier() == 1:
			if iChance < 10:
				pUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ENRAGED'), true)
 
Is it possible to add new corporations entirely through a module? Is there anywhere it would be necessary to reference something in the same file? (the worst limit of modular loading)
 
Need to resurrect an old issue

A seperate question. This picture mostly shows the issue

Spoiler :
pinkboxes.png



I'm adding new art for promotions I'm making. They display correctly in one view, but not the other. The images are correctly referenced.

Please don't tell me this is another limitation with modular loading. I swear I'll strangle something :mad:

Xienwolf answered with:

EDIT: Forgot to respond to Warkirby: Remove the spaces from the DDS names.


But the dds names have no spaces. I use _ as a divider. "heart_of_frost.dds" "icy_breath.dds" etc.

Any idea what else could be the cause?
 
I have not posted here for quite some time, but as I began to do some serious importing from FF again, I got some serious problems as well ;)

This time, I tried to get Multibarbs to Orbis, together with some improvements tags. I have imported all multibarb marked fields, and I think that I got all additions/changes containing Animal_TEAM/CIVILIZATION/PLAYER/LEADER, same for demons.
But after compiling and proper (hopefully) additions and changes to XML, I get only orcs in the game, the other two do not spawn.
Where is the spawning handled? Any idea what I might have done wrong?

And Xienwolf, thanks again for the tip on pythonpostcombat tags!
 
Did you get the global defines to link the proper Civilization and Leader for the barbarians? And the actual spawning is all at the bottom of CvGame (well, mostly at the bottom, it is also up in ::doTurn or whatnot to call those functions, and in another spot to block the native version of the Orc code). Also, for those to work there is some extensive programming out in CvMap.cpp & CvDefines.h as well (search for RANDPLOT_ORC_ALLY). Overall, it is one of the most annoying aspects of my code to try and import I imagine, as it took months to write and re-write the entire system before I was finally convinced it worked properly (especially since we had another bug at the time causing massive CtD issues and I kept assuming the Barbarians were causing it...)



Next release is probably more than a week away. I still have to finish the WoC merge (I have to essentially re-write every field I have added AND all of the ones Kael has added...), and after that I have to implement the "next big thing" addition for the new version.



For the DDS files.... post the exact DDS buttons here so I can verify they aren't MIPmapped, or try them without the underscore characters either.
 
For the DDS files.... post the exact DDS buttons here so I can verify they aren't MIPmapped, or try them without the underscore characters either.

I just released Monstrous Creatures, so all my images are in the download here: http://forums.civfanatics.com/showthread.php?t=318917

The problem occurs with monstrous_creature.dds, heart_of_frost.dds, molten_core.dds and acid_tongue.dds

those are all the ones I'm using for promotions.
 
How do you give the player gold through python? I have a function all set up but the net result is I want the player to get i gold, how do I say that in Python Speak?
 
How do you give the player gold through python? I have a function all set up but the net result is I want the player to get i gold, how do I say that in Python Speak?
Use pPlayer.changeGold(int), pPlayer being the player you want to modify the treasury.
 
Did you get the global defines to link the proper Civilization and Leader for the barbarians? And the actual spawning is all at the bottom of CvGame (well, mostly at the bottom, it is also up in ::doTurn or whatnot to call those functions, and in another spot to block the native version of the Orc code). Also, for those to work there is some extensive programming out in CvMap.cpp & CvDefines.h as well (search for RANDPLOT_ORC_ALLY).
Thanks, I checked them all and while I already had them in, I found some extra code I had to add. But anyway, seems that animals and demons actually work, just are not present in the worldbuilder menu. Any tips what should I do to enable them?

I still have some trouble with monster spawning from improvement (no spawning or random ones), need to check the code...

Also, is there any reason for GAMEOPTION_NO_ANIMALS and GAMEOPTION_NO_DEMONS to be listed twice in CyEnumsInterface.cpp?
 
Worldbuilder is controlled by python, lots of annoying junk to clean up in the python files for the extra barbarians unfortunately, many parts weren't written to be flexible in that regard. Till you get around to that, use CTRL + SHIFT and click on a tile to place units for the other Civs to test anything you might need.

Not sure why we'd have the gameoptions double listed, but shouldn't matter much in that file fortunately.
 
Back
Top Bottom