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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. VCrakeV

    VCrakeV Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    309


    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... 😜
     
  2. VCrakeV

    VCrakeV Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    309
    Is there a xml file that contains information on trade routes?
     
  3. VCrakeV

    VCrakeV Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    309
    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).
     
  4. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    312
    Location:
    Not Turkey
    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?
     
  5. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    Code:
    		iPlayer = city.getOwner()
    		pPlayer = gc.getPlayer(iPlayer)
    		iTeam = pPlayer.getTeam()
    		pTeam = gc.getTeam(iTeam)
     
  6. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    if player is already given, why you still bother to find the player :D
     
  7. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,532
    Gender:
    Male
    Location:
    Denmark
    Global defines.xml

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

    VCrakeV Chieftain

    Joined:
    Aug 22, 2014
    Messages:
    309




    Thanks; I was completely lost with that second one. By the way, what does lirc mean?
     
  9. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,675
    Location:
    UK
  10. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,532
    Gender:
    Male
    Location:
    Denmark
    http://forums.civfanatics.com/showthread.php?t=186158
    This is outdated, but iirc (if I recall correctly, often used by me, as I'm getting old and memory doesn't serve me well ;-) ) there is a newer version somewhere.
     
  11. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    Because it's a PyPlayer, not a Cy one...

    Spoiler :
    ..and because I copied it from your file! :D
     
  12. ChaosSlayer

    ChaosSlayer Chieftain

    Joined:
    Feb 3, 2011
    Messages:
    587
    Question: let say Building A is a pre-req for Building B.
    What happens if A becomes obsolete and no longer can be build? Will B also become permanently unavailable?

    Thank You!
     
  13. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,532
    Gender:
    Male
    Location:
    Denmark
    yup, unless it is already built in the city (iirc)
     
  14. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,532
    Gender:
    Male
    Location:
    Denmark
  15. ChaosSlayer

    ChaosSlayer Chieftain

    Joined:
    Feb 3, 2011
    Messages:
    587
  16. Mudokon Pop

    Mudokon Pop Chieftain

    Joined:
    Oct 31, 2015
    Messages:
    44
    Location:
    Ireland
    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.
     
  17. SaibotLieh

    SaibotLieh Chieftain

    Joined:
    Sep 25, 2009
    Messages:
    1,446
    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?
     
  18. Mudokon Pop

    Mudokon Pop Chieftain

    Joined:
    Oct 31, 2015
    Messages:
    44
    Location:
    Ireland
    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!!
     
  19. SaibotLieh

    SaibotLieh Chieftain

    Joined:
    Sep 25, 2009
    Messages:
    1,446
    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".
     
  20. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    312
    Location:
    Not Turkey
    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:
     

Share This Page