Thread Tools
Old August 28, 2002, 07:01   #1
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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 Thumbnails:
Click image for larger version

Name:	citybug.jpg
Views:	80
Size:	157.2 KB
ID:	23114  
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old August 28, 2002, 12:21   #2
HuangShang
Call to Power II Democracy GameCTP2 Source Code Project
King
 
HuangShang's Avatar
 
Local Time: 00:00
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Berkeley
Posts: 1,375
wow thats some map.....

i never had trouble like that though
HuangShang is offline  
Old August 28, 2002, 13:55   #3
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
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
Locutus is offline  
Old August 28, 2002, 14:26   #4
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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
Pedrunn is offline  
Old August 28, 2002, 16:03   #5
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
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
Locutus is offline  
Old August 28, 2002, 16:51   #6
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
Quote:
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!"
Martin Gühmann is offline  
Old August 28, 2002, 17:19   #7
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Civ3 has a similar file (IIRC it even has the same name )...
__________________
Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery
Locutus is offline  
Old August 28, 2002, 17:54   #8
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 07:00
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
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:

Quote:
[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.)
Peter Triggs is offline  
Old August 29, 2002, 07:28   #9
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 08:00
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
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...
mapfi is offline  
Old August 29, 2002, 08:09   #10
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Quote:
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.

Quote:
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
Locutus is offline  
Old August 29, 2002, 08:31   #11
mapfi
Call to Power II Democracy GameCall to Power II Multiplayer
Prince
 
Local Time: 08:00
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
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?
mapfi is offline  
Old August 29, 2002, 09:27   #12
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
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

Last edited by Pedrunn; August 29, 2002 at 09:35.
Pedrunn is offline  
Old August 29, 2002, 12:21   #13
Martin Gühmann
staff
Call to Power II Democracy GameCall to Power Democracy GameCTP2 Source Code Project
Super Moderator
 
Martin Gühmann's Avatar
 
Local Time: 09:00
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
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!"
Martin Gühmann is offline  
Old August 29, 2002, 17:50   #14
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555


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
Pedrunn is offline  
Old August 29, 2002, 18:37   #15
TheArsenal
Apolyton University
Prince
 
TheArsenal's Avatar
 
Local Time: 00:00
Local Date: November 1, 2010
Join Date: Mar 2002
Location: Sunny Southern California
Posts: 900
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!"
TheArsenal is offline  
Old August 29, 2002, 19:00   #16
Dale
Emperor
 
Dale's Avatar
 
Local Time: 17:00
Local Date: November 1, 2010
Join Date: Dec 2000
Posts: 3,944
Pedrunn,

Yeah, I've created a proposal before. In one of the very first Diplomods there was a new proposal "Break Agreement". Yeah sure, 'some' of the coding was still there, but the rest I had to fill in. Unfortunately, there was a bug in it (can't remember the bug exactly) and I had to cancel it.

But if you forum search on "diplomod" you should come up with something. I think it was v1.6???
Dale is offline  
Old August 30, 2002, 16:44   #17
Peter Triggs
CTP2 Source Code ProjectCivilization IV Creators
King
 
Local Time: 07:00
Local Date: November 1, 2010
Join Date: Jan 2000
Location: Gone Fishin, Canada
Posts: 1,059
Pedrunn,

Quote:
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.
That's what I meant when I said that I couldn't manage to trigger on individual names, only on the list. I never could get any further than that.

Re: Adding New Proposals

The offer/request break agreement proposals are disabled:

Quote:
[MarkG] Ah! why was the break agreements diplomatic option disabled???

[RichardM] MarkG, time constraints mostly. Diplomacy had plenty of features and the rules for how the AI should respond to break agreement proposals [were] not clear cut.
and so are free to be used however we want. I used them for offer/request embassy proposals.

More generally, I don't know if it's possible to add a completely new New Proposal. Each new proposal contains a Type variable which is described as:

Quote:
String name of a valid proposal type. These names are primarily used for debugging as well as SLIC scripting though they must be registered in the game to work correctly.
Originally I thought these were just ordinary strings and was confused by the fact that I couldn't find a text file where they could be 'registered'. As I recall, something Martin said gave me an idea and I got a bit over-excited when I tried this:

Code:
HandleEvent(NewProposal) 'MY_NEW_PROPOSAL' post {

     message(1, 'Test_message');

}

// with

PROPOSAL_MY_NEW_PROPOSAL {
    Type "MY_NEW_PROPOSAL"
    Title DIP_NONE
    Details0 { DetailsEven DIP_DETAILS_NONE_0 }
    Details1 { DetailsEven DIP_DETAILS_NONE_1 }
    Details2 { DetailsEven DIP_DETAILS_NONE_2 }
    Details3 { DetailsEven DIP_DETAILS_NONE_3 }
    Details4 { DetailsEven DIP_DETAILS_NONE_4 }
    DetailsEx0 { DetailsEven DIP_DETAILS_NONE_EX_0 }
    DetailsEx1 { DetailsEven DIP_DETAILS_NONE_EX_1 }
    DetailsEx2 { DetailsEven DIP_DETAILS_NONE_EX_2 }
    DetailsEx3 { DetailsEven DIP_DETAILS_NONE_EX_3 }
    DetailsEx4 { DetailsEven DIP_DETAILS_NONE_EX_4 }
    Image "updi01.tga"

}
It didn't crash (which it always did with previous experiments) and so I thought 'Aha! Proposal types are just the names of SLIC objects. We can add as many new ones as we want."

Alas, no. I haven't been able to get any other Details except the null ones above. Maybe there's something simple that I'm missing: it looks like it's set up so that we should be able to add new proposals, but I haven't been able to do it.
Peter Triggs is offline  
Old August 30, 2002, 17:13   #18
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
I have tried to create a new proposal.
It appeared in the diplomatic screen but the slic just didnt recognize it.

You may try to find some bugs in my coding. So here is the coding
NOTE: if you unzip in the main CTP2 directory it will replace originals files.
Attached Files:
File Type: zip newgivecity2.zip (18.0 KB, 9 views)
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
Old September 2, 2002, 10:02   #19
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 08:00
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Can you use an existing "type" for new proposals? It wouldn't make sense, but if the types aren't really used, I can't see it mattering...

Pedrunn, you have cut out the lines:
Code:
Arg1:OwnCity
Reciprocal PROPOSAL_REQUEST_GIVE_CITY
The first one I don't know what it does, but it seems like it might be useful. The second I think is more important - it's the proposal that the AI recieves. You make a "give" offer, the ai gets a "receive" offer. I dunno. It might make a difference.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
Immortal Wombat is offline  
Old September 2, 2002, 13:17   #20
Pedrunn
Call to Power II Democracy Game
King
 
Pedrunn's Avatar
 
Local Time: 04:00
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
The proposal does not give nothing just the variation of regard. What gives the city is the Slic. So those lines arent needed. Thus i have tested the same code with using proposal #1 (changed the same way as the proposal in this file). And it did work. Yet I may test it again to make sure.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Pedrunn is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:00.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team