Quick Modding Questions Thread

No. ARMOR, for example, also ignores it, so it's not part of one unitclass (it's simply bIgnoreBuildingDefense). Besides, if you do ever want to add a new unitclass, you'd also have to carefully change all the instances where this unitclass is used; combat modifiers, promotions, events...



Yeah, I was halfway through all that tedious stuff. Then I ran into an error that my editor couldn't even pick up... So I had to replace the file with an old backup, and redo an hour of modding that actually had no errors.



Oh, the joys of modding... 😜
 
Another question has suddenly risen. Is there a way to make defences obsolete with techs? I was planning on making some new defence buildings to create a progression of them (walls obsolete, then you have to build a castle, which obsoletes and you need to build a fortress, etcetera).
 
I'm in def onUnitBuilt in CvEventManager, and it gives me the variables 'city', 'unit', and 'player' to work with. However the isHasTech() function needs to have a team in order to use it. How do I get the player's team?
 
Code:
		iPlayer = city.getOwner()
		pPlayer = gc.getPlayer(iPlayer)
		iTeam = pPlayer.getTeam()
		pTeam = gc.getTeam(iTeam)
 
if player is already given, why you still bother to find the player :D
 
Is there a xml file that contains information on trade routes?

Global defines.xml

Another question has suddenly risen. Is there a way to make defences obsolete with techs? I was planning on making some new defence buildings to create a progression of them (walls obsolete, then you have to build a castle, which obsoletes and you need to build a fortress, etcetera).

Iirc there is a mod component that allows building upgrades. Look in either SDK or combined modcomps in download database
 
Global defines.xml











Iirc there is a mod component that allows building upgrades. Look in either SDK or combined modcomps in download database





Thanks; I was completely lost with that second one. By the way, what does lirc mean?
 
if player is already given, why you still bother to find the player :D

Because it's a PyPlayer, not a Cy one...

Spoiler :
..and because I copied it from your file! :D
 
Anyone here familiar with Nifscope and Blender plugins?

I downloaded the Nif plugin for blender and I can import Nif files but when I export my custom meshes, Nifscope opens up an essentially blank file.

Clearly I'm upsetting something - but I have no idea what. Any ideas?

I have 3dsmax9 2014 version (student license) but could only find a Nif plugin for vers 7, not 9.
 
Anyone here familiar with Nifscope and Blender plugins?

I downloaded the Nif plugin for blender and I can import Nif files but when I export my custom meshes, Nifscope opens up an essentially blank file.

Clearly I'm upsetting something - but I have no idea what. Any ideas?

I have 3dsmax9 2014 version (student license) but could only find a Nif plugin for vers 7, not 9.
Which version of Blender and Nifscope are you using? Also, can you re-import the meshes in Blender again with no problems? Also, what kind of meshes we are talking about? Buildings, units, leaderheads or something else?
 
Which version of Blender and Nifscope are you using? Also, can you re-import the meshes in Blender again with no problems? Also, what kind of meshes we are talking about? Buildings, units, leaderheads or something else?

Thanks for your reply.:)

I'm using:

blender 2.49.2
Nifscope 2.0.0 pre-alpha 5
I have python 2.6.6 and although I downloaded the blender nif scripts 2.5.9 instead of the dead link to 2.5.8 which is no longer hosted anywhere.

I'm working on building meshes. I've done some more attempts since I posted, trying different things.

The problem of nothing appearing in Nifscope was solved (an no, they wouldn't re-import either) since apparently I have to selected the meshes before export (amateur error on my end) but new ones have emerged.

Imported meshes don't appear.:cry:

If I import a new mesh and merge it with the existing building (a palace in this case), then the new mesh does not appear in Nifscope despite merging with the palace. Other changes such as deleted existing faces from the default palace do work, but not importing and then joining my new meshes.

The new meshes were imported into Blender via obj import, if that's relevant. It must be since I added a UVsphere (to test) within blender and it shows up just fine.

Any help appreciated!!
 
Thanks for your reply.:)

I'm using:

blender 2.49.2
Nifscope 2.0.0 pre-alpha 5
I have python 2.6.6 and although I downloaded the blender nif scripts 2.5.9 instead of the dead link to 2.5.8 which is no longer hosted anywhere.

I'm working on building meshes. I've done some more attempts since I posted, trying different things.

The problem of nothing appearing in Nifscope was solved (an no, they wouldn't re-import either) since apparently I have to selected the meshes before export (amateur error on my end) but new ones have emerged.

Imported meshes don't appear.:cry:

If I import a new mesh and merge it with the existing building (a palace in this case), then the new mesh does not appear in Nifscope despite merging with the palace. Other changes such as deleted existing faces from the default palace do work, but not importing and then joining my new meshes.

The new meshes were imported into Blender via obj import, if that's relevant. It must be since I added a UVsphere (to test) within blender and it shows up just fine.

Any help appreciated!!
So you mean that you merged the meshes in Blender (not just imported the new mesh after loading the old one)? Then you might need to remove the material index of the newly added mesh. You can do so in "Link and Materials", to the right of the "Vertex Groups".
 
One more quick python thing. I'm trying to make a land mine that's invisible, and have it so that whenever a unit moves into the same space as the land mine, the land mine gets killed and the unit gets damaged.

I put this in onUnitMove in CvEventManager:
Code:
#Land mine
		for i in range(pPlot.getNumUnits()):
			pOtherUnit = pPlot.getUnit(i)
			if pOtherUnit.getUnitType() == gc.getInfoTypeForString('UNIT_LAND_MINE'):
				pOtherUnit.Kill(0,PyPlayer(pOtherUnit.getOwner()))
				iRnd = CyGame().getSorenRandNum(100,"Land Mine")
				pUnit.changeDamage(iRnd,pUnit.getOwner())
But it's not doing anything at all...when I move units into the land mine square they just sit there.
I'm thoroughly stumped...what should I do? :confused:
 
Top Bottom