Announcement

Collapse
No announcement yet.

Triggering on UI componants

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

  • Triggering on UI componants

    There's a special trigger construct:

    #
    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).
    #


    For example:

    Code:
    trigger 'NewTreatyData' on "DipWizard.Stage1.Tabs.Treaty.TabButton" when (1) { 
        message(g.player,'TreatyLength');
    }
    will send a message to the game player when he clicks on the 'Treaty' tab in the process of forming a new proposal. (It will ask him to set a length for the treaty.) But this is a bit awkward, it would be better to trigger the message when the game player clicks on the name of the actual treaty (which is some kind of list element). Does anyone know how to do this, or if it's possible? (I suppose these list elements might not count as UI componants.)

  • #2
    You're asking if anyone else knows more about the ingame mechanics with relation to SLIC than you do? Good luck.

    I would suspect they do not count as UI components How do you find out this stuff anyway?
    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

    Comment


    • #3
      In this case (and actually in lots of others) from Winnie's tut2_*** files. She had to deal with so many events that you can find tons of simple working examples there. I just came across this the other day, there's probably still lots of stuff to be excavated from those files.

      Comment


      • #4
        Got it. (Slaps head!) You know about the 'programming CTP2 experience': "Just one more try and before you know it ...".


        It should have triggered when the game player clicked on "DipWizard.Stage1.Tabs.Treaty.TabPanel". This should open up a whole bunch of new possibilities, maybe like ditching some of lesser user proposals (e.g., request end embargo) in favour of something like "request strategic resource".

        Comment


        • #5
          Originally posted by Peter Triggs
          Got it. (Slaps head!) You know about the 'programming CTP2 experience': "Just one more try and before you know it ...".
          Amazing how inspiration strikes at 2am

          It should have triggered when the game player clicked on "DipWizard.Stage1.Tabs.Treaty.TabPanel". This should open up a whole bunch of new possibilities...
          Aha, I found the triggers in tut2_main.slc finally. I had searched the PC for *.slc files with DipWizard in them, evidently Winnie doesn't use that one...

          ...maybe like ditching some of lesser user proposals (e.g., request end embargo) in favour of something like "request strategic resource".
          Time to make some new goods sprites?
          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

          Comment


          • #6
            Soon I guess, but I've got to finish off this NewDiplomod first. It's becoming a bit gargantuan.

            And I may be away for a few days. I seem to have picked up some debilitating flu bug that makes it very difficult to stay awake.

            Comment


            • #7
              right just strike me down if I got the wrong end of the stick but what your taking about is altering the things in the diplomacy window like request city and that stuff.

              if so how about a slave free idea were you ask the AI or the AI ask you for some of its enslaved people back.
              "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
              The BIG MC making ctp2 a much unsafer place.
              Visit the big mc’s website

              Comment


              • #8
                Get well soon Peter We need your SLIC

                Originally posted by The Big Mc
                if so how about a slave free idea were you ask the AI or the AI ask you for some of its enslaved people back.
                LET MY PEOPLE GO!!



                Depends on what Peter has in mind I think perhaps he is intending for something else, but that would certainly be viable if you can find a way to SLIC it. (using abolitionist-type SLIC perhaps)
                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

                Comment


                • #9
                  well I did get the right end of the stick. I will see if I can do it my self and then post the slic here if peter wants it

                  ang get well soon
                  "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                  The BIG MC making ctp2 a much unsafer place.
                  Visit the big mc’s website

                  Comment


                  • #10
                    Originally posted by Peter Triggs
                    Soon I guess, but I've got to finish off this NewDiplomod first. It's becoming a bit gargantuan.
                    Would it lighten the load if I went over the good placement SLIC from before and sorted that all out? I can't handle the AI just yet, but I think I've got the rest of it complete, and working. I basically just need to figure out how to identify trade routed.
                    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

                    Comment


                    • #11
                      you two have been round a bit have you seen an of the layouts with the tile improvement layout on them.

                      I still have a few new good ideas about what to ask the AI like give me some public works and give me that fort of yours.
                      "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                      The BIG MC making ctp2 a much unsafer place.
                      Visit the big mc’s website

                      Comment


                      • #12
                        No access to GoodsDB in SLIC

                        Tile improvements methinks.
                        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

                        Comment


                        • #13
                          I was looking for the layout of the toolbar were the farms and every thing on but could not find them I was hoping you could help.
                          "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                          The BIG MC making ctp2 a much unsafer place.
                          Visit the big mc’s website

                          Comment


                          • #14
                            Originally posted by Immortal Wombat
                            No access to GoodsDB in SLIC
                            Yes there is no DB that is called GoodsDB it is called or from the slic documentation it should be called ResourceDB. I found in the slic documentaion an example that mentioned the GoodDB instead of ResourceDB or GoodsDB. But I think ResourceDB is the entry that works, as I found it in the ctp2.exe.

                            Originally posted by The Big Mc
                            I was looking for the layout of the toolbar were the farms and every thing on but could not find them I was hoping you could help.
                            I guess you like to add some Tile Improvements, take a look into the tileimp.txt. You will find some entries like:

                            Class
                            Level
                            Column

                            Possible entries for Class are:

                            Land Tile Improvements (Classes defines the column)

                            Farm ATM Mine Road
                            Level 1
                            Level 2
                            Level 3

                            Ocean Tile Improvements

                            OceanFarm OceanATM OceanMine OceanRoad
                            Level 1
                            Level 2
                            Level 3

                            Other Tile Improvements

                            Structure1 Structure2 LandDetector OceanDetector
                            Level 1
                            Level 2
                            Level 3

                            Terraforming

                            Class is Terraform

                            Column 1 Column 2 Column3 Column 4
                            Level 1
                            Level 2
                            Level 3

                            So you can fill the gaps in the TIs button bank.

                            Note you can you can use Levels higher than three but these buttons wouldn't be shown in the user interface only the AI would have access to these TIs.

                            Another way to add more TIs would be to make less advanced TIs obsolate. Usually I don't build farms instead of hydroponic farms in the late game. And I know the AI builds the most advanced TIs anyway.

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

                            Comment


                            • #15
                              Originally posted by Martin Gühmann

                              Yes there is no DB that is called GoodsDB it is called or from the slic documentation it should be called ResourceDB. I found in the slic documentaion an example that mentioned the GoodDB instead of ResourceDB or GoodsDB. But I think ResourceDB is the entry that works, as I found it in the ctp2.exe.
                              Ah, thanks Martin, I was sure I'd see it used, but I couldn't find it anywhere. I'll try that again, it will save a lot of time if I can get it to work.

                              Big mc, sorry, I had no idea before, I think the UI file you are looking for is controlpanel.ldl. Search through it for FARM, or MINE or something, and try to make some sense of it.
                              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

                              Comment

                              Working...
                              X