October 5, 2002, 12:30
|
#1
|
Prince
Local Time: 09:58
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Alertbox question
Does an alertbox stop the game at the moment it's triggered for sure? The thing I'm interested in is the following: Let's say I call a message in an EventHandler which is set to 'pre'. Does that prevent the event of happening until the alertbox is closed? And in that example, does a return STOP in the messagebox code stop the event?
|
|
|
|
October 5, 2002, 13:54
|
#2
|
King
Local Time: 05:58
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
I know where you are stuck at. I have been in a situation like yours before while doing the PBEM fix. But I really dont know the asnwer for it.
I just assumed that the asnwer was "no, it doesnt stop" without testing .
So i have managed a work around.
Still I would test it if i were you. But i believe the aswer really is no.
Here what i did to send proposal only after the consent of the player through alertbox:
Code:
|
int_t CanSendProposal;
HandleEvent(NewProposal) 'SaveProposalToPBEM' pre {
if(CanSendProposal == 0) {
message(player[0], 'PBEM_ProposalReady');
return STOP;
}
else{
CanSendProposal = 0;
}
}
alertbox 'PBEM_ProposalReady' {
Text(ID_WILL_YOU_SEND);
Button(ID_YES){
CanSendProposal = 1;
Event:NewProposal(player[0], player[1]);
kill();
}
Button(ID_NO){
kill();
}
} |
I hope the code is as clear as i think it is.
__________________
"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; October 5, 2002 at 14:05.
|
|
|
|
October 6, 2002, 07:04
|
#3
|
Super Moderator
Local Time: 10:58
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Unfortunatly the answer is no otherwise, the City Capture Option code what first ask you before the army enters the city, but before you can click anything the city is conquered. Maybe it could help to use the function: UseDirector() BUt from the discription I fear it is shown after the actual event.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
October 6, 2002, 09:52
|
#4
|
Prince
Local Time: 09:58
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Thanks you guys. Yes, Pedrunn that makes sense. You might have guessed the problem - the reformation in our religion code. If you decide not to, or don't have enough money, I don't want the reformation event to finish.
|
|
|
|
October 6, 2002, 13:51
|
#5
|
King
Local Time: 05:58
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Actually i was suspicious about that.
This thought was in my mind.
Yet, I cant figure out why the simulation of the effects of reformation like i did in the code needs change?
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
October 6, 2002, 16:08
|
#6
|
Prince
Local Time: 09:58
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Actually it doesn't... as I later figured out.
New question:
Can I tell the game what size the messagebox should have?
|
|
|
|
October 6, 2002, 18:26
|
#7
|
King
Local Time: 05:58
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Quote:
|
Originally posted by mapfi
Actually it doesn't... as I later figured out.
|
Quote:
|
Originally posted by mapfi
New question:
Can I tell the game what size the messagebox should have?
|
I dont think so
but messageboxes are bigger than alertbox though
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
October 7, 2002, 13:32
|
#8
|
Prince
Local Time: 09:58
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
I just seem to recall that somewhere I read that it's possible to change messagebox sizes - but I can't find anything now... Oh well
|
|
|
|
October 7, 2002, 13:39
|
#9
|
Super Moderator
Local Time: 10:58
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by mapfi
I just seem to recall that somewhere I read that it's possible to change messagebox sizes - but I can't find anything now... Oh well
|
It is not impossible to change the message box sizes. Message boxes are part of the UI so the must be defined in the *.ldl files, too. Also alert boxes must be defined there, but Iactual I wasn't able to find any sign of the AlertBox in the ctp2.exe, so maybe these boxes are defined in the *.ldl files only.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
October 14, 2002, 00:25
|
#10
|
Prince
Local Time: 08:58
Local Date: November 1, 2010
Join Date: Nov 2001
Posts: 437
|
Re: Alertbox question
Quote:
|
Originally posted by mapfi
Does an alertbox stop the game at the moment it's triggered for sure? The thing I'm interested in is the following: Let's say I call a message in an EventHandler which is set to 'pre'. Does that prevent the event of happening until the alertbox is closed? And in that example, does a return STOP in the messagebox code stop the event?
|
Mapfi, have you tried the suggestions here? Is it possible to stop the action with 'UseDirector();' or 'Return STOP;'?
UseDirector is just keyed to the animation isn't it? The Function Reference file indications that this command is useful to time the triggering of the messagebox (won't work with alertboxes according to the docs) with the animation. So, it sounds like 'return STOP;' would be the best option here.
Any dvelopments you can share?
|
|
|
|
October 14, 2002, 04:50
|
#11
|
Prince
Local Time: 09:58
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
I didn't need it after all - I think... kind of forgto...
Never used UseDirector() before - so can't help you there. Sorry
|
|
|
|
October 19, 2002, 10:05
|
#12
|
Deity
Local Time: 10:58
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
About messagebox size: 'Messagebox' messages have a fixed size, which IIRC is set in the ldl files. 'Alertbox' messages have a dynamic size: they are as large as they need to be, depending on the amount of text and buttons that they have (there *is* a limit on the max size though, which appears to be hardcoded).
|
|
|
|
Posting 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
|
|
|
All times are GMT -4. The time now is 04:58.
|
|