Announcement

Collapse
No announcement yet.

I've got a few q's about modding

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

  • I've got a few q's about modding

    1. Is it possible to change the tile improvement thing, to be cheaper when upgrading an improvement? I mean, when having a mine, but you want to upgrade the mine to an advanced mine instead. But because it's upgrading, the price should be slightly lower than the original price (Like having a 25% price cut...) Of course, if the tile is empty (Or has something else, than a mine), the price should be normal...

    2. Is it possible to change how slow/fast the time goes by?
    This space is empty... or is it?

  • #2
    2. Change all the TIME_SCALE values in DiffDB.txt for each difficulty level.

    Comment


    • #3
      Thx
      This space is empty... or is it?

      Comment


      • #4
        DP. and if you copied the code that was in here try the next post one
        "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


        • #5
          1) You can add PW to the player who isto simulate the bonus. Here is a code that adds 50 PW to the player if his is building advanced mine over mine and 25 if building a advanced farm over a farm. the temolate for new imrprovent is written there ( // means comment and do not make part of the code
          Code:
          HandleEvent(CreateImprovement) 'PWBonunWhenBuildingOneSameType' pre {
          int_t i;
          int_t InitialPw
          int_t FinalPW;
          int_t OLD_TILEIMP[];
          int_t NEW_TILEIMP[];
          int_t PW_BONUS[];
          
          OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINE); 
          NEW_TILEIMP[0] =  TerrainImprovementDB(TILEIMP_ADVANCED_MINE);
          PW_BONUS[0] = 50;
          
          OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_FARM); 
          NEW_TILEIMP[1] =  TerrainImprovementDB(TILEIMP_ADVANCED_FARM);
          PW_BONUS[1] = 30;
          
          // TEMPLATE obs: * need to be filled
          
          //OLD_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); 
          //NEW_TILEIMP[*] =  TerrainImprovementDB(TILEIMP_*);
          //PW_BONUS[*] = *;
          
          	for(i = 0; i < OLD_TILEIMP.#; i = i + 1) {			// Search for all numbers
          		if(TileHasImprovement(location[0], OLD_TILEIMP[i]) {	// if tile has tile imp in the data 
          			if(value[0] == NEW_TILEIMP[i]) {		// and new improvement has the same number	
          				InitialPw = player[0].publicworkslevel;	// Search for previous amout of PW
          				FinalPW = InitialPw + PW_BONUS[i];		// Give a 50 PW bonus
          				setPW(player[0], FinalPW);		// and set the new player's PW amount
          			}
          		}
          	}
          }
          Obs: UNTESTED, UNTRIED and MAY GIVE SLIC SYNTAX ERRORS.
          any question i am here.

          Copy this code in any included .slc of the folder \default\gamedata\ I recommend the script.slc wich is included for sure for the original game (The included files are in the end of this file and you can include new one you created by writting the line:
          Code:
          #include "AnyFile.slc"
          This means the AnyFile.slc is included. if this file doesnt exist you get slic errors.

          2) The building time is in the TI data in the tileimp.txt just change for the improvement you want the value of its entry:
          Code:
          ProdutionTime
          and there you go

          PS: did you fixed the errors you were getting from your last modding attept?
          "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
            Thx for the help... and yes, I got the last error fixed (I haven't finished my first game yet, so I can't be sure, but I haven't had any problem yet...)

            I now get an slic error when starting the game...
            This space is empty... or is it?

            Comment


            • #7
              But you still get errors when loading CTP2?
              "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 only get the new slic error... The other error got fixed

                OLD_TILEIMP[0]
                NEW_TILEIMP[0]
                PW_BONUS[0]

                OLD_TILEIMP[1]
                NEW_TILEIMP[1]
                What does the number in [] mean? this might be what causes the error...
                This space is empty... or is it?

                Comment


                • #9
                  Hmmm... how come it says, Pedrunn was the last one to reply... even after tons of refreshing of the browser..?
                  This space is empty... or is it?

                  Comment


                  • #10
                    Those are arrays Pedrunn uses - when you define a variabel like the following int_t number[]; you'll have a dynamically growing array. Now if you want to write an integer into that array you have to say which index it shall have. They start at 0.
                    If you want to get into SLICing start reading Locutus' and IW's documentations, mavbe even the activision one...

                    Comment


                    • #11
                      Ok, let's see if I understud it. If I make more of those in Pedrunns example, I have to do like this: (?)

                      OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINE);
                      NEW_TILEIMP[0] = TerrainImprovementDB(TILEIMP_ADVANCED_MINE);
                      PW_BONUS[0] = 50;

                      OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_FARM);
                      NEW_TILEIMP[1] = TerrainImprovementDB(TILEIMP_ADVANCED_FARM);
                      PW_BONUS[1] = 30;

                      OLD_TILEIMP[2] = TerrainImprovementDB(TILEIMP_FARM);
                      NEW_TILEIMP[2] = TerrainImprovementDB(TILEIMP_Hydronic_FARM);
                      PW_BONUS[2] = 30;
                      Ok, I didn't check if I spelled right... But is it something like that?
                      This space is empty... or is it?

                      Comment


                      • #12
                        That's what you want, yes.

                        Comment


                        • #13
                          Ok, thx for the help
                          This space is empty... or is it?

                          Comment


                          • #14
                            DP
                            "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


                            • #15
                              There are actually three errors:
                              1) A missing ';' after
                              Code:
                              int_t InitialPw
                              2) A missing ')' ater the line (you can see that i open two '(' but i dont get one of them closed
                              Code:
                              if(TileHasImprovement(location[0], OLD_TILEIMP[i]) {
                              3) The names of the improvements. In the tileimp.txt you will find that they are in plural not in singular form as i wrote.


                              The number is just something to relate the OLD_TILEIMP[] with the NEW_TILEIMP[] and the PW_BONUS[]. Since the code works like that. (A slic lesson here).
                              Try this code it is esier to understand and has new improvements:
                              Code:
                              HandleEvent(CreateImprovement) 'PWBonunWhenBuildingOneSameType' pre {
                              int_t i;
                              int_t InitialPw;
                              int_t FinalPW;
                              int_t OLD_TILEIMP[];
                              int_t NEW_TILEIMP[];
                              int_t PW_BONUS[];
                              
                              OLD_TILEIMP[0] = TerrainImprovementDB(TILEIMP_MINES); 
                              NEW_TILEIMP[0] =  TerrainImprovementDB(TILEIMP_ADVANCED_MINES);
                              PW_BONUS[0] = 30;
                              
                              OLD_TILEIMP[1] = TerrainImprovementDB(TILEIMP_ADVANCED_MINES); 
                              NEW_TILEIMP[1] =  TerrainImprovementDB(TILEIMP_MEGA_MINES);
                              PW_BONUS[1] = 50;
                              
                              OLD_TILEIMP[2] = TerrainImprovementDB(TILEIMP_FARMS); 
                              NEW_TILEIMP[2] =  TerrainImprovementDB(TILEIMP_ADVANCED_FARMS);
                              PW_BONUS[2] = 40;
                              
                              OLD_TILEIMP[3] = TerrainImprovementDB(TILEIMP_ADVANCED_FARMS); 
                              NEW_TILEIMP[3] =  TerrainImprovementDB(TILEIMP_MEGA_FARMS);
                              PW_BONUS[3] = 60;
                              
                              // TEMPLATE obs: * need to be filled
                              
                              //OLD_TILEIMP[*] = TerrainImprovementDB(TILEIMP_*); 
                              //NEW_TILEIMP[*] =  TerrainImprovementDB(TILEIMP_*);
                              //PW_BONUS[*] = *;
                              
                              	i = 0;								// 'i' is zero for the last loop
                              	while(i < OLD_TILEIMP.#) {					// if 'i' is smaller then the biggest number inside OLD_TILEIMP[]
                              		if(TileHasImprovement(location[0], OLD_TILEIMP[i])) {	// if tile has tile imp equal to OLD_TILEIMP[i] 
                              			if(value[0] == NEW_TILEIMP[i]) {		// if new improvement has the same number	
                              				InitialPw = player[0].publicworkslevel;	// Search for previous amout of PW
                              				FinalPW = InitialPw + PW_BONUS[i];		// Give a 50 PW bonus
                              				setPW(player[0], FinalPW);		// and set the new player's PW amount
                              			}
                              		}
                              		i = i + 1;
                              	}
                              }
                              "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

                              Working...
                              X