Announcement

Collapse
No announcement yet.

What Govt Am I? THE SOLUTION!

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

  • What Govt Am I? THE SOLUTION!

    Yep, you modders read it right. I have the solution to finding out a players (Human or AI) government attached to this very thread.

    WARNING!
    This modification will NOT run by itself! This is a modders resource! Of course, if you were to add it to the default game, it will work.

    Concept:
    Okay. Here I was just quietly fixing Citrix profiles, when it suddenly hit me that a Cleric and Fascist is only built by certain governments. Then I remembered that it's possible to check what's in the build queue. So by putting two and two together, an idea formed........
    1. Create units specific to one government.
    2. Put that unit in the build queue.
    3. Check if that unit is in the build queue.
    4. If it is, then logically the player is in that government.

    Now to find a unit which is in the game all the time....... a settler is available from turn 0, but is obsoleted by the urban planner. But who would build a settler over an urban planner? Not even the vanilla AI. So I figured, add a unit, call it something like "DONT BUILD ME AS I DISAPPEAR EVERY TURN!", and voila. I should be able to extract what government someone is in be checking what govt-specific unit I can build.

    Installing:
    1. Put the SLIC file in the usual place, and enable it through script.slc.
    2. Add what's contained in units.txt to the real units.txt (my file only contains the changed values).
    3. Add names for each unit in gl_str.txt.
    4. And away we go! No need for uniticon.txt, newsprite.txt or any other file to be modified.

    How to use:
    The variable GOVT_WhatGovtAmI[player] contains the integar which correlates to the GovernmentDB index (hence why the array is setup in govern.txt order). Just check the value of that variable, and you have your government!

    Bugs:
    The bane of a modder.......
    1. The unit will actually stay in the build queue. No matter where I put KillUnitFromBuildQueue, it only worked from HandleEvent(EndTurn). Maybe if we give the units names like "DONT BUILD ME!" or something, and definitely not put it in unitbuildlists.txt for the AI.
    2. Because of the above bug, if you have nothing in the build queue, the production will accumulate and you'll eventually be able to build one of the temp units (not good). I'd say a simple CreateUnit check to see if one's built, and replace it with a standard settler if one actually is built will do nicely here.

    This is definitely a huge step for us modders. SOOOOOOOOOOOOOOOOO much can be done with knowing what Government someone is in.

    EDIT: Clarification - The temp unit only stays in the build queue till the EndTurn event is called. The KillUnitFromBuildQueue command works from there. So as soon as you hit the "End Turn" button, the temp unit disappears.
    Last edited by Dale; November 7, 2002, 05:49.

  • #2
    The file.....................

    EDIT: Removed attachment to save on confusion.
    Last edited by Dale; November 8, 2002, 17:18.

    Comment


    • #3
      Genius!

      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


      • #4
        Brilliant!!!!!
        Shores Of Valinor.com - The Premier Tolkien Community -

        Comment


        • #5
          Does this mean the idea i mentioned long ago about governments can be implemented ??

          Here



          EDIT:
          A quote from the post

          quote:

          Originally posted by Pedrunn
          But if we are gotng to implement this how do we know wich gov the player has?


          Ah yes. This is not possible.

          Posted by Immortal Wombat
          Oxygen should be considered a drug
          Tiberian Sun Retro
          My Mod for Tiberian Sun Webmaster of
          http://www.tiberiumsun.com

          Comment


          • #6
            oops...
            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


            • #7
              A truly inspired workaround . It seems there's not much we can't do if we think about it long enough.

              Comment


              • #8
                I'm sure a few of you know I've been looking at this problem for almost 2 years now. Remember for the first diplomod I wanted same-government diplomatic bonuses. And that was Jan 01!!!!

                Comment


                • #9
                  Originally posted by J Bytheway
                  A truly inspired workaround . It seems there's not much we can't do if we think about it long enough.
                  Does this put me in the ranks of St Swithin?

                  More workarounds than you can shake a lemur poo at!

                  Comment


                  • #10
                    Originally posted by SMIFFGIG
                    Does this mean the idea i mentioned long ago about governments can be implemented ??

                    Here

                    Yeah I suppose it could, but I agree with Locutus that it's not realistic, unless you use it as a diplomatic bonus, not an absolute like you suggested. I mean come on! 5 years ago Australia was flirting with China for an alliance!

                    Comment


                    • #11
                      SLIC Update! Version 0.2

                      Here's an updated SLIC file for the modders. It fixes all bugs found thus far, including the ones mentioned above.

                      - So you will no longer accumulate production if the temp unit is the only thing in your capital's build queue.
                      - The temp unit will no longer show in the player's turn in the build queue (but will still be selectable from the list). The temp unit will actually be in the build queue during everyone else's turn. But that's irrelevant as far as I can see.
                      - The government you are in is now updated on the turn you change government, instead of the next turn as previous. IE: You click "Enact" on a government, and when you hit "End Turn" the variable updates to "Anarchy".

                      This is pretty much finished/fixed and working properly now.

                      EDIT: Deleted attachment to save on confusion.
                      Last edited by Dale; November 8, 2002, 17:19.

                      Comment


                      • #12
                        Flott!!!!


                        Wonderful
                        When it all comes to it, life is nothing more than saltfish - Salka Valka

                        Comment


                        • #13
                          Version 0.3

                          Okay, one last update v0.3:

                          - I've made it easier to Mod.

                          What this Mod does:
                          This Mod is a project I've been trying to get working for almost 2 years. It finds out and stores what Govt everyone is in for use in other scripts. This script is intended for other Modders to help them in their projects. Please leave the header of this script with the code.

                          How to add this to a Mod?
                          1. Put this SLIC in the usual place and add to script.slc
                          2. Create temp units in Units.txt for every government in the Mod, remembering to use the "GovernmentType" flag to limit each unit to a seperate government (IE: like the Cleric is). These units MUST be one after the other and in GovernmentDB order!
                          3. Open this SLIC and modify the following:
                          - In 'GOVT_SetupArrays' setup the GOVT_GovtUnits array with the names of every temp unit.
                          - In 'GOVT_SetupArrays' change the variable GOVT_FirstUnitIndex to the UnitDB index of the first temp unit. In the vanilla game this is 72 if you put the temp units after all the others.
                          4. In 'gl_str.txt' add names for these temp units (I would use something like "Govt Check Unit").
                          5. When referencing the Govt variable, check GOVT_WhatGovtAmI[playerNum] to get the GovernmentDB index (IE: If in Tyranny in vanilla game you get 10).

                          Any comments let me know. Hope this helps expand people's Mods. This will be VERY useful for the Dark Ages in Ages of Man!

                          EDIT: Added to the directory in Modification\Text and Slics.
                          Attached Files
                          Last edited by Dale; November 8, 2002, 16:52.

                          Comment


                          • #14
                            Are you sure BuildUnit(city_t, int_t) does work as a funtion?

                            I tested it as a event handler and it didnt!
                            "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
                              Originally posted by Pedrunn
                              Are you sure BuildUnit(city_t, int_t) does work as a funtion?

                              I tested it as a event handler and it didnt!
                              Yep. I tested extensively.

                              Comment

                              Working...
                              X