Modder's Guide to A New Dawn

Discussion in 'Rise of Mankind: A New Dawn' started by Afforess, Dec 2, 2009.

  1. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Ai city governer is just few lines in CvCityAi. The automations are a bit of XML and CvEnums, CvUnit, and CvUnitAi
     
  2. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,481
    double post.
     
  3. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,481
    Argh. Cannot compile, what does this mean?

    PHP:
    1>CvCityAI.obj error LNK2019unresolved external symbol "public: int __thiscall CvGlobals::getUSE_AI_CHOOSE_PRODUCTION_CALLBACK(void)" (?getUSE_AI_CHOOSE_PRODUCTION_CALLBACK@CvGlobals@@QAEHXZreferenced in function "public: virtual void __thiscall CvCityAI::AI_chooseProduction(void)" (?AI_chooseProduction@CvCityAI@@UAEXXZ)

    edit: or is this callback not needed for the governor?

    edit: I guess not, seems to have something to do with mountains.
     
  4. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,481
    I don't get it. I don't get the buttons (avoid angry/unhealthy) and player options displayed ingame.

    I have compiled a dll, have updated CIV4PlayerOptionInfos.xml, CIV4GameInfoSchema.xml, CIV4EmphasizeInfo.xml, copied the text files and A_New_Dawn_GlobalDefines.xml.

    I did not find any MODDERS_PLAYEROPTION_ in your xml files except in your globaldefines.

    There are no new buttons in the city screen or in the player options window. What's missing?


    edit: now trying to recompile with an xml copy part of your sources.

    edit2:

    PHP:
    1>CvInfos.cpp(18661) : error C2039'copyNonDefaults' is not a member of 'CvEmphasizeInfo'
    1>        e:\--- BASE GAMECORE ---\BASE 1.7\CvGameCoreDLL\CvInfos.h(5169) : see declaration of 'CvEmphasizeInfo'
    1>CvInfos.cpp(18668) : error C3861'isAvoidAngryCitizens'identifier not foundeven with argument-dependent lookup
    1
    >CvInfos.cpp(18668) : error C2065'm_bAvoidAngryCitizens' undeclared identifier
    1
    >CvInfos.cpp(18669) : error C3861'isAvoidUnhealthyCitizens'identifier not foundeven with argument-dependent lookup
    1
    >CvInfos.cpp(18669) : error C2065'm_bAvoidUnhealthyCitizens' undeclared identifier
    grrrrrr!


    edit3: xmlcopy cannot be the reason for the buttons not being displayed...or?

    edit4: python maybe.....

    edit5: emphasize found in CvMainInterface.py, I think I'm done with avoid buttons, but no player options yet:




    edit6: LOL! just found:

    PHP:
        <Define>
            <
    DefineName>USE_MODDERS_PLAYEROPTION_1</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
        <
    Define>
            <
    DefineName>USE_MODDERS_PLAYEROPTION_2</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
        <
    Define>
            <
    DefineName>USE_MODDERS_PLAYEROPTION_3</DefineName>
            <
    iDefineIntVal>0</iDefineIntVal>
        </
    Define>
    in the normal globaldefines as well. deleted. lets try. :)

    edit7: WT(NT ?)TN?QTQNMW`=Q%NT`?=QN%NQ still no new player options displayed.


    edit8: do I need

    PHP:
        <ElementType name="PlayerOptionInfo" content="eltOnly">
            <
    element type="Type"/>
    <!-- 
    XMLCOPY                02/20/2008            MRGENIE        -->
            <
    element type="bTypeDependency" minOccurs="0"/>
            <
    element type="AndDependencyTypes" minOccurs="0"/>
            <
    element type="OrDependencyTypes" minOccurs="0"/>
    <!-- 
    XMLCOPY                END                    MRGENIE        -->
    and all the XMLCOPY sources?



    edit9: nevermind. nevermind. I've deleted A_New_Dawn_GlobalDefines.xml and updated iDefineIntVal in the original globaldefines to 1. now they show up. did not know its important where these entries are.
     
  5. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Cybah, did you ever get your DLL to compile? If not, can you post the full error message?

    As for the global defines, the reason the A_New_Dawn_GlobalDefines did not work was because you have to tell the game to load the file in CvXMLLoadUtilitySet.cpp.

    The emphasize happy and health do not appear unless you merge the CvMainInterface.py code in. Here's the code:

    Code:
    				i+=1
    				szButtonID = "Emphasize" + str(i)
    				screen.addCheckBoxGFC( szButtonID, "", "", iBtnX+iBtnW+iBtnWa, iBtnY, iBtnW, iBtnHa, WidgetTypes.WIDGET_EMPHASIZE, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
    				szStyle = "Button_CityB" + str(i+1) + "_Style"
    				screen.setStyle( szButtonID, szStyle )
    				screen.hide( szButtonID )
    				
    				#Afforess Emphasize Health & Happiness
    				i+=1
    				szButtonID = "Emphasize" + str(i)
    				screen.addCheckBoxGFC( szButtonID, "", "", xResolution - 260 - iBtnWa, iCityCenterRow2Y, iBtnWa, iBtnHa, WidgetTypes.WIDGET_EMPHASIZE, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
    				szStyle = "Button_CityB" + str(i) + "_Style"
    				screen.setStyle( szButtonID, szStyle )
    				screen.hide( szButtonID )
    
    				i+=1
    				szButtonID = "Emphasize" + str(i)
    				screen.addCheckBoxGFC( szButtonID, "", "", xResolution - 260 - iBtnWa, iCityCenterRow1Y, iBtnWa, iBtnHa, WidgetTypes.WIDGET_EMPHASIZE, i, -1, ButtonStyles.BUTTON_STYLE_LABEL )
    				szStyle = "Button_CityB" + str(i-1) + "_Style"
    				screen.setStyle( szButtonID, szStyle )
    				screen.hide( szButtonID )
    					
    				iNumCustomEmphasizeInfos = 2
    				#Afforess ENd
    				
    				g_pSelectedUnit = 0
    				screen.setState( "AutomateCitizens", pHeadSelectedCity.isCitizensAutomated() )
    				screen.setState( "AutomateProduction", pHeadSelectedCity.isProductionAutomated() )
    				
    				for i in range (g_NumEmphasizeInfos):
    				#Afforess Hide Extra Emphasis Icons
    					if ( CyInterface().isCityScreenUp() or ( i < g_NumEmphasizeInfos - iNumCustomEmphasizeInfos) ):
    				#	if (true):
    				#Afforess End
    						szButtonID = "Emphasize" + str(i)
    
    Also, keep in mind you need to merge the new Emphasis XML, located in the Modules/Afforess/Required folder.

    Anything else you need help with?
     
  6. Cybah

    Cybah Emperor

    Joined:
    Jun 22, 2007
    Messages:
    1,481
    DLL working now, every option/button shows up. :) Game Options are working, just wonder why my city still grows over happy cap with avoid unhappy enabled.

    Did not know that. Thank you. :) Will keep this in mind.
     
  7. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,419
    Gender:
    Male
    Location:
    Western IL. cornfields
    Looking for some help/explanation;


    Code:
    <YieldChanges>
    						<iYieldChange>2</iYieldChange>
    						<iYieldChange>0</iYieldChange>
    						<iYieldChange>0</iYieldChange>
    					</YieldChanges>
    
    In this example of iYieldChange is it Food that is increased by 2?

    And since there are 3 iYieldChanges what is their order? Food, Hammer, Gold?

    JosEPh
     
  8. Supercheese

    Supercheese Zeppelin Commander

    Joined:
    Aug 2, 2009
    Messages:
    378
    Location:
    Idaho
    Yes, and yes. Like the order they appear on plots, Food then Hammers then Commerce.
     
  9. JosEPh_II

    JosEPh_II TBS WarLord

    Joined:
    Jun 20, 2007
    Messages:
    16,419
    Gender:
    Male
    Location:
    Western IL. cornfields
    Thanks Sc.

    JosEPh :)
     
  10. Ulysses

    Ulysses Chieftain

    Joined:
    May 21, 2003
    Messages:
    33
    Location:
    Germany
    Hi!

    With which program are you editing your xml-files? If I open them in notepad the ordinary wordwrap is gone.

    :)
     
  11. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Notepad++.
     
  12. Ulysses

    Ulysses Chieftain

    Joined:
    May 21, 2003
    Messages:
    33
    Location:
    Germany
  13. zeppelin17

    zeppelin17 Chieftain

    Joined:
    Mar 29, 2008
    Messages:
    35
    Location:
    Maryland, USA
    quick question: how do you change the cost of a settler?... in the unitinfo.xml it says the cost is 0 and I couldn't find another unitinfo.xml that might override that. I'm kind of sick of it taking me 150+ turns just to found my second city without it completely crippling my capital. Plus, I almost never get settlers from goody huts anymore -.- (not to mention I always feel like I'm cheating when I do get one...)
     
  14. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,555
    Gender:
    Male
    Location:
    Canberra, Australia
    is there any documentation on the AndDependencyTypes tags? In particular I am looking for one which will skip a building (not include it in game) if another building is in the game. Or to be precise I am trying to have one version of SubdueAnimals which will work whether you have the Equestrian Guild in play or not.

    Since I have been working with StrategyOnly on his Prehistoric mod the SubdueAnimals mod will be converted to AND 1.75.:eek:
     
  15. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    And Dependancies won't do what you want. How about using the NotGameOption tag for that building (or unit), and use GAMEOPTION_GUILDS.
     
  16. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,555
    Gender:
    Male
    Location:
    Canberra, Australia
    Thanks. AndDependancies do seem to be working for some other stuff I am doing ie changing the prereqtech if I have the prehistoric era or wolves upgrading to wardogs if wardogs exist.

    Now I just need to figure out where the NotGameOption tag appears in the schema. Btw I did look at your doco for this tag but did not see it. Perhaps I needed more coffee ;)
     
  17. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    I didn't document it, cause RevDCM added it, not me. ;)
     
  18. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,555
    Gender:
    Male
    Location:
    Canberra, Australia
    Ah ha! I suppose that it is getting XML errors in RoM 2.92 because it is not using the version of RevDCM that AND is using.

    Btw, would putting the latest AND dll in RoM 2.92 work? Or will it show that "sensible" defaults for new stuff was not put in as the new features were added.:mischief:
     
  19. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    That might give you some errors with the new memories, gameoptions, and other hardcoded things us modders have no control over. I don't recommend it.
     
  20. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,555
    Gender:
    Male
    Location:
    Canberra, Australia
    Not a problem. Now if I could just get BugUtil.getText to work the way I want it to I would have language support and be finished with SubdueAnimals! Off to the BUG forum after gathering all the bits I need to explain my problem.;)
     

Share This Page