 |
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:22
|
|
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.)
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:22
|
|
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...
|
|
|  |
 |
|  |
 |
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:22
|
|
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.
Last edited by Pedrunn on 29-08-2002 at 18:35
|
|
|  |
 |
|  |
 |
|
Peter Triggs
|
|
Gone Fishin, Canada
Jan 2000 time: 05:22
|
|
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.
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|