Announcement

Collapse
No announcement yet.

Alertbox question

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

  • 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?

  • #2
    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.
    Last edited by Pedrunn; October 5, 2002, 14:05.
    "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


    • #3
      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!"

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment


          • #6
            Actually it doesn't... as I later figured out.

            New question:
            Can I tell the game what size the messagebox should have?

            Comment


            • #7
              Originally posted by mapfi
              Actually it doesn't... as I later figured out.

              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

              Comment


              • #8
                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

                Comment


                • #9
                  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!"

                  Comment


                  • #10
                    Re: Alertbox question

                    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?

                    Comment


                    • #11
                      I didn't need it after all - I think... kind of forgto...
                      Never used UseDirector() before - so can't help you there. Sorry

                      Comment


                      • #12
                        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).
                        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                        Comment

                        Working...
                        X