Announcement

Collapse
No announcement yet.

Offer City Bug

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

  • Offer City Bug

    This weekend a brazilian player came to me asking a solution for a bug in the city offer. I tried to solve his problem but i did no find a good solution.
    He told me that when you have too many cities in your empire the most recently created cities dont appear in the list of cities to give.
    I went deep into this problem and i found out that really there is such bug and it is caused by the screen size. When you have 48 cities or more the list is so long that goes from the top to the bottom of the screen. Hiding the ones with index bigger than this number.
    I think there may something in the UI to change this, create a scroll bar aside the list or invert the list to only hide the most antique ones and sho the more recent.
    But my efforts didnt help nothing so i wanna know if anyone has a clue to fix this?

    Here is a screenshot to ilustrate the bug:
    Attached Files
    "Kill a man and you are a murder.
    Kill thousands and you are a conquer.
    Kill all and you are a God!"
    -Jean Rostand

  • #2
    wow thats some map.....

    i never had trouble like that though

    Comment


    • #3
      It's been tried before, without succes...

      Do what I did, buy a screen which supports a higher screen resolution
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #4
        actuall CTP2 only plays as 800 x 600 res.

        But i am pretty sure there is a way using slic. I have PMed Peter Triggs to this mean since he is the best with diplomacy.

        Yet you may figure this out:
        Peter in his diplomod made messages pop up when selecting a treaty (if you tried the NewDiplomod you will remember) saying if you want a short, a long or a unlimited agreement (remembered?)
        But i cant figure out in his amost 6000 lines code wich event is triggered when the diplomatic option is selected to make the message pop up.
        Do you or anyone know wich event does that?
        "Kill a man and you are a murder.
        Kill thousands and you are a conquer.
        Kill all and you are a God!"
        -Jean Rostand

        Comment


        • #5
          No it doesn't, I have it running on 1200x1600...
          (if it really doesn't let you change it in the Screen Size menu, try changing userprofile.txt, or else the windows registry, if it's not in there - that's how I got Civ3 to run at 1200x1600...)

          And if you can pop a message to pop up, then what? Scroll through 200 messages to find the right city? You can only fit 2 or 3 cityname buttons on a single message (on average, with clever coding)... I suppose it's possible but...
          Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

          Comment


          • #6
            Originally posted by Locutus
            No it doesn't, I have it running on 1200x1600...
            (if it really doesn't let you change it in the Screen Size menu, try changing userprofile.txt, or else the windows registry, if it's not in there - that's how I got Civ3 to run at 1200x1600...)
            Err... Civ3?

            It is in the userprofile, too. But first I would use the in game resolution settings (that must be somewhere in the option box) and try a higher resolution, oh and of course disable try windows resolution.

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

            Comment


            • #7
              Civ3 has a similar file (IIRC it even has the same name )...
              Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

              Comment


              • #8
                Pedrunn,

                These are the triggers you were looking for:

                Code:
                // these two set a treaty length when the human offers a treaty:
                
                trigger 'NewTreatyDataInitialProp' on "DipWizard.Stage1.Tabs.Treaty.TabPanel" when (1) {//initial proposal
                    message(g.player,'TreatyLength');
                }
                
                trigger 'NewTreatyDataFollowingProp' on "DipWizard.Stage2.Tabs.Treaty.TabPanel" when (1) {//secondary proposal
                    message(g.player,'TreatyLength');
                }
                
                alertbox 'TreatyLength' {
                
                    Text (ID_TreatyTypeM);
                
                    Button(ID_unlimited){
                         NDM_TREATY_LENGTH=999;
                	    kill();	   
                    }
                    Button(ID_medium){
                         NDM_TREATY_LENGTH=60;
                	    kill();   
                    }
                    Button(ID_short){
                         NDM_TREATY_LENGTH=30;
                         kill();
                    }
                }
                They're (obviously) not normal event handlers but rather:

                [from Joe's SLIC1 documentation]

                There is also a special format for triggering by UI components:

                Trigger 'name' on "UI Component Name" when (expression) {
                commands
                }

                It behaves in the same way as the normal format, except that it is only evaluated when the UI component is used. The name follows the same rules as for message boxes.

                The body of the trigger is executed only when the expression is true (not equal to 0).
                IIRC, most (all?) of the examples in the shipped game have as a UI Component Name, a path leading to a button of one sort or another. I got lucky and found the TabPanel that had the treaties on it. But even if you could find the component that has the city names on it, like Locutus says I can't see what you could do with it. (I couldn't trigger on individual names, only on the list.)

                Comment


                • #9
                  go into the option dialog at the beginning of the game, one of the option boxes is labelled graphics - in there you can there's a button for game resolution, offers up to 2048x1536 - some screen that would be! I have it running at 1024x768...
                  You need to restart the game for the changes to take effect!

                  Something related I've been wondering about:
                  In the same option box there's a slider for speed set at the second notch from the left and it's got 10 notches! Anybody ever saw changes of that have any effect? -not me...

                  Comment


                  • #10
                    Originally posted by mapfi
                    in there you can there's a button for game resolution, offers up to 2048x1536 - some screen that would be! I have it running at 1024x768...
                    You need to restart the game for the changes to take effect!
                    Actually, what settings are available depends on what settings Windows supports. For me it's 1600x1200 (although I'm sure I could crank it up a few notches if I wanted to - but 1600x1200 is big enough for me ). I was assuming Pedrunn was aware of this screen and 80x600 was the highest setting available in this screen. If so, my suggestion of changing userprofile.txt might work since even if Windows doesn't support a resolution, it doesn't mean the monitor doesn't either. Whether or not you need to restart your PC also depends on your Windows settings - for me this is only the case for the higher resolutions.

                    In the same option box there's a slider for speed set at the second notch from the left and it's got 10 notches! Anybody ever saw changes of that have any effect? -not me...
                    You mean unit speed? Yes, try setting it at the highest setting...
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #11
                      unit speed?? is that it? What an idea to just label that speed (at least in the german version) with no clue to which side is actually faster (it's to the right)
                      ok, it's got an effect - I see it -

                      (maybe it didn't have one on my old pII200?)

                      Doesn't windows support those resolutions that your graphic card does - so after trying to change it in userprofile to a higher setting than that the game will not display because of the card?

                      Comment


                      • #12
                        I made it.
                        I made a variation of the offer city concept in order to fix this bug.
                        This may not be too good but still is what my brazilian friend is requiring.
                        To give a city the list dont appear anymore. So you must select the city you want to give before open the diplomatic screen.
                        Here is the code
                        Code:
                        city_t OfferedCity;
                        int_t CityIsSelected;
                        int_t NewGiveCityOptionEnabled;
                        
                        HandleEvent(CitySelected) 'FixForGiveCityBug' post {
                        	if(CityIsValid(city[0])) { 
                        		player[0] = g.player;
                        		CityIsSelected = 1;
                        		OfferedCity = city[0];
                        		message(player[0], 'SelectedCityToOffer');
                        
                        	}
                        }
                        
                        HandleEvent(CityDeselected) 'FixForGiveCityBug' post {
                        	if(CityIsValid(city[0])) { 
                        		player[0] = g.player;
                        		CityIsSelected = 0;
                        		message(player[0], 'DeselectedCityToOffer');
                        	}
                        }
                        
                        trigger 'NewGiveCityOption' on "DipWizard.Stage1.Tabs.Offer.TabPanel" when (1) {//initial proposal
                        	if(CityIsSelected == 1) {
                        		message(g.player,'PedrunnsWayToGiveCitymsg');
                        	}
                        	else{
                        		message(g.player,'YouMustSelectACity');
                        	}
                        }
                        
                        alertbox 'PedrunnsWayToGiveCitymsg' {
                        	text(ID_PEDRUNN_GIVES_CITY);	// "The city of {OfferedCity.name} is selected. Do you want to Give this City"
                        	show();
                        	NewGiveCityOptionEnabled = 0;
                        	Button(ID_YES) {
                        		NewGiveCityOptionEnabled = 1;
                        		Kill();
                        	}
                        	Button(ID_NO) {
                        		Kill();
                        	}
                        }
                        
                        messagebox 'YouMustSelectACity' {
                        	text(ID_PEDRUNN_YOU_MUST_SELECT_CITY); // "You dont have a city selected. In order to make this offer you have to select one"
                        	show();
                        }
                        
                        HandleEvent(NewNegotiationEvent) 'PedrunnsWayToGiveCity' pre {
                        int_t ProposalType; 
                        int_t ResponseType; 
                        
                        	ProposalType = GetLastNewProposalType(player[0], player[1], 0);
                        	ResponseType = GetLastResponseType(player[1], player[0],0);
                        	if(NewGiveCityOptionEnabled == 1				// If new give city option enabled	
                        	&& ResponseType == 2						// And if proposal has been accepted
                        	&& ProposalType == 1) {						// And Proposal is give city proposal 
                        		Event: GiveCity(OfferedCity, player[1]);		// Give selected city
                        	}
                        }
                        In order to make the list disappear and the proposal effect do not be depend on what is hard-coded you must replace the data of the offer city by this one:
                        Code:
                        PROPOSAL_OFFER_GIVE_CITY {
                            Type "OFFER_GIVE_CITY"
                            Title DIP_OFFER_GIVE_CITY
                            Category:Gift
                            Class:Offer
                            Excludes:Offer
                           Reciprocal PROPOSAL_REQUEST_GIVE_CITY
                        #   Arg1:OwnCity
                            Details0 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_0 }
                            Details1 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_1 }
                            Details2 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_2 }
                            Details3 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_3 }
                            Details4 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_4 }
                            DetailsEx0 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_EX_0 }
                            DetailsEx1 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_EX_1 }
                            DetailsEx2 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_EX_2 }
                            DetailsEx3 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_EX_3 }
                            DetailsEx4 { DetailsEven DIP_DETAILS_OFFER_GIVE_CITY_EX_4 }
                            Image "updi01.tga"
                        }
                        BUG: It still there is an annoying thing: every time you choose any diplomatic offer a message will pop up asking about wich city you want to give when it should only do that when the offer city option is selected not the others. So i ask does anyone, specially you Peter, has an idea on how to fix this problem.
                        "Kill a man and you are a murder.
                        Kill thousands and you are a conquer.
                        Kill all and you are a God!"
                        -Jean Rostand

                        Comment


                        • #13
                          Why you don't make a new proposial: PROPOSAL_OFFER_GIVE_SELECTED_CITY

                          Replace the details and use your code for it.

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

                          Comment


                          • #14


                            Whi didnt i think of the at before?

                            But has anyone ever tried to make a whole new peoposal before.

                            Not much to change here. I will try that martin.
                            "Kill a man and you are a murder.
                            Kill thousands and you are a conquer.
                            Kill all and you are a God!"
                            -Jean Rostand

                            Comment


                            • #15
                              Great to see people working on this. I've destroyed tons of cities because I didn't want to defend them, but knew I would be unable to give them away later. I've always thought it would be helpful to be able to give away a city the moment you take it as part of the "extend empire", "move citizens", etc. pop up screen option upon capture. I guess the problem would be without a one turn delay built in, you would give away the army that took the city along with it. But in any case, it will be good to see this worked out.
                              "Guess what? I got a fever! And the only prescription is ... more cow bell!"

                              Comment

                              Working...
                              X