Announcement

Collapse
No announcement yet.

A SLIC request...

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

  • A SLIC request...

    Having read the ongoing discussion about small wonders, it sparked an idea in my mind about a related subject - in-game occurances that add atmosphere (Similar to Ben's disaster code). So here is a first step toward that, and if somebody can create this file, feel free to do so.

    I'm looking for a series of in-game triggers that occur when a particular advance is completed. Here's the list

    10 turns of (+10%) gold - civ wide
    Triggering advances
    Applied Math/Bureaucracy/Economics

    10 turns of (+10%) food - civ wide
    Triggering advances
    Granaries/Agricultural Revolution

    10 turns of (+10%) science - civ wide
    Triggering advances
    Philosophy/Classical Education/Chemistry

    10 turns of (+10%) production - civ wide
    Triggering advances
    Currency/Machine Tools/Industrial Revolution

    10 turns of (+1) happiness - civ wide
    Triggering advances
    Ethics/Renaissance/Criminal Code

    (+10%) population in each city - civ wide
    Triggering advances
    Architecture/Mechanical Clock/Corporation

    5 turns of (-1) happiness - civ wide (this one may be a problem as the AI often gets Slave Labor off the bat, so I am wondering how the code will affect the AI in this situation)
    Triggering advances
    Slave Labor/Feudalism

    One thing though - I am hoping that the AI will benefit from this too, if the code cannot be set up to also affect the AI, then I will reduce the benefit to 5 turns. This code is mainly for ingame atmosphere.

    I will need a set of messages for each trigger - hopefully a different message for each event. (For example, I want to avoid a repetitive message for all production bonuses)

    And if the creator of this file can quickly test it on the current Cradle setup for SLIC crashes before sending it to me, it would be greatly appreciated.

    At the same time, I wouldn't mind have some more negative oriented ones too. I'm open for suggestions.
    Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
    ...aisdhieort...dticcok...

  • #2
    Isn't this possible by adding to feats.txt?
    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
      One small problem though...

      Aren't the feats only awarded to the first civ that reaches the advance? I want it for all civs.

      I'll have to look at the file.
      Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
      ...aisdhieort...dticcok...

      Comment


      • #4
        Although a fair amount of work, the easiest way might be to simply make 32 different versions of the same feats. Same prereqs and effects, different names...
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          This should be the slic code for the new feats:

          PHP Code:
          HandleEvent(GrantAdvance'MG_AccomplishFeats' post {    // when player gets an advance
          int_t advanceType;
          int_t i;
          int_t MGCity;
          int_t MGPopAdd;
          advanceType value[0];
          advance[0] = advanceType;
              if (
          advanceType == AdvanceDB(ADVANCE_CURRENCY)
              || 
          advanceType == AdvanceDB(ADVANCE_MACHINE_TOOLS)
              || 
          advanceType == AdvanceDB(ADVANCE_INDUSTRIAL_REVOLUTION)) {
                  
          Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_PRODUCTION), player[0]);
                  
          //AddFeat(featIndex, playerIndex)//no idea if the AccomplishFeat event gives you more than once the same feat, maybe the AddFeat function
              
          }
              elseif (
          advanceType == AdvanceDB(ADVANCE_APPLIED_MATH)
              || 
          advanceType == AdvanceDB(ADVANCE_BUREAUCRACY)
              || 
          advanceType == AdvanceDB(ADVANCE_ECONOMICS)) {
                  
          Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_COMMERCE), player[0]);
              }
          //    elseif (advanceType == AdvanceDB(ADVANCE_GRANARIES)
          //    || advanceType == AdvanceDB(ADVANCE_AGRICULTURAL_REVOLUTION)) {
          //        Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_FOOD), player[0]);
          //    }//no idea how to write this feat in feat.txt yet
              
          elseif (advanceType == AdvanceDB(ADVANCE_PHILOSOPHY)
              || 
          advanceType == AdvanceDB(ADVANCE_CLASSICAL_EDUCATION)
              || 
          advanceType == AdvanceDB(ADVANCE_CHEMISTRY)) {
                  
          Event:AccomplishFeat(FeatDB(FEAT_PLUS10%_SCIENCE), player[0]);
              }
              elseif (
          advanceType == AdvanceDB(ADVANCE_ETHICS)
              || 
          advanceType == AdvanceDB(ADVANCE_RENAISSANCE)
              || 
          advanceType == AdvanceDB(ADVANCE_CRIMINAL_CODE)) {
                  
          Event:AccomplishFeat(FeatDB(FEAT_PLUS1_HAPPINESS), player[0]);
              }
              elseif (
          advanceType == AdvanceDB(ADVANCE_SLAVE_LABOR)
              || 
          advanceType == AdvanceDB(ADVANCE_FEUDALISM)) {
                  
          Event:AccomplishFeat(FeatDB(FEAT_MINUS1_HAPPINESS), player[0]);
              }
              elseif (
          advanceType == AdvanceDB(ADVANCE_ARCHITECTURE)//adds 10% population to each city when these advances are discovered
              
          || advanceType == AdvanceDB(ADVANCE_MECHANICAL_CLOCK)
              || 
          advanceType == AdvanceDB(ADVANCE_CORPORATION)) {
                  
          message(player[0],'Feat10%MorePopsPerCity');
                  for(
          0player[0].cities1) {
                  
          GetCityByIndex(player[0], iMGCity);
                      if(
          CityisValid(MGCity)) {
                          
          MGPopAdd MGCity.population/10;
                          
          AddPops(MGCityMGPopAdd);
                      }
                  }
              }
          }

          messagebox 'FeatPlus10%Production' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_PLUS10%_PRODUCTION);
          }

          messagebox 'FeatPlus10%Commerce' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_PLUS10%_COMMERCE);
          }

          messagebox 'FeatPlus10%Sience' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_PLUS10%_SCIENCE);
          }

          messagebox 'FeatPlus1Happiness' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_PLUS1_HAPPINESS);
          }

          messagebox 'FeatMinus1Happiness' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_MINUS1_HAPPINESS);
          }

          messagebox 'Feat10%MorePopsPerCity' {
              
          Show();
              
          Title(ID_FEAT_ACCOMPISHED_TITLE);
              
          Text(ID_FEAT_10%_MORE_POPS_PER_CITY);

          This should be the new feats for the feats.txt:

          PHP Code:
          FEAT_PLUS10%_PRODUCTION {
              
          Duration 10
              Description str_ldl_0
              EffectIncreaseProduction 10
              SlicMessage 
          "FeatPlus10%Production"
          }

          FEAT_PLUS10%_COMMERCE {
              
          Duration 10
              Description str_ldl_0
              EffectIncreaseCommerce 10
              SlicMessage 
          "FeatPlus10%Commerce"
          }
          FEAT_PLUS10%_SCIENCE {
              
          Duration 10
              Description str_ldl_0
              EffectIncreaseScience 10
              SlicMessage 
          "FeatPlus10%Sience"
          }

          FEAT_PLUS1_HAPPINESS {
              
          Duration 10
              Description str_ldl_0
              EffectIncreaseHappiness 1
              SlicMessage 
          "FeatPlus1Happiness"
          }

          FEAT_MINUS1_HAPPINESS {
              
          Duration 5
              Description str_ldl_0
              EffectIncreaseHappiness 
          -1
              SlicMessage 
          "FeatMinus1Happiness"

          Note that this will only work if the AccomplishFeat event gives you more than once the same feat or the AddFeat function will do this job otherwise we have to find a work around for it. At least the 10 plus pop code will work, oh and of course so far the code is NOT tested therefore it can be still buggy and the strings for the new feat message boxes are missing.

          And finnaly here are all the flags that can be used in the feats.txt.

          -Martin

          Code:
          Duration
          Description
          SlicMessage
          SlicMessageValue
          EffectBoatMovement
          EffectBoatMovementValue
          EffectCityDefenseBonus
          EffectCityDefenseBonusValue
          EffectReduceCityWalls
          EffectReduceCityWallsValue
          EffectIncreaseCityVision
          EffectIncreaseCityVisionValue
          EffectIncreaseProduction
          EffectIncreaseProductionValue
          EffectIncreaseCommerce
          EffectIncreaseCommerceValue
          EffectIncreaseHappiness
          EffectIncreaseHappinessValue
          EffectEliminateDistancePenalty
          EffectEliminateDistancePenaltyValue
          EffectIncreaseBoatVision
          EffectIncreaseBoatVisionValue
          EffectIncreaseScience
          EffectIncreaseScienceValue
          EffectGiveMaps
          EffectIncreaseHitPoints
          EffectIncreaseHitPointsValue
          EffectScriptedTurn
          EffectScriptedTurnValue
          EffectScriptedCity
          EffectScriptedCityValue
          ExcludeAdvance
          ExcludeWonder
          ExcludeFeat
          ExcludeFunction
          ExcludeFunctionValue
          CancelAdvance
          CancelWonder
          CancelFeat
          CancelFunction
          CancelFunctionValue
          Building
          BuildingValue
          MinimumSizeOfCiv
          MinimumSizeOfCivValue
          PS: The slic file and the modified feats.txt is on the way to you Dave.
          Civ2 military advisor: "No complaints, Sir!"

          Comment


          • #6
            Good one, Martin, should have thought of that one myself
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #7
              That would be by far the simplest way if it works. Otherwise adding food and production is a pain.


              Though that does only give one message per feat, you'd need three times as many feats to have individual messages for each advance.
              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


              • #8
                Well, the limited message thing is something I can live with...It's more of a luxury to have separate messages.

                Still, this looks good and is what I am looking for. I'll post this as an new Modswapper option next week.
                Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
                ...aisdhieort...dticcok...

                Comment

                Working...
                X