Announcement

Collapse
No announcement yet.

Slic

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

  • #61
    IW

    I thought of a more simpler possibility.

    if player hasgood & road in teritory
    & hasadvance
    then let the city build the unit

    I saw the Alex slic that assigns elephants to cities, but can I assign no city to build an elephant unless the player hasgood and hasadvance?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment


    • #62
      Yes, to see an example, go to Med Mod. There is a code that restricts the building of units. Its one of the Slic files with a persons name. Also, wonderbuildings.slc gives an example of how to prevent a city building something, in that case, if a player has a wonder.

      You just need to interchange the combination of (has )or (!has) to get what you want.

      Comment


      • #63
        New topic, does anyone know how to use the "AccomplishFeat" command?

        I tried this but it returns a "no function AccomplishFeat" error.

        if (AccomplishFeat(FeatDB(FEAT_THEATERS),player[0]))) {
        humanscore = humanscore + 25;
        }
        I also tried substituting number 7 for the "FEAT_THEATERS)," bit and that did not work either.

        Comment


        • #64
          Originally posted by E
          I saw the Alex slic that assigns elephants to cities, but can I assign no city to build an elephant unless the player hasgood and hasadvance?
          Yes, that was going to be the basis for the Strategic Resources code we nearly did pre-Civ3. You can even add a line that saves the AI the bother if you want to avoid that issue. You probably wouldn't need to code HasAdvance either, since the text file takes care of that.

          The two major flaws is that:
          1/ There's no way of accessing which goods are being traded. Under your system it either becomes a non-issue (it doesn't count via trade) or an even more complicated issue (does the city it's coming from have a mine on that resource).

          2/ The AI can't cope with it, and won't be able to without a lot of source code work.
          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


          • #65
            Originally posted by stankarp
            New topic, does anyone know how to use the "AccomplishFeat" command?

            I tried this but it returns a "no function AccomplishFeat" error.

            if (AccomplishFeat(FeatDB(FEAT_THEATERS),player[0]))) {
            humanscore = humanscore + 25;
            }
            I also tried substituting number 7 for the "FEAT_THEATERS)," bit and that did not work either.
            That's because AccomplishFeat is an event, not a fuction. So it should look like this (untested, no warranties):

            Code:
            HandleEvent(AccomplishFeat) 'blah' post {
            	if (value[0] == FeatDB(FEAT_THEATERS)) {
            		humanscore = humanscore + 25;
            	}
            }
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #66
              Thanks Locutus.

              Comment


              • #67
                Next Question, can you add feats to the game, I have asked and looked elsewhere and can't find anything on how to do it.

                Thanks if anyone can help.

                Comment


                • #68
                  Originally posted by stankarp
                  Next Question, can you add feats to the game, I have asked and looked elsewhere and can't find anything on how to do it.
                  What about feat.txt? And with slic you can also add some non-predefined effects.

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

                  Comment


                  • #69
                    So what you are saying Martin is that all I have to do is add something like this to feats.txt

                    FEAT_SHRINES {
                    Duration 15
                    Description str_ldl_0
                    EffectIncreaseHappiness 3
                    SlicMessage "FeatBuiltShrines"

                    Building { Building IMPROVE_SHRINE Num 8 }
                    }

                    And then add the appropriate message and messagebox details and information in the Great Library? I thought there was more too it.

                    Comment


                    • #70
                      One more question, forgot to ask it in previous questions.

                      This is the messagebox from the AG scenario.

                      alertbox 'AGGameover' {
                      Show(); Title(ID_AG_BLANK);
                      Text(ID_AG_GAMEOVER);
                      Button(ID_AG_BUTTON_OK) {
                      Kill();
                      GameOver(1, 1);
                      }
                      }

                      Anyone know what "GameOver(1, 1);" does?

                      Thanks.

                      Comment


                      • #71
                        Stankarp, don't you have access to a full list of SLIC functions? To say that that would be useful when programming SLIC is a severe understatement... You can find loads of useful documentation (including function & event lists) in one of the topped threads in this forum: 'Resources for Modmakers'.

                        From that documentation:

                        INT GameOver(player, reason)
                        End the game for the given player. reason can be either 1 or 2, 1 meaning the player won, 2 meaning they lost. This is especially useful for scenarios with specific victory conditions. Example:

                        GameOver(player[0], 1); //player[0] wins the game
                        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                        Comment


                        • #72
                          Originally posted by stankarp
                          So what you are saying Martin is that all I have to do is add something like this to feats.txt

                          FEAT_SHRINES {
                          Duration 15
                          Description str_ldl_0
                          EffectIncreaseHappiness 3
                          SlicMessage "FeatBuiltShrines"

                          Building { Building IMPROVE_SHRINE Num 8 }
                          }

                          And then add the appropriate message and messagebox details and information in the Great Library? I thought there was more too it.
                          Yes, and if your feat trigger condition is not in the FeatDB then you can use slic, there is the feat accomplished event and a give feat function.

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

                          Comment


                          • #73
                            Hi Locutus, I have a list but must have missed that bit, thanks. I suspected that was the caseYend game), but was not sure. I have printed copies of most things from the 'Resources for Modmakers'. bUt there is so much there for an amateur programmer but I am getting better.

                            Thanks.

                            Thanks Martin.

                            Comment


                            • #74
                              Quick question re messageboxes.

                              Can you code in or call a function from a message box such as this?

                              messagebox 'RiotA' {
                              show();
                              Title(ID_RIOT_TITLE);
                              Text(ID_RIOT_YOU);
                              // Do you want to spend money on happiness?
                              Button(ID_YES) {
                              Festivities(player[0]) ;
                              Kill();
                              }
                              Button(ID_NO) {
                              Kill();
                              }
                              }

                              Havn't had any success so far so was wondering if its not possible?

                              I Can call messages and have seen examples of enable/disable trigger but not code or calling a function.

                              Comment


                              • #75
                                Figured it out. After finding example of code in a messagebox, I worked it out.

                                The trigger for the message was the "trigger"command to open a menu. While the menu is open, it blocks other things happening. All working now, thanks.

                                Comment

                                Working...
                                X