Announcement

Collapse
No announcement yet.

PW City Improvement wanted!

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

  • PW City Improvement wanted!

    Would it be possible to make a city improvement that would give me "X" PW per turn per citizen?

    City Clock gives 1 gold per..Television gives 5 gold per citizen, this is where I am headed, like say 1 improvement gives 20 PW per citizen and maybe a future one to give say 40 per citizen.

    Just a thought, any/all feedback would be appreciated!

    Troll
    Hi, I'm RAH and I'm a Benaholic.-rah

  • #2
    ###BUMP###

    Anyone have any suggestions?

    Please..
    Attached Files
    Hi, I'm RAH and I'm a Benaholic.-rah

    Comment


    • #3
      Yes... That requires SLIC, but should be possible.

      Roughly, you should create a building with no other effects, and make a SLIC trigger to check through all the cities for a player and give PW for each with the building.

      If you need any more specific SLIC help ask... I'm not sure about checking whether a city contains a given building but it must be doable.

      Comment


      • #4
        You may be out of luck.
        SLIC has a SetPW function, but I did not find an AddPW function.
        veni vidi PWNED!

        Comment


        • #5
          Originally posted by J Bytheway
          Yes... That requires SLIC, but should be possible.

          Roughly, you should create a building with no other effects, and make a SLIC trigger to check through all the cities for a player and give PW for each with the building.

          If you need any more specific SLIC help ask... I'm not sure about checking whether a city contains a given building but it must be doable.
          Look, I am not an expert or even a Novice with SLIC but want to learn. From what I am reading, was wondering if this would be possible:
          Take a building, say "University", could you make it so whenever that particular building was built, it would give say 1000 PW or could you make it so it would give say "?" PW per citizen or are there any other viable options available. What I am looking for is some setup similiar to Gold bonus's with PW bonus's instead.

          Thanks

          Troll
          Hi, I'm RAH and I'm a Benaholic.-rah

          Comment


          • #6
            Originally posted by Maestro
            You may be out of luck.
            SLIC has a SetPW function, but I did not find an AddPW function.
            That's OK, you use something like:
            Code:
            SetPW(player.publicworkslevel + AddThisPW)
            Troll:

            Basically you should be able to do this, the trigger would be something like the following (note that I've not tested this and it's a long time since I've SLICed, so it may well be totally wrong, and will almost certainly have bugs...):

            Code:
            trigger 'AddUniPW' when(city.beginturn) {
              if (CityHasBuilding(city, "IMPROVE_UNIVERSITY") {
                SetPlayer(1, city.owner);
                SetPW(player.1.publicworkslevel + 10);
              }
            }
            That should make universities give 10PW per turn each. By changing that line to:
            Code:
                SetPW(player.1.publicworkslevel + 10 * city.population);
            You should be able to get 10 PW per turn per population.

            Comment


            • #7
              Originally posted by J Bytheway


              That's OK, you use something like:
              Code:
              SetPW(player.publicworkslevel + AddThisPW)
              Troll:

              Basically you should be able to do this, the trigger would be something like the following (note that I've not tested this and it's a long time since I've SLICed, so it may well be totally wrong, and will almost certainly have bugs...):

              Code:
              trigger 'AddUniPW' when(city.beginturn) {
                if (CityHasBuilding(city, "IMPROVE_UNIVERSITY") {
                  SetPlayer(1, city.owner);
                  SetPW(player.1.publicworkslevel + 10);
                }
              }
              That should make universities give 10PW per turn each. By changing that line to:
              Code:
                  SetPW(player.1.publicworkslevel + 10 * city.population);
              You should be able to get 10 PW per turn per population.
              MY addiction..I mean my WANT to play MP CTP1 today outweighs my desire to try this now, however,I shall soon!
              Thanks much my friend!

              I am taking it that you simply add to end of slic?

              ~Peace~
              Troll
              Attached Files
              Hi, I'm RAH and I'm a Benaholic.-rah

              Comment


              • #8
                Originally posted by Troll
                I am taking it that you simply add to end of slic?
                That's the easy way. You can also create your own SLIC file and #include it at the end of script.slc.

                Comment


                • #9
                  I tried adding the one line where you get "pw" per citizen, but you get an error that states that you have a syntax error.."script.slc :1 : syntax error"

                  Any suggestions?

                  Thanks!

                  Troll


                  FYI, I tried creating my own scenario.slc but it crashed, then I added this line to the end of the script.slc..am I in wrong directory?

                  Thanks for any/all help!

                  Troll
                  Hi, I'm RAH and I'm a Benaholic.-rah

                  Comment


                  • #10
                    You'll need to add the whole trigger with the SetPW line replaced by the other one - the latter line alone will not work.

                    Comment


                    • #11
                      Ok, I did that, now I get this error:

                      "city.beginturn is not a builtin variable and is using dot notation"

                      Ok, any advice my friend free oncall experts?
                      Hi, I'm RAH and I'm a Benaholic.-rah

                      Comment


                      • #12
                        OK, I don't know where I picked up that from - it's not listed anywhere in the documentation. Try:

                        Code:
                        trigger 'AddUniPW' when(g.player) {
                          SetPlayer(1, g.player);
                          i=0;
                        
                          while (i < player.1.cities) {
                            SetCityByIndex(1, player.1, i);
                            if (CityHasBuilding(city, "IMPROVE_UNIVERSITY") {
                              SetPW(player.1.publicworkslevel + 10 * city.population);
                            }
                            i = i + 1;
                          }
                        }

                        Comment


                        • #13
                          Now I get this message, keeping in mind I copied and pasted your script into the script.slc file in default/gamedata/script.slc and recieved an error message as follows:

                          default/gamedata/script.slc:2 syntax error

                          Hmm, got me, thanks for all your help though
                          Hi, I'm RAH and I'm a Benaholic.-rah

                          Comment


                          • #14
                            What is line 2 in script.slc?

                            Comment


                            • #15
                              Hmm... I've been experimenting, and I found a missing close bracket on that 'if' line, but even after fixing that I still got the strange error. However, after fiddling around I could make this work:

                              Code:
                              trigger 'AddUniPW' when(g.player) {
                                SetPlayer(1, g.player);
                                i=0;
                              
                                while (i < player.1.cities) {
                                  SetCityByIndex(1, player.1, i);
                                  if (CityHasBuilding(city, "IMPROVE_UNIVERSITY")) {
                                    SetPW(player.1, player.1.publicworkslevel + 10 * city.population);
                                  }
                                  i = i + 1;
                                }
                              }
                              And I can't tell what else I changed, but never mind.

                              Comment

                              Working...
                              X