Announcement

Collapse
No announcement yet.

Mr. Ogre: My "bombarding units spotted" SLIC works, but only partly. Can you help ?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mr. Ogre: My "bombarding units spotted" SLIC works, but only partly. Can you help ?

    Dear Mr. Ogre,
    Dear fellow SLIC programmers,


    I have tried to establish a warning system which gives the human player a short message as soon
    as one of the human units has spotted enemy units being able to bombard. Fortunately, it works,
    unfortunately only in one direction:

    Below SLIC script will only trigger the warning if a human unit spots such an enemy while MOVING,
    unfortunately it will not trigger the warning if such an enemy unit just happens to move out of
    the fog of war into tiles which are visible to human units or cities.

    Can one of you help me there ? I would like to use the full working script as a kind of workaround for the bug that enemy bombarding is not autocentering properly.


    Thanks for looking at this,
    TP


    SCRIPT.SLC

    //
    // Warning in case units with bombarding abilities are spotted (see info-str.txt for strings)
    //

    trigger 'TP_T_Warning_Bombarding' when (player.sightedunit && IsBombardingUnit(unit) && unit.owner != 1) {
    Message(g.player, 'TP_M_Warning_Bombarding');
    }

    messagebox 'TP_M_Warning_Bombarding' {
    Title(ID_TP_TITLE_Warning_Bombarding);
    Text(ID_TP_TEXT_Warning_Bombarding);
    }

    INFO-STR.TXT

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

    TP_TITLE_Warning_Bombarding "[unit.name] sighted !"
    TP_TEXT_Warning_Bombarding "Beware: One of our units, a [unit.2.name] has spotted a [unit.name] which is able to bombard."

  • #2
    TP,
    The problem is the message recipient. g.player is the player who is currently moving. In this case, you actually want to send the message to unit.2.owner - the player who sighted unit.1. You should also remove the check for unit.owner != 1. It doesn't hurt to send messages to AI players, and assuming player 1 is the only human player (or even human at all) isn't valid for any sort of multiplayer game.

    Try this for the trigger:

    trigger 'TP_T_Warning_Bombarding' when (player.sightedunit && IsBombardingUnit(unit)) {
    Message(unit.2.owner, 'TP_M_Warning_Bombarding');
    }

    (The Edit on this message is because I'm an idiot, I hope no one saw the first version :-)

    ------------------
    Joe Rumsey - CTP Programmer



    [This message has been edited by Mr Ogre (edited July 16, 1999).]
    Joe Rumsey - CTP Programmer

    Comment


    • #3
      Mr. Ogre,

      Thank you very much for your fast and valid answer ! Now everything works just fine.

      I am going to post in a few minutes a small SLIC MOD (calling it PowerSLICs) where I include an advanced version of this code here. Hopefully some other players out there find this SLIC package attractive.

      Again many thanks for the answer,
      TP

      Comment


      • #4
        Hi TP,

        This slic mod of yours looks very good. I, unfortunately, have no talent in programming of any sort, but I can use things that other people come up with. Is it possible for you or someone else to create an English version of your mod so that us illiterate Americans who only speak one language can use it? :-)

        Timothy Pintello

        Comment


        • #5
          I am also illerate to the languages of computers, besides macro language in civ2. Is there an easier way or can you help me with the language? I am willing to learn if someone would show me how.

          Comment


          • #6
            As I wrote in my MOD, I will not localize my MOD into other languages. If I start this now, I would be asked each time I update or include new code. I just don't have the ressources. Maybe another German guy who reads this but is not good in SLIC can do the translation otherwise go to altavista.com and get some rough translations.

            TP

            Comment


            • #7
              I am sorry for not explaining what I meant. I'm an American who does not know that much about Computer Code which I call languages. Sorry.

              Comment


              • #8
                Ah, I understand. Ok, so please look in the "INFO_STR.TXT" part of my MOD. As soon as you see clear German text within " ", you should translate that. All of the remaining stuff you should not change at all, including everything which is within [ ].

                No worries, you can not break anything as long as you strictly only translate German text in the "INFO_STR.TXT" part within " ".

                Hope this helps,
                TP

                Comment


                • #9
                  I am going to close this thread. Please write all comments in the PowerSLICs 1.2 thread.

                  TP

                  Comment


                  • #10
                    Upps I forgot only moderators can close threads.

                    Dan, Markos,

                    Can you please close this thread and the "PowerSLICs 1.1" thread ? This way comments to my MOD will have to go (hopefully) to the "PowerSLICS 1.2" thread.


                    Going to be back in a few days,
                    TP

                    Comment


                    • #11
                      Upps I forgot only moderators can close threads.

                      Dan, Markos,

                      Can you please close this thread and the "PowerSLICs 1.1" thread ? This way comments to my MOD will have to go (hopefully) to the "PowerSLICS 1.2" thread.


                      Going to be back in a few days,
                      TP

                      Comment

                      Working...
                      X