Announcement

Collapse
No announcement yet.

PROJECT: Adding New Rules Options

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PROJECT: Adding New Rules Options

    I've figured out how to maipulate the starting rules screen AND the graphics and gameplay windows that you pull down in game.

    COMPLETED
    CaptureCityOptions (rules and gameplay options)
    OneCityChallenge (rules)
    Nation Flags (graphics)
    Smooth Borders toggle (graphics)
    Show army Names (graphics)

    IN WORK
    NoAIProductionDeficit
    NoAIGoldDeficit
    AICityDefenderBonus
    BarbarianCities
    SectarianHappiness
    RevoltCasualties
    RevoltInsurgents
    BarbarianCamps
    BarbarianSpawnsBarbarian
    AINoSinking
    AINoCityLimit
    GoldPerUnitSupport
    GoldPerCity
    AINoShieldHunger
    AINoGoldHunger
    AIFreeUpgrade
    AIMilitiaUnit
    DebugAI (note: this should go in the scenario editor but I think scenario editor doesn't have a saveProfile() method)
    Last edited by Ekmek; March 22, 2007, 14:52.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    I've been trying to access the bool's located in the userprofile.txt. Basically what I want to do take my difficulty options and make them options that you can select when you start a new game (I also want to add one city challenge and the debugAI stuff too)

    Anyways I figured the best way to test is with the CityCaptureoptions since fromafar put in the profile anyways. I modified the ldl and it toggles but I've copied everything in the spnewgamerulesscreen and even added a bit to profileDB and to gamesettings. But it seems that the toggle won't set the profile.

    I'm getting the feeling that bloodlust and pollution options found in that window are not implemented am I right/ where am I going wrong on this?

    I'd rather not update the svn with this code, i don't think it wil impact much, but does anyone now what i'm missing?


    Originally posted by Fromafar
    Did you make the variable visible - i.e. remove the 5th parameter of Var - in the ProfileDB constructor?
    Ah, I didn't realize it was a visible thing. But what does it mean by visible? I see everything is pretty much set to false. does that mean its not accessible outside of editing the userprofile.txt? It looks like it doesn't impact whether or not the line appears in userprofile.txt.

    I'll mess around a bit.


    EDIT: I think the visible was part of it. The other part is that I see that graphicscreen.cpp has code like this:
    Code:
    ...somecode...
    static aui_Switch
    *s_politicalBorders	= NULL,
    
    ...somecode...
    static BOOL			s_politicalBordersToggled = FALSE;
    
    ...somecode...
    void graphicsscreen_checkPress(aui_Control *control, uint32 action, uint32 data, void *cookie )
    {
    	
    	if ( action != (uint32)AUI_SWITCH_ACTION_PRESS ) return;
    
    	uint32 checkbox = *((uint32*)cookie);
    	void (ProfileDB::*func)(BOOL) = 0;
    	uint32 state = data; 
    
    	switch(checkbox) {
    	case GS_POLITICALBORDERS:
    		func = &ProfileDB::SetShowPoliticalBorders; 
    		s_politicalBordersToggled = TRUE;
    		break;
    versus the spnewgamerulesscreen that does this
    Code:
    void spnewgamerulesscreen_switchPress(aui_Control *control, uint32 action, uint32 data, void *cookie )
    {
    	switch ( action ) {
    	case AUI_SWITCH_ACTION_ON:
    	case AUI_SWITCH_ACTION_OFF:
    		for ( sint32 i = 0;i < k_NUM_RULESBOXES;i++ ) {
    
    			if ( control == s_checkBox[i] ) {
    				switch ( i ) {
    				case RULE_GENOCIDE:
    					g_theProfileDB->SetAlienEndGame( !s_checkBox[i]->IsOn() );
    					break;
    				case RULE_POLLUTION:
    					g_theProfileDB->SetPollutionRule( s_checkBox[i]->IsOn() );
    					break;

    both appears to be swtich boxes and similar. the one thing i see iffernt is that the political border code actual calls a private bool s_politicalborder but thats after the set code (correspondingly foundin profileDB.h)

    so the part thats blowing my mind is where does the set part actually set it to true (or false) how does that get back to profiledb?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #3
      This many options should keep the game fresh and give a better AI.
      Next build should make for a tough game and intresting changes.
      Some are in Civ 3 mod but most are new.
      Looking forward to it.

      Comment


      • #4
        Perhaps a small option for scaling maximum cities to map size?

        Generally, the more options the better though.
        Call to Power 2: Apolyton Edition - download the latest version (12th June 2011)
        CtP2 AE Wiki & Modding Reference
        One way to compile the CtP2 Source Code.

        Comment


        • #5
          GOOD NEWS

          I got the rules screen working. I added city capture options to it (but also added it in gameplay options so you cantoggle midgame) and added onecitychallenge to it as well


          Maq, I *think* I can add a slider that will let you adjust how many cities as a bonus to the govt limit that way people don't have to modify text files


          And overall thats my goal to atleast put userprofile options accessible in game. I know most of us know the usual way but it looks more polished and user friendly to do it in game.
          Formerly known as "E" on Apolyton

          See me at Civfanatics.com

          Comment


          • #6
            Originally posted by E
            Maq, I *think* I can add a slider that will let you adjust how many cities as a bonus to the govt limit that way people don't have to modify text files
            And you think cheating is such a good idea?

            -Martin
            Civ2 military advisor: "No complaints, Sir!"

            Comment


            • #7
              no i don't think cheating is but some people modify the files any ways (like protra) and crank it to 1000. this will just be a difficulty modifier

              well maybe, i had difficulty with my onecitychallenge code. I basically wante dto prevt building settlers for humans but when I check SettleSize()> 0 it makes ALL units unavailable. weird.
              Formerly known as "E" on Apolyton

              See me at Civfanatics.com

              Comment


              • #8
                Originally posted by E
                no i don't think cheating is but some people modify the files any ways (like protra) and crank it to 1000. this will just be a difficulty modifier
                Actually that's their business, they can do whatever they want with their files. But we don't need to give it to everyone. Rules are there to be used if you don't like them you still can make a mod. And by the way using a difficulty option is the wrong way to fix the problem that the city size isn't map size dependent.

                Originally posted by E
                well maybe, i had difficulty with my onecitychallenge code. I basically wante dto prevt building settlers for humans but when I check SettleSize()> 0 it makes ALL units unavailable. weird.
                So why don't you use GetSettleLand and GetSettleWater as it is used everywere in the code?

                -Martin
                Civ2 military advisor: "No complaints, Sir!"

                Comment


                • #9
                  Originally posted by Martin Gühmann
                  So why don't you use GetSettleLand and GetSettleWater as it is used everywere in the code?

                  -Martin


                  I forgot about that. it appears to work now. thanks

                  Originally posted by Martin Gühmann
                  Actually that's their business, they can do whatever they want with their files. But we don't need to give it to everyone. Rules are there to be used if you don't like them you still can make a mod. And by the way using a difficulty option is the wrong way to fix the problem that the city size isn't map size dependent.
                  Then I'll leave it out for now. But there is plenty of space in the rules screen now (maybe I'll put in if there is high demand among our 5 playtesters )

                  One thing I'd like to add is the ability to set start and end ages so you don't start in ancient all the time etc. But thats in the future and I'd need to figure out how to do start stuff.
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #10
                    Originally posted by E
                    Then I'll leave it out for now. But there is plenty of space in the rules screen now (maybe I'll put in if there is high demand among our 5 playtesters )
                    And there is nothing else you could place there?

                    Originally posted by E
                    One thing I'd like to add is the ability to set start and end ages so you don't start in ancient all the time etc. But thats in the future and I'd need to figure out how to do start stuff.
                    The multiplayer code does this, so you should look there.

                    -Martin
                    Civ2 military advisor: "No complaints, Sir!"

                    Comment


                    • #11
                      I'm thinking about adding a new rule option called 'random resources' actually not sure if thats the best way to call it.

                      I've done some things with the random generator and realize that all civ games are pretty definite on what you produce and the value of food, shields, and gold you get but the real world isn't like that.

                      So I was thinking that as a rules option you (and the AI) would play where the values are randomized each turn so some turns you get high food sometime low, same for production, and gold.

                      I would do it by randomizing the total anounts collected per city.

                      it will be optional for sure, but any thoughts?
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment

                      Working...
                      X