Announcement

Collapse
No announcement yet.

SLIC variable section

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

  • SLIC variable section

    Does anybody know how I can make use of some of the SLIC builtin variables which don't appear in the Activision documentation, but do appear in the game's text files?

    For example the info_str.txt file contains
    "The [player.1.civ_name_plural] have been utterly defeated."

    If I borrow this idea and put the following in one of my txt files:
    PN_TEXT_Big_Ranking_All "WEIGHTED RANKING (Year [date.value]):\n[finalrank1.value]. [player.1.civ_name_plural], [score1.value]"

    and use it as a parameter to an alert box then this appears:

    WEIGHTED RANKING (Year [date.value]):
    [finalrank1.value]. [player.1.civ_name_plural], [score1.value]

    but if I change the definition to remove the variable [player.1.civ_name_plural] and replace it with some fixed text so that it is defined instead as:
    PN_TEXT_Big_Ranking_All "WEIGHTED RANKING (Year [date.value]):\n[finalrank1.value]. This is annoying, [score1.value]"

    then my alert box contains:

    WEIGHTED RANKING (Year 0):
    3. This is annoying, 1601

    So including [player.1.civ_name_plural] stops all the other variables from being translated properly.

    (BTW I do have DEBUGSLICS=YES)


  • #2
    Yes, I've run into that kind of problem as well. But I have come to the conclusion that if you are going to use [player.1.civ_name_plural] in a message you also must use a player in context in your trigger. So for example if you have a trigger that fires when there is combat between two players then [player.1.civ_name_plural] would work in your message. But if you have a trigger that collects data that doesn't use a player in context than [player.1.civ_name_plural] won't work in a message. You might want to try using the setplayer function in your trigger and see if you have different results. Hope this helps and if anyone else knows for sure please post!

    Also can someone from apolyton please fix my profile, it says I'm a settler or something and I had way more posts before you had your server problems that erased my profile.

    ------------------

    [This message has been edited by gemini (edited March 21, 2001).]

    Comment


    • #3
      Gemini is right, you'll have to define player.1 first in some way. I haven't looked at CtP1 SLIC since August or so but something like player.1 = 1 in the SLIC code that calls the message might do the trick, presuming you'd want player 1 (the human player) to be the one of which the score is displayed.

      Gemini,
      I think you'll have to email Markos for that, I don't think any of the mods are reading this forum anymore...
      Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

      Comment


      • #4
        My trigger doesn't use player in the context, I'll give it a try. What I really want to do is display a "league table" in an alert box that shows all the civilization names, not just player.1 Do u think that this will be possible if I get the player context as my trigger?

        Comment


        • #5
          If you don't have a player in your context, try g.player in your text.
          This should always be available.

          Edit: You could also try the SetPlayer function, but strangely enough I don't see a variable that gives the number of players ?
          (g.totalplayers, like player.totalunits)
          [This message has been edited by Maestro (edited March 25, 2001).]
          veni vidi PWNED!

          Comment


          • #6
            PN,
            Several players are easy: player.1 = 1; player.2 = 2, player.3 = 3, etc. player.x is available for as many players as you need. Also, it's probably a good idea to figure out how Maestro's suggestion of SetPlayer works. As I said, I'm not used to SLIC1 syntax anymore so it's quite possible you can't just say player.x = x in CtP1. There should be a couple of examples in the MedMod I SLIC code and some of the other SLIC mods people made.
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #7
              Thanks Locutus and Maestro. I'm using this type of construct for cycling through the players:

              nump=Preference("NumPlayers")-1;
              pnum=1;
              while (pnum <= nump) {
              SetPlayer(1,pnum);
              ....Player.1 will now allow me to get data for player.
              if (pnum==1) score1=...
              else if (pnum==2) score2=..
              etc.
              }

              I nicked this from Powerslics. g.player is not affected by this and remains the current player. Maestro, note that the Preferences call returns the number of players (inc. Barbarians)

              The code is triggered by 'when (IsHumanPlayer(g.player))' so the Alert Box with the scores appears right at the beginning of each player's turn. Can either of you suggest a different trigger that gives me the player context and lets me use [player.1.civ_name_plural]?

              Comment

              Working...
              X