Announcement

Collapse
No announcement yet.

PowerSLICs 1.2 (new feature: Rankings) + 1 question to Mr. Ogre

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

  • PowerSLICs 1.2 (new feature: Rankings) + 1 question to Mr. Ogre

    All,


    Please find attached below the PowerSLICs in version 1.2 for CTP 1.1 (change vs. previous
    version: New feature "Ranking messages" included). Again, special thanks to Dominique
    (as I have implemented an advanced version of Dom's building MOD in here) and to Mr. Ogre
    for his visibility and active support in this thread.

    Mr. Ogre, is there any way to show user-defined variables like "counter" in strings ?
    I struggled immensively when I wanted to show the value of a user-defined variable within a
    message box. Did I miss something ? If not, such a feature would help us a lot in SLIC 1.2. Thanks
    for answering anyways.

    One hint: I hope that everything is working with this code - if not, please report bugs here !


    Regards,
    TP


    TP's PowerSLICs 1.2 for Call To Power 1.1 (July 18, 1999)
    ================================================== =======


    DISCLAIMER:
    AS USUAL. IF YOU SCREW UP YOUR HARD DISK, YOUR WIFE, YOUR CAT OR ANYTHING
    ELSE BEING CAUSED BY THIS DOCUMENT WHICH YOU PERCEIVE AS NEGATIVE,SIMPLY
    FORGET TO SUE ME - NO WAY. YOU ARE FULLY RESPONSIBLE FOR YOUR COPY OF CTP
    AND YOUR LIFE. ALSO, I WILL GIVE NO SUPPORT FOR THIS MOD. I AM JUST SHARING
    THIS SO OTHER PEOPLE DO NOT NEED TO REINVENT THE WHEEL.

    PART OF THIS CODE HAS BEEN FIRST PUBLISHED BY DOMINIQUE. THANK YOU VERY
    MUCH. I DO NOT WANT TO RAISE THE PERCEPTION THAT I HAVE BEEN STEALING
    CODE OF OTHER PERSONS. I HAVE USED DOMINIQUE'S BUILDING MOD AND SLIGHTLY
    ADAPTED IT TO MAKE A GREAT MOD SLIGHTLY BETTER.

    IF YOU FIND BUGS IN THIS CODE, PLEASE POST YOUR COMMENTS IN THE "CTP
    CREATION" THREAD OF APOLYTON'S FORUM (http://apolyton.net).


    Thomas P. aka TP
    July 18, 1999


    How do I install this ?
    -----------------------
    Simply copy the SLIC code beginning after "SCRIPT.SLC" into your "SCRIPT.SLC" file
    (there is only one file with this name in the original installation of CTP 1.1).
    Do the same for the remaining code, i.e. copy the string code beginning after "INFO_STR.TXT"
    into your "INFO_STR.TXT" file (again, there is only one file with this name in the original
    installation of CTP 1.1). Within the "SCRIPT.SLC" you have to delete one part of the original code
    (please read through the code comments), however if you forget to do this, nothing major
    will happen. You will just not be able to enjoy the updated Dominique's Building MOD.


    With what game version will this work ?
    ------------------------------------------
    I have tested it with CTP 1.1 German version. It works with or without CD's MOD 4.2
    (which I strongly recommend everyone to have a look at). If you want to localize this
    MOD into other languages, you just have to translate the strings found in the
    "INFO_STR.TXT" part of this text. Don't ask me to translate it for you, I won't do it
    (however it should not be difficult at all).


    What's the benefit, i.e. what is in it for me ?
    -----------------------------------------------
    This small collection of SLIC code has been designed by myself with the objective to
    make CTP a little bit more informative and to improve the interface. Also, for some of
    the most annoying bugs I have included workarounds. Here is the list of changes to
    CTP original.

    1. Updated Dominique's Building MOD
    I was slighthly annoyed by those double messages ("you have build XXX" AND "city
    queue is empty"). So I changed Dominique's code slightly. Now you will get only one
    message directly after an improvement has been built (telling exactly this). From the
    next turn on, you will get the nice note that the queue is empty in case you forgot to
    build something new.

    2. Public Work reminder
    I belong to those people who do not look constantly on the PW status. So this MOD
    will give you a nice warm reminder in case you have more than 1500 units of PW
    unused. Working in Market Research, we like to call such things "opportunity costs".
    So from now on, CTP will bang on your head as soon as you have too much unused
    PW.

    3. Disappearing Unit syndrome workaround
    After I found out that this phenomen may be caused due to a UI inconsistency after
    you have researched a new advance, this SLIC part will force the UI to be updated
    each time a human player begins its turn. I am not sure whether this really works, but
    it surely does not negatively effect the game at all.

    4. Warning on spotted bombard-capable enemy units
    As my copy of CTP is not able to autocenter on bombardments of my units, I have
    established two warning systems (second one follows later): As soon as one of your
    units or cities spots a bombard-capable enemy unit, you will get a nice warning.
    Therefore you should be able to "proactively" react. A small eye icon will allow you to
    center the map to this enemy unit. Note: This message will not be shown if your units
    spot a bombarding-unit which is currently in an enemy city as this would not be very
    realistic. For your convenience, you will be informed about the type of the
    bombard-capable unit and the type of the unit having spotted this enemy.

    5. Warning on bombarding
    **** happens. Therefore you will get a warning as soon as one of your enemies has
    bombarded one of your units or cities. Unfortunately, the eye icon does not work yet,
    i.e. you have to go manually to the place where the fight took place. For your
    convenience, you will be informed about the type of the attacker and the type of the
    attacked unit.

    6. Ranking messages
    Each round, there is a 10% chance that one of the following ranking informations will be
    shown: Number of cities, Geographic spread, Amount of gold, Number of advances,
    Military power, Number of population, Power in Space, Power underseas or Number of trade routes.
    You will get this message only if there have been at least 20 rounds after the last ranking has
    been shown. Ranking messages will tell you whether you are #1, #2, #3, #4, #5, between #6 and #10
    or worse than #10. Currently I have not found a way to show the top scoring civilization names in
    those messages, so you do not know who is your main enemy for a specific category. Maybe this will
    follow sometimes.


    *End of document. Following is the code you will have to implement in your game
    copy*


    **************
    * SCRIPT.SLC *
    **************

    //
    // This has been taken out. An updated version follows later to adapt fully to DOM's MOD
    //

    // messagebox '37CityQueueIsEmpty' {
    // Text(ID_CITY_BUILD_QUEUE_IS_EMPTY);
    // EyePoint(city.1.location, city.owner, 'OpenProductionCallback');
    // Duration(1);
    // MessageType("WASTING_WORK");
    // Title(ID_TITLE_CITY_BUILD_QUEUE_IS_EMPTY);
    // }


    //
    // Warning on too much Public Works (1500) not used currently
    //

    trigger 'TP_T_Warning_Public_Works' when (IsHumanPlayer(g.player) &&
    (player.1.publicworkslevel >= 1500)) {
    Message(g.player, 'TP_M_Warning_Public_Works');
    }

    messagebox 'TP_M_Warning_Public_Works' {
    Title(ID_TP_TITLE_Warning_Public_Works);
    Text(ID_TP_TEXT_Warning_Public_Works);
    }


    //
    // 1. This will force the graphics system to synchronize with the game's internal state
    // (workaround for Disappearing Unit Syndrome; not sure whether it really works though)
    // 2. Also it will inform a human player with a given chance (10% per round) of his rankings
    // However there must have been at least 20 rounds since the last ranking was done.
    // Unfortunately I have not found yet a way how to show user-defined variables in strings
    // via the INFO_STR.TXT (Mr. Ogre, can we implement that in SLIC 1.2 ?) therefore we have to
    // live with the current solution of getting one ranking at a time (and no info about who is the top guy)
    //

    trigger 'TP_T_Catch_Up' when (IsHumanPlayer(g.player)) {
    CatchUp();
    lastrank = lastrank + 1;
    getrank=Random(99);
    if (getrank <= 9 && lastrank >= 20) {
    lastrank = 0;
    Show();
    Message(g.player, 'TP_M_Rankings');
    }
    }

    messagebox 'TP_M_Rankings' {
    whichrank = Random(8);
    if (whichrank == 0) {
    Title(ID_TP_TITLE_Ranking_city);
    if (CitiesRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (CitiesRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (CitiesRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (CitiesRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (CitiesRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (CitiesRank(player) >= 6 && CitiesRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (CitiesRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 1) {
    Title(ID_TP_TITLE_Ranking_geographic);
    if (GeographicRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (GeographicRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (GeographicRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (GeographicRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (GeographicRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (GeographicRank(player) >= 6 && GeographicRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (GeographicRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 2) {
    Title(ID_TP_TITLE_Ranking_gold);
    if (GoldRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (GoldRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (GoldRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (GoldRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (GoldRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (GoldRank(player) >= 6 && GoldRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (GoldRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 3) {
    Title(ID_TP_TITLE_Ranking_science);
    if (KnowledgeRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (KnowledgeRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (KnowledgeRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (KnowledgeRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (KnowledgeRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (KnowledgeRank(player) >= 6 && KnowledgeRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (KnowledgeRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 4) {
    Title(ID_TP_TITLE_Ranking_military);
    if (MilitaryRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (MilitaryRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (MilitaryRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (MilitaryRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (MilitaryRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (MilitaryRank(player) >= 6 && MilitaryRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (MilitaryRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 5) {
    Title(ID_TP_TITLE_Ranking_population);
    if (PopulationRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (PopulationRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (PopulationRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (PopulationRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (PopulationRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (PopulationRank(player) >= 6 && PopulationRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (PopulationRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 6) {
    Title(ID_TP_TITLE_Ranking_space);
    if (SpaceRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (SpaceRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (SpaceRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (SpaceRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (SpaceRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (SpaceRank(player) >= 6 && SpaceRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (SpaceRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 7) {
    Title(ID_TP_TITLE_Ranking_Trade);
    if (TradeRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (TradeRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (TradeRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (TradeRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (TradeRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (TradeRank(player) >= 6 && TradeRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (TradeRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    if (whichrank == 8) {
    Title(ID_TP_TITLE_Ranking_Undersea);


    if (UnderseaRank(player) == 1) {Text(ID_TP_TEXT_Ranking_1);}
    if (UnderseaRank(player) == 2) {Text(ID_TP_TEXT_Ranking_2);}
    if (UnderseaRank(player) == 3) {Text(ID_TP_TEXT_Ranking_3);}
    if (UnderseaRank(player) == 4) {Text(ID_TP_TEXT_Ranking_4);}
    if (UnderseaRank(player) == 5) {Text(ID_TP_TEXT_Ranking_5);}
    if (UnderseaRank(player) >= 6 && UnderseaRank(player) <=10) {Text(ID_TP_TEXT_Ranking_follower);}
    if (UnderseaRank(player) >= 11) {Text(ID_TP_TEXT_Ranking_looser);}
    }
    }


    //
    // Warning in case units with bombarding abilities are spotted
    // (workaround for non-autocentering on bombardments)
    // This SLIC does not trigger a message if the sighted unit is in a city.
    // Will give you nice surprises...
    //

    trigger 'TP_T_Warning_Bombarding' when (player.sightedunit && IsBombardingUnit(unit)) {
    position = unit.location;


    incity = 0;
    i = 1;
    while (i < player.cities) {
    SetCitybyIndex(1, player, i);
    if (position == city.location) {
    incity = 1;
    }
    i = i + 1;
    }
    if (incity == 0) {
    Message(unit.2.owner, 'TP_M_Warning_Bombarding');
    incity = 0;
    }
    }

    messagebox 'TP_M_Warning_Bombarding' {
    Title(ID_TP_TITLE_Warning_Bombarding);
    Text(ID_TP_TEXT_Warning_Bombarding);
    EyePoint(unit.2);
    }


    //
    // Warning in case human player got bombarded (workaround for non-autocentering on bombardments)
    // Unfortunately, the EyePoint does not work yet. Can anyone help here ?
    //

    trigger 'TP_T_Warning_Bombarding2' when (special.bombarded && IsBombardingUnit(unit)) {
    Show();
    Message(unit.2.owner, 'TP_M_Warning_Bombarding2');
    }

    messagebox 'TP_M_Warning_Bombarding2' {
    Title(ID_TP_TITLE_Warning_Bombarding2);
    Text(ID_TP_TEXT_Warning_Bombarding2);
    EyePoint(unit.2);
    }


    //
    // Improvement message (c) Original 1999 by DOMINIQUE, updated by (c) 1999 TP
    //

    trigger 'DOM_T_Building_Built' when (IsHumanPlayer(g.player) && (building.built >= 0)
    && (city.owner == g.player)) {
    Message(g.player, 'DOM_M_Building_Built');
    }

    messagebox 'DOM_M_Building_Built' {
    Title(ID_DOM_TITLE_CITY_BUILDING_BUILT);
    if (building.built == 0) {Text(ID_DOM_BUILDING_BUILT_Granary);}
    if (building.built == 1) {Text(ID_DOM_BUILDING_BUILT_Capitol);}
    if (building.built == 2) {Text(ID_DOM_BUILDING_BUILT_City_Wall);}
    if (building.built == 3) {Text(ID_DOM_BUILDING_BUILT_Temple);}
    if (building.built == 4) {Text(ID_DOM_BUILDING_BUILT_Courthouse);}
    if (building.built == 5) {Text(ID_DOM_BUILDING_BUILT_Publishing_House);}
    if (building.built == 6) {Text(ID_DOM_BUILDING_BUILT_Marketplace);}
    if (building.built == 7) {Text(ID_DOM_BUILDING_BUILT_Academy);}
    if (building.built == 8) {Text(ID_DOM_BUILDING_BUILT_Theatre);}
    if (building.built == 9) {Text(ID_DOM_BUILDING_BUILT_Aqueduct);}
    if (building.built == 10) {Text(ID_DOM_BUILDING_BUILT_Coliseum);}
    if (building.built == 11) {Text(ID_DOM_BUILDING_BUILT_Bank);}
    if (building.built == 12) {Text(ID_DOM_BUILDING_BUILT_University);}
    if (building.built == 13) {Text(ID_DOM_BUILDING_BUILT_Hospital);}
    if (building.built == 14) {Text(ID_DOM_BUILDING_BUILT_Mill);}
    if (building.built == 15) {Text(ID_DOM_BUILDING_BUILT_Cathedral);}
    if (building.built == 16) {Text(ID_DOM_BUILDING_BUILT_City_Clock);}
    if (building.built == 17) {Text(ID_DOM_BUILDING_BUILT_Factory);}
    if (building.built == 18) {Text(ID_DOM_BUILDING_BUILT_Oil_Refinery);}
    if (building.built == 19) {Text(ID_DOM_BUILDING_BUILT_Movie_Theatre);}
    if (building.built == 20) {Text(ID_DOM_BUILDING_BUILT_Airport);}
    if (building.built == 21) {Text(ID_DOM_BUILDING_BUILT_Drug_Store);}
    if (building.built == 22) {Text(ID_DOM_BUILDING_BUILT_Nuclear_Plant);}
    if (building.built == 23) {Text(ID_DOM_BUILDING_BUILT_Recycling_Plant);}
    if (building.built == 24) {Text(ID_DOM_BUILDING_BUILT_Television);}
    if (building.built == 25) {Text(ID_DOM_BUILDING_BUILT_Computer_Centre);}
    if (building.built == 26) {Text(ID_DOM_BUILDING_BUILT_SDI);}
    if (building.built == 27) {Text(ID_DOM_BUILDING_BUILT_Robotic_Plant );}
    if (building.built == 28) {Text(ID_DOM_BUILDING_BUILT_Security_Monitor);}
    if (building.built == 29) {Text(ID_DOM_BUILDING_BUILT_Micro_Defense);}
    if (building.built == 30) {Text(ID_DOM_BUILDING_BUILT_Aqua_Filter);}
    if (building.built == 31) {Text(ID_DOM_BUILDING_BUILT_Eco_Transit);}
    if (building.built == 32) {Text(ID_DOM_BUILDING_BUILT_Incubation_Center);}
    if (building.built == 33) {Text(ID_DOM_BUILDING_BUILT_Rail_Launcher);}
    if (building.built == 34) {Text(ID_DOM_BUILDING_BUILT_Arcologies);}
    if (building.built == 35) {Text(ID_DOM_BUILDING_BUILT_Beef_Vat);}
    if (building.built == 36) {Text(ID_DOM_BUILDING_BUILT_House_of_Freezing);}
    if (building.built == 37) {Text(ID_DOM_BUILDING_BUILT_Mind_Controller);}
    if (building.built == 38) {Text(ID_DOM_BUILDING_BUILT_Forcefield);}
    if (building.built == 39) {Text(ID_DOM_BUILDING_BUILT_Nanite_Factory);}
    if (building.built == 40) {Text(ID_DOM_BUILDING_BUILT_Fusion_Plant);}
    if (building.built == 41) {Text(ID_DOM_BUILDING_BUILT_Bio_Memory_Chip);}
    if (building.built == 42) {Text(ID_DOM_BUILDING_BUILT_Body_Exchange);}
    Button(ID_BUTTON_LIBRARY) {
    LibraryBuilding(building.built);
    }
    EyePoint(city.1.location, city.owner, 'OpenProductionCallback');
    justbuilt = 1;
    }


    //
    // And now the revised "City Queue is empty" message (no annoying double messages anymore)
    // Important: Please eliminate the original (messagebox '37CityQueueIsEmpty') by putting them in comments.
    //

    trigger 'TP_T_Queue_Empty' when (city.buildingnothing) {
    Message(g.player, 'TP_M_Queue_Empty');
    }

    messagebox 'TP_M_Queue_Empty' {
    if (justbuilt == 1) {
    justbuilt = 0;
    Abort();
    }
    else {
    Text(ID_CITY_BUILD_QUEUE_IS_EMPTY);
    EyePoint(city.1.location, city.owner, 'OpenProductionCallback');
    Duration(1);
    MessageType("WASTING_WORK");
    Title(ID_TITLE_CITY_BUILD_QUEUE_IS_EMPTY);
    }
    }

    ****************
    * INFO_STR.TXT *
    ****************

    ##
    ## Warning on too much Public Works not yet implemented (see script.slc for SLIC part)
    ##

    TP_TITLE_Warning_Public_Works "Staatliche Bautrupps"
    TP_TEXT_Warning_Public_Works "Es haben sich inzwischen mehr als 1500 Einheiten an Staatlichen Bautrupps angehäuft. Vielleicht sollen wir diese nun einsetzen, anderenfalls wäre es angebracht, die Quote für Bautrupps zu senken, damit mehr Produktion für Stadtverbesserungen und Wunder ausgegeben werden kann."


    ##
    ## Warning on sight of bombarding capable units (see script.slc for SLIC part)
    ##

    TP_TITLE_Warning_Bombarding "[unit.name] gesichtet !"
    TP_TEXT_Warning_Bombarding "Eine unserer Einheiten ([unit.2.name]) hat soeben mit Schrecken ein gegnerische Einheit mit Bombardmentfähigkeit ausgemacht ([unit.name]). Wir sollten jetzt sehr bedacht vorgehen."


    ##
    ## Warning in case human player got bombarded (workaround for non-autocentering on bombardments) (see script.slc for SLIC part)


    ##

    TP_TITLE_Warning_Bombarding2 "Bombardment des Gegners (Täter: [unit.name]) !"
    TP_TEXT_Warning_Bombarding2 "Eine unserer Einheiten ([unit.2.name]) wurde soeben Ziel eines feigen Bombardments einer gegnerischen Einheit ([unit.name]). Dies schreit nach Vergeltung."


    #
    # DOM's Building MOD Strings (see script.slc for SLIC part)
    #

    DOM_TITLE_CITY_BUILDING_BUILT "Stadt-Modernisierung"
    DOM_BUILDING_BUILT_CITY "???"
    DOM_BUILDING_BUILT_Granary "Wir haben jetzt ein Lagerhaus in [city.1.name]."
    DOM_BUILDING_BUILT_Capitol "Der Regierungssitz hat sich nach [city.1.name] bewegt."
    DOM_BUILDING_BUILT_City_Wall "[city.1.name] ist nun mit Stadtmauern bewehrt."
    DOM_BUILDING_BUILT_Temple "[city.1.name] hat nun seinen eigenen Tempel."
    DOM_BUILDING_BUILT_Courthouse "Ein Gerichtsgebäude wurde in [city.1.name]erstellt."
    DOM_BUILDING_BUILT_Publishing_House "Eine Druckerei befindet sich jetzt in [city.1.name]."
    DOM_BUILDING_BUILT_Marketplace "[city.1.name]'s Händler treffen sich ab heute am neuen Marktplatz."
    DOM_BUILDING_BUILT_Academy "Wir haben eine Akademie in [city.1.name] zum Dienste unserer Wissenschaft."
    DOM_BUILDING_BUILT_Theatre "Großer Gönner, wir danken für das neu gebaute Theater in [city.1.name]."
    DOM_BUILDING_BUILT_Aqueduct "[city.1.name] hat soeben sein Adäquat eingeweiht."
    DOM_BUILDING_BUILT_Coliseum "[city.1.name] feiert die Einweihung seines Kolloseums."
    DOM_BUILDING_BUILT_Bank "Die neue Bank in [city.1.name] treibt unsere Geschäfte voran."
    DOM_BUILDING_BUILT_University "[city.1.name]'s neue Universität wird Euren Ruf als Wissensmäzen fördern."
    DOM_BUILDING_BUILT_Hospital "Dank des neuen Krankenhauses sind die Bürger von [city.1.name] wesentlich gesünder."
    DOM_BUILDING_BUILT_Mill "Aufgrund der neuen Mühle wächst die Produktion von [city.1.name]."
    DOM_BUILDING_BUILT_Cathedral "Pilger aus Nah und Fern strömen in die Kathedrale von [city.1.name]."
    DOM_BUILDING_BUILT_City_Clock "Die Geschäfte in [city.1.name] gehen dank der neuen Turmuhrmehr als gut."
    DOM_BUILDING_BUILT_Factory "Erhöhte Produktivität in [city.1.name] dank der neu erbauten Fabrik."
    DOM_BUILDING_BUILT_Oil_Refinery "Mehr Produktion - und mehr Verschmutzung - in [city.1.name], da wir die neue Ölraffineriefertiggestellt haben."
    DOM_BUILDING_BUILT_Movie_Theatre "Der neue Filmpalast in [city.1.name] zieht Stars, Sternchen und viele Zuschauer an."
    DOM_BUILDING_BUILT_Airport "[city.1.name] hat einen neuen Flughafen!"
    DOM_BUILDING_BUILT_Drug_Store "In [city.1.name] wurde eine Apotheke fertiggestellt."
    DOM_BUILDING_BUILT_Nuclear_Plant "Die Kraft der Atome wird ab jetzt in [city.1.name]'s neuem Kernkraftwerkgebändigt."
    DOM_BUILDING_BUILT_Recycling_Plant "Die neue Recycling-Anlage in [city.1.name] wird unserer Umwelt kräftig die Lungen reinigen."
    DOM_BUILDING_BUILT_Television "Auf dem neuen TV-Sender in [city.1.name] wird die erste Vorschau von 'Sid Meier's Civilization III' gezeigt."
    DOM_BUILDING_BUILT_Computer_Centre "Unsere Wissenschaftler in [city.1.name] profitieren ab heute von ihrem Computer-Zentrum."
    DOM_BUILDING_BUILT_SDI "Star Wars wird zur Realität in [city.1.name] mit der SDI-Anlage."
    DOM_BUILDING_BUILT_Robotic_Plant "Unglaubliche Produktion in [city.1.name] - Roboterfabrik erbaut."
    DOM_BUILDING_BUILT_Security_Monitor "1984 in [city.1.name]: Eine Bürgerkontrolle ist soeben aktiviert worden."
    DOM_BUILDING_BUILT_Micro_Defense "Die Bürger von [city.1.name] sind ab heute vor gemeinen Angriffen mit einem Bio-Schutzfilter bewacht."
    DOM_BUILDING_BUILT_Aqua_Filter "Der soeben eingeweihte Wasserfilter in [city.1.name] unterstützt das Wachstum der Stadt."
    DOM_BUILDING_BUILT_Eco_Transit "Die Verschmutzung wird in [city.1.name] durch Ökofahrzeugedramatisch reduziert."
    DOM_BUILDING_BUILT_Incubation_Center "Die neue Inkubationsstätte in [city.1.name] gibt Frauen neue Freiheiten."
    DOM_BUILDING_BUILT_Rail_Launcher "In [city.1.name], eine Startröhre ist bereit zum ersten Einsatz."
    DOM_BUILDING_BUILT_Arcologies "Wir haben jetzt mehr Platz in [city.1.name] dank der neuen Schutzkuppel."
    DOM_BUILDING_BUILT_Beef_Vat "Nahrung für alle - in [city.1.name] wird dies mit dem Fleischtreibhaus Realität."
    DOM_BUILDING_BUILT_House_of_Freezing "Gold, gold, gold ! Die Cryo-Anlage in [city.1.name] is einsatzbereit."
    DOM_BUILDING_BUILT_Mind_Controller "Unzufriedenheit ist kein Thema mehr in [city.1.name], da dort die Gedankenkontrolle wirkt."
    DOM_BUILDING_BUILT_Forcefield "[city.1.name] wird nun durch ein Kraftfeld geschützt."
    DOM_BUILDING_BUILT_Nanite_Factory "Hey, Berufsshopper, wir haben jetzt in [city.1.name] die Nanitenproduktion."
    DOM_BUILDING_BUILT_Fusion_Plant "Der Fusionsreaktor in [city.1.name] wird noch heute hochgefahren."
    DOM_BUILDING_BUILT_Bio_Memory_Chip "Wissen und Civ 47 - alles erhältlich in [city.1.name] mit Hilfe des Wissenimplantats."
    DOM_BUILDING_BUILT_Body_Exchange "Gehen Sie nach [city.1.name] und holen Sie sich, was Sie verdienen - mit dem neuen Körperwandler."


    #
    # Show human player rankings
    #

    TP_TITLE_Ranking_city "Ranking: Anzahl an Städten"
    TP_TITLE_Ranking_geographic "Ranking: Ausbreitung der Zivilisation"
    TP_TITLE_Ranking_gold "Ranking: Staatshaushalt"
    TP_TITLE_Ranking_science "Ranking: Wissenschaft"
    TP_TITLE_Ranking_military "Ranking: Militärische Stärke"
    TP_TITLE_Ranking_population "Ranking: Bevölkerungszahl"
    TP_TITLE_Ranking_space "Ranking: Ausbreitung im All"
    TP_TITLE_Ranking_Trade "Ranking: Anzahl an Handelsrouten"
    TP_TITLE_Ranking_Undersea "Ranking: Anzahl an Unterwasserstädten"
    TP_TEXT_Ranking_1 "Sie sind absolute Klasse, Herr - Rang 1 in dieser Kategorie !"
    TP_TEXT_Ranking_2 "Nur noch einen Konkurrenten haben Sie vor sich, dann sind wir da, wo wir hingehören: An der Spitze."
    TP_TEXT_Ranking_3 "Immerhin stehen Sie als dritter hier schon auf dem Siegertreppchen. Doch Siegen wird am Ende nur der Erste, also strengen Sie sich an."
    TP_TEXT_Ranking_4 "Sie befinden sich in dieser Bewertung auf dem vierten Rang."
    TP_TEXT_Ranking_5 "Herr, unsere Zivilisation ist in dieser Kategegorie gerade mal auf dem fünften Rang. Das ist sehr weit entfernt von der Spitzengruppe in dieser Kategorie !"
    TP_TEXT_Ranking_follower "Sie befinden sich nicht oder nicht mehr in den 5 besten Zivilisationen dieser Kategorie. Die derzeitig besten in dieser Kategorie, unsere Gegner schmunzeln müde über uns."
    TP_TEXT_Ranking_looser "Herr, gebt auf ! Sie befinden Sich nicht einmal unter den besten zehn Zivisationen in dieser Wertung. Schon bald könnten wir von fast allen anderen Zivilisationen einverleibt werden."


  • #2
    Yes, you can show the value of a variable in a string. Use [counter.value] for your example. Works for ints, locations (x,y,z), units (type of unit), and cities (name of city).

    Joe Rumsey - CTP Programmer

    Comment


    • #3
      Mr. Ogre,

      How could I ever think that you have not implemented such a thing from the start ? Thank you very much for your answer.


      To all others,

      I am going to make the PowerSLICs with this information a bit more sexy. However as I will be out for a workshop during the next three days, it's going to get a bit silent from my side. But there is going to be at least PowerSLICs 2.0 soon. Is there a German who can translate my German strings into English please ?


      With Regards from a happy TP

      Comment


      • #4
        I started with a demographic SLIC program as well, and will probably continue with it too. It goes along the same lines as yours but are somewhat different. And in english of course....

        Comment


        • #5
          Depp,


          Came back this evening and just couldn't wait to try showing values of user-defined variables in strings. So I tried it.

          It may seem like I am a complete idiot, however, I just can't seem to make it work. Let's have a look at what I tried as an example:

          SCRIPT.SLC:

          trigger 'TP_T_Warning_Public_Works' when (IsHumanPlayer(g.player) && (player.publicworkslevel >= 1500)) {
          pwl = player.publicworkslevel;
          Message(g.player, 'TP_M_Warning_Public_Works');
          }

          messagebox 'TP_M_Warning_Public_Works' {
          Title(ID_TP_TITLE_Warning_Public_Works);
          Text(ID_TP_TEXT_Warning_Public_Works);
          }

          INFO_STR.TXT:
          TP_TITLE_Warning_Public_Works "Public Work Status"
          TP_TEXT_Warning_Public_Works "Dumbhead, you have currently [pwl.value] units of public work available. GO AND SPEND IT !"

          It even does not work if I define just for experimental reasons pwl with a specific value, e.g pwl = 500; neither do I have success with [pwl], [pwl.1.value] or other combinations.

          I feel currently quite a bit lost here. Do you have the same issue ?


          TP

          Comment


          • #6
            Exactly the same problem. I have had that since the first night when i posted that someone should do it, I did it the same night but i couldn´t get a number, and 2 days later i read Mr Ogres responce to you and got to it imidiatly, but i felt like a complete idot, it didn't work whatever i did.

            I tried to do some more stuff to improve it but those strings (like [player.1.civ]) wouldn´t work either although i used the setplayer command to define player.1 as the active player.... wierd

            I sent a question earlier to Mr Ogre but have gotten no answer, hopes he reads this really soon.

            Hey TP, maybe we should kind unite our efforts for a while, or something. And them we can translate our various efforts for each other, since i suck at german (im swedish by the way).

            You can reach me at joanyg-6@student.luth.se or my ICQ # is 1131079

            I thought we could implement random events after this, like in civ 2.

            Even vulcanos should be possible with some nice terrain coding, and alot of other things as well. But i will install photoshop again soon and try to make some more icons for the ranking and maybe random events...

            Well, im gonna wait for Mr Ogre, but tomorrow im gonna build a cabin with me father, but maybe tonight i will code some more. I just want the ranking to be so nice so it looks like it was implemented from the beginning.

            Good night, sweden :-)

            Comment


            • #7
              What you wrote looks right. I think the problem MAY be that you need to go into userprofile.txt and switch to DebugSlic=Yes. When it's set to No, the names of variables and other symbols that aren't normally needed after parsing get tossed out to save a little bit of memory. Unfortunately, the string parsing needs those names for [*.value] to work.

              Sorry 'bout that. I haven't tested it, I'm writing this from home, and the only code I have handy is pretty old. I'll check it in the morning.
              Joe Rumsey - CTP Programmer

              Comment


              • #8
                Mr. Ogre,

                Thanks for answering (me and Depp really appreciate that you are in constant communication with us, even off-Activions days). I checked it shortly. Seems like switching to DebugSlic=Yes makes *.value possible. Depp, can you confirm ?


                Depp,

                Good idea to unite Sweden and Germany for SLIC Modification. As I will be only looking for messages for the next days, I propose that we share our latest efforts on "SLICing" on Saturday morning (via email). I'll send you my stuff and vice versa. Ok with you ?


                TP

                Comment


                • #9
                  All works great now! Thanks! Just some more questions

                  Mr Ogre:
                  Is there no SetPlayerByIndex? Just want to have all the players as they started to be able to use all their names in the demographics... (and know how many they are)

                  I noticed that player.1.gold worked but player.1.discoveries gave the number 148 (total number of advances????), when i had researched 10/70, what does it really show? is there any other variable for the amount of sciences one have discovered or must one check each and every with HasAdvance(player, advance_name)?
                  Which by the way i didn´t get to work, even this didn´t work
                  if HasAdvance(g.player, ADVANCE_AGRICULTURE) {
                  code
                  }
                  this never happend, what´s wrong? i tried changing everything...

                  And the total pop? must one sum all from the cites or? I thought since it is displayed everyturn it must be a variable...

                  More, Land. Is there a variable for the amount of land owned or?

                  Can one change the size of messageboxes or have multiple textcommandos in the same window (i have tried but failed)

                  Sorry for being such a pain in the ***, I just wanna do the best demographic i can.!

                  TP: Sure why not What is your emailadress? It´s not in your profile (mine is).
                  Im gonna continue work on the demographics since i have alot of ideas to add and stuff to make. I saw your ToDo List and maybe one should add library link when traded discovery also, i think that might be easy with the discovery.traded variable.
                  But that´s for later. Then it´s a dream of mine to make random events, like in civ 2 but more of them, and they should hit people with large empires more often, and maybe even a barbarian overtaking of one small city or something, if the capturecity function is implimented later.
                  I think someone mentioned population movements earlier in this forum, like people moving from unhappy cities to happy cities, just 1 POP at random, just so it really hurts to have unhappy people when someone has a flat 100 happiness...

                  Thanks again

                  [This message has been edited by Depp aproximatly 5 million times, sigh!]

                  [This message has been edited by Depp (edited July 21, 1999).]

                  Comment


                  • #10
                    Just bumping this topic so the questions doesn´t go unanswered

                    Comment


                    • #11
                      Nice try, Depp :-)

                      You'll get my PowerSLICs 1.5 beta code on Saturday for additional input (I'll send it directly to your email-address as I do not like to see my address printed here). I plan to make following changes:

                      - Better ranking (actually two different ranking message types)
                      - GL link within "Goody hut gives you advance" message
                      - Synchronisation fixes for warfare (so you can't guess fight results by looking at icons being displayed too early=
                      - Interface work on PW warning

                      Random events sounds absolutely great. But I think before we go into coding on this, we should try and collect some ideas on random events before (I think there is plenty of material here in the forum + on the Civ3 wishlist).

                      TP

                      Comment


                      • #12
                        TP, guessing at why you don't want your email address listed here (spammers) I can tell you that UBB is set up so that spambots can not access your email address.

                        As for random events, volcano's would be nice, possibly a slave revolt (city with the largest slave population and lowest happiness looses half it's slave population), floods (not like the eco-disaster, but a local flood of one river (see also Egypt and the Nile)that lasts a turn, costs 1 population from the city affected (if pop greater than one) and halves food and production in the tiles affected, then doubles food production for 3 turns afterwards), rivers changing course (can this and the next idea be done in SLIC?), maybe new rivers being created. And Barbarians should not just be set up at the start of the game, they should randomly occur throughout the game up to a certain point, maybe the Diamond age. Can this be done with SLIC?

                        Well, enough rambling, what do you think?
                        Any flames in this message are solely in the mind of the reader.

                        Comment


                        • #13
                          Hey, TP, thanks to you and Dom for the new script. I just have a a question and a comment. On the unused PW could you raise that to 2500? It takes about 2200 to put a Megamine in the mountains and I don't want to get nagged while I'm saving up for that, or if I have a bunch of Corporate Branches out bringing in 3000+ PW a turn.

                          Also, I'd rather #include than copy and paste your script into script.slc but I'm not sure how to do that. I'm going to go look it up, but you might want to modify your instructions to include that info.

                          One of the things I'd like to see mod makers do is standardize how the mods are done. So every mod maker would ship a custom units.txt and script.slc named (for example) TP_script.slc or CD_units.txt and unzip all custom mod files into modified directories (e.g. CD_{directory name}). This way a simple batch file can switch between mods quickly and easily. Original data never gets overwritten, etc. Hopefully, this will be address in the next patch. Mr. Ogre said that the scenarios will be, but I don't know about the mods.

                          Me personally, I want to write a scenario that is just about the Roman, Greek, Assyrian, etc, empires and takes place around the Mediteranean Sea. Obviously I don't want to overwrite CD's mod, or Harlans, or your's when I do this....

                          Well, just some food for thought, thanks for reading.

                          Big Dave
                          Any flames in this message are solely in the mind of the reader.

                          Comment


                          • #14
                            Why not raise the PW barrier every 100 turns or so?

                            Or maybe ask every 50th year if you wanna double it or something....

                            Comment


                            • #15
                              Big Dave / Depp,


                              After you have dowloaded my MOD (should be soon available on Apolyton), go into the "INSERT IN SCRIPT.SLC" file and look for the string

                              trigger 'TP_T_Warning_Public_Works' when (IsHumanPlayer(g.player) && (player.publicworkslevel >= 1500)) {

                              Just change the 1500 to whatever you want and it should work. For the next version of my PowerSLICs, I will implement something which will increase the "nagging level" with increased availability of expensive terrain improvement. I think such a feature would deliver against what you have requested.

                              #Including is not very difficult, however with my MOD you are forced to make changes to three text files (scripc.slc, info_str.txt and messageicon.txt). Only on the first one you can work with #including. So make backups of those files if you would like to restore them later. I think that should be manageable :-)


                              TP

                              Comment

                              Working...
                              X