Announcement

Collapse
No announcement yet.

Design: New SLIC functions

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

  • Design: New SLIC functions

    I'll track any requests that people post here and put it in the first thread.

    Some suggestions first



    2) More access to adding tabs, windows, buttons instead of just message boxes (it may be tough though)

    3) AddSlave (and Add Specialists) (BigMC)

    4) ChangeCivilizationName

    6) Change City Style

    7) AddFood

    8) AddScience




    I'm not a SLICmaster but from what I've seen these aren't available. I'm sure those familiar with SLIC can think of a lot more.


    Some deleted after Martin bashed me for my ignorance
    Last edited by Ekmek; December 23, 2004, 19:51.
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    What would AddFood and AddScience be? Add one-time to a city, or add per-turn to city, or add percentage per-turn to all cities? Many options .
    Solver, WePlayCiv Co-Administrator
    Contact: solver-at-weplayciv-dot-com
    I can kill you whenever I please... but not today. - The Cigarette Smoking Man

    Comment


    • #3
      Re: Design: New SLIC functions

      Originally posted by E
      1) GetGovernment (although MartinG says it can be done now)
      int0 = player[0].government;
      int1 = player[0].govttype;

      Do the job, of course player[0] must be filled with a player and int0 and int1 conatain after the code execution the same integer values.

      Originally posted by E
      3) add slave function (Big MC)
      Code:
      HandleEvent(CityClicked)'MG_TestingH'post{
      	Event:MakePop(city[0], 2);
      }
      Adds everytime you click on a city a slave to it, but be careful player 2 gets very angry about you. Unfortunatly you also get an slic error if you reload slic with that code and the debug build gives you always an assert when the code is executed.

      Originally posted by E
      5) GetCivilization (this and other functions will cause events based on the name of the civilization instead of the player number)
      player[0].civ_name_plural;
      player[0].civ_name_singular;
      player[0].country_name;

      Retrieve the country name, the civ name in singular and the civ name in plural.

      INT CivilizationIndex(civname)
      Return the database index for the named civilization. Useful for comparing to a player’s civilization.

      INT PlayerCivilization(player)
      Return the database index of the player’s civilization (the same number returned by CivilizationIndex)

      Example:
      Code:
      if(PlayerCivilization(g.player) == CivilizationIndex(“AMERICANS”)) { // the current player is the americans }
      And that should allow you to figure out the civ of the given player.

      Originally posted by E
      a) givCivAdvance (and unit, city, etc)
      Never heard of GrantAdvance the event, GrantAdvance the function? Never heard of CreateUnit, CreateCity?

      I think this is a little bit too much then.

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

      Comment


      • #4
        martin i get ( and always have had) an error saying wrong number of arguments.
        "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
        The BIG MC making ctp2 a much unsafer place.
        Visit the big mc’s website

        Comment


        • #5
          Originally posted by The Big Mc
          martin i get ( and always have had) an error saying wrong number of arguments.
          Yes, I get it as well, and that is a problem if you want to use it in a mod, but nevertheless the code above adds a slave to a city whenever you click it. I did not claim that it works fine. To be precise I got the suspicion that all events with optional arguments do not work as advertized, you can call them within the source code but not from slic without slic errors and asserts in the debug version.

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

          Comment


          • #6
            Well maybe we should go with a seperate AddSlave function or overload the add pop function (adding a pop type argument), at least that is much easier to do then to find this nasty bug and an overloaded AddPop function would have the benefit of being able to add other speacialists too.

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

            Comment


            • #7
              Just looked at CityData.cpp, it does have the nice ChangeSpecialists function that takes a POP_TYPE argument and an int argument, so indeed, an overloaded function adding any type of pop is good.
              Solver, WePlayCiv Co-Administrator
              Contact: solver-at-weplayciv-dot-com
              I can kill you whenever I please... but not today. - The Cigarette Smoking Man

              Comment


              • #8
                How about a way to prevent city from growing(as in the 1000 value not the map value.)
                "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                The BIG MC making ctp2 a much unsafer place.
                Visit the big mc’s website

                Comment


                • #9
                  What do you mean, in the 1000 value?
                  Solver, WePlayCiv Co-Administrator
                  Contact: solver-at-weplayciv-dot-com
                  I can kill you whenever I please... but not today. - The Cigarette Smoking Man

                  Comment


                  • #10
                    You know the empire size in empire manager. Well according to that on a occ a city grows in population and it's this population you feed not the city size as seen on the map.

                    I know you can stop growth using a event (cityaddpop) code but I don’t know a way to change the value in empire manager.
                    .
                    "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                    The BIG MC making ctp2 a much unsafer place.
                    Visit the big mc’s website

                    Comment


                    • #11
                      this is kind of relaed to SLIC, but I wondering how hard it would be to add in the source code a scroll bar (or something similar) to where the unit action buttons are (disband, settle, etc) and make it so modders can add buttons that have slic effects.

                      I know some slic uses the disband or sentry buttons to cause events (like upgrade) but it would be great if a modder could add new buttons (like upgrade or raze or enslave city) so that a lot of ctp2 changes requests can be done via slic instead of in the code.
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment


                      • #12
                        1/ The 'other four' mod_* functions made int_f rather than bool_f

                        2/ Increased trade access: RouteCreated and RouteBroken events would be the minimum I guess, with players and good type arguments. IsPlayerTradingGood would be best Possibly a player array variable numberofroutes or something as well. There are probably others that would help, especially if anyone does want to put in the effort for Civ3esque resources.

                        3/ Slavery access: AddSlave yes, and RemoveSlave (or ConvertPopToSlave and ConvertSlaveToPop even) would be great for scenarios and testing, if not in a normal (modded) game.

                        4/ Fix ContinentBiggerThan if not already done, although to be honest IsOnSameContinent and ContinentSize functions would be more useful.
                        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


                        • #13
                          A long time ago I had an optimistic idea which I don't think I ever posted about.

                          I thought that it would be nice to allow some kind of Mayor-like function which would be implemented entirely through SLIC. I know that when I am building I often do it in a very formulaic fashion which it would be easy to formalize. Since it would be easily tweakable by many, in the long term, this could result in very effective (or at least, much better than the existing) mayoral behaviour which could then be used to rewrite the existing AI.

                          Comment


                          • #14
                            Originally posted by Immortal Wombat
                            4/ Fix ContinentBiggerThan if not already done, although to be honest IsOnSameContinent and ContinentSize functions would be more useful.
                            For IsOnSameContinent what about: GetContinent(location[0]) == GetContinent(location[1])

                            That's already in the code.

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

                            Comment


                            • #15
                              Is there a source code map out some were I need to find where the slic functions are held.
                              "Every time I learn something new it pushes some old stuff out of my brain" Homer Jay Simpson
                              The BIG MC making ctp2 a much unsafer place.
                              Visit the big mc’s website

                              Comment

                              Working...
                              X