Announcement

Collapse
No announcement yet.

Unit.name vs. unit.type

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

  • Unit.name vs. unit.type

    What is the difference between the unit.type and the unit.name? Unit.type I understand it's UNIT_WARRIOR, UNIT_ARCHER, etc., but what is unit.name? Warrior Ebert? Bill the Archer? Does every unit have a unique name? If so, what form is the name, alpha or numeric, i.e. "unit Jimmy-Jo-jo" or "unit 56718"


  • #2
    I don't think I ever actually bothered to test this but I'm pretty sure unit.type returns UNIT_WARRIOR (or 70, rather, which is the index of UNIT_WARRIOR in units.txt) whereas unit.name returns "Warrior".
    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

    Comment


    • #3
      Originally posted by Locutus
      I don't think I ever actually bothered to test this but I'm pretty sure unit.type returns UNIT_WARRIOR (or 70, rather, which is the index of UNIT_WARRIOR in units.txt) whereas unit.name returns "Warrior".
      So the name is not unique? That's too bad.

      Where's my lemur poo? I need to shake some work arounds.

      Comment


      • #4
        Nope, it's defined in gl_str.txt. You can give armies (including armies consisting of 1 unit) unique names, but not units (and you can't retrieve these unique names with SLIC).
        Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

        Comment


        • #5
          Originally posted by Locutus
          Nope, it's defined in gl_str.txt. You can give armies (including armies consisting of 1 unit) unique names, but not units (and you can't retrieve these unique names with SLIC).
          Hey, that may just be what I am looking for!

          How do you name single unit armies?

          How do you access the armies name with SLIC? All I see under army is owner, location, size?

          Can you automatically assign a single unit to an army and give the army a unique name with SLIC?

          Thanks

          Comment


          • #6
            You can set the name in-game with the army manager (press '.', or right-click, select army manager). But like I said, it's not possible to access the name in SLIC.
            Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

            Comment


            • #7
              Originally posted by Locutus
              You can set the name in-game with the army manager (press '.', or right-click, select army manager). But like I said, it's not possible to access the name in SLIC.
              Oops, read too fast. Didn't see the apostrophe "t".

              Comment


              • #8
                unit.type returns the index number, not a string - the other one? never used it...

                Comment


                • #9
                  unit.name if I am right is used in strings .

                  So you can make a massage box saying

                  Are warrior is dead

                  as apposed to

                  Are unit_warrior is dead

                  as for the rest i thinck Locutus has delt with it.
                  "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


                  • #10
                    Originally posted by The Big Mc
                    Are unit_warrior is dead
                    Actually, that would become 'A(re?) 70 is dead', but aside from that, you're right.
                    Administrator of WePlayCiv -- Civ5 Info Centre | Forum | Gallery

                    Comment


                    • #11
                      There has always got to be something.

                      The big mc every time he does \ says anything wrong.

                      Besides is there a good guide to making strings. I don't thick there is just some rubbish one cobbled together in the slic stuff on apolyton.
                      "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