Announcement

Collapse
No announcement yet.

[C4:AC][Programming] Reference for internal XML tags.

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

  • [C4:AC][Programming] Reference for internal XML tags.

    The purpose of this thread is to put the XML tags used for internal reference "in stone". This will hopefully make it easier to co-ordinate and merge work, by keeping things consistent. It is part of both design and documentation of the mod.

    Since I'm doing work on Factions and Traits I'll post sensible tag names for them, conforming to how Civ4 does it. The ordering used is the same as in SMAC.

    The existence of a tag doesn't mean it actually has to be implemented (ie the Aliens...), think of as placeholders.

    The ordering (and hence the number) is somewhat important for use in Python, since the number is what the game ends up using internally.

    Factions (civs):
    Code:
    FACTION_GAIANS			0
    FACTION_HIVE			1
    FACTION_UNIVERSITY		2
    FACTION_MORGANITES		3
    FACTION_SPARTANS		4
    FACTION_BELIEVERS		5
    FACTION_PEACEKEEPERS		6
    
    FACTION_CYBORGS			7 
    FACTION_PIRATES			8
    FACTION_DRONES			9
    FACTION_ANGELS			10
    FACTION_CULT			11 
    FACTION_CARETAKERS		12
    FACTION_USURPERS		13
    
    FACTION_NATIVE			14
    Faction Leaderheads
    Code:
    LEADER_NATIVE			0
    
    LEADER_DEIRDRE			1
    LEADER_YANG			2
    LEADER_ZAKHAROV			3
    LEADER_MORGAN			4
    LEADER_SANTIAGO			5
    LEADER_MIRIAM			6
    LEADER_LAL			7
    
    LEADER_AKI_ZETA_5		8
    LEADER_SVENSGAARD		9
    LEADER_DOMAI			10
    LEADER_ROZE			11
    LEADER_CHA_DAWN			12
    LEADER_HMINEE			13
    LEADER_MARR			14

    Faction Traits:
    Code:
    TRAIT_GAIANS			0
    TRAIT_HIVE			1
    TRAIT_UNIVERSITY		2
    TRAIT_MORGANITES		3
    TRAIT_SPARTANS			4
    TRAIT_BELIEVERS			5
    TRAIT_PEACEKEEPERS		6
    
    TRAIT_CYBORGS			7 
    TRAIT_PIRATES			8
    TRAIT_DRONES			9
    TRAIT_ANGELS			10
    TRAIT_CULT			11 
    TRAIT_CARETAKERS		12
    TRAIT_USURPERS			13
    
    TRAIT_LUDDITE			14
    TRAIT_GREEN			15
    TRAIT_ALIEN			16
    TRAIT_AQUATIC			17
    TRAIT_RESERVED1			18
    TRAIT_RESERVED2			19
    TRAIT_RESERVED3			20
    TRAIT_RESERVED4			21
    TRAIT_RESERVED5			22
    TRAIT_RESERVED6			23

    Basically, post tag names for work you have done or are doing. No need to make complete lists.
    Last edited by Blake; November 23, 2005, 18:44.

  • #2
    Good idea Blake
    SMAC/X FAQ | Chiron Archives
    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. --G.B.Shaw

    Comment


    • #3
      It is possible (and better) to write python without relying on the exact ordering.

      This is the code I use in the initialization of the crawler mod to find the UnitClass for crawlers:
      Code:
      for i in range(gc.getNumUnitClassInfos()):
      	if gc.getUnitClassInfo(i).getType() == "UNITCLASS_CRAWLER":
      		self.iUnitClassHarvester = i
      It make the python code much less dependant on the exact XML. It will solve issues that might arrise from Firaxis-patches, un-compatible versions of the mod, somebody modding c4:ac with his own ideas, ...


      Having said this however, it is a very good thing to list the exact tags you'll use here.

      unitclass:
      UNITCLASS_CRAWLER

      units:
      UNIT_LAND_CRAWLER

      txt:
      TXT_KEY_UNIT_CRAWLER
      TXT_KEY_UNIT_CRAWLER_PEDIA
      TXT_KEY_UNIT_CRAWLER_STRATEGY


      For the TECH_ keys, I'll use whatever comes from the various tech-tree efforts here.
      no sig

      Comment


      • #4
        If you want FACTION, LEADER, and TRAIT keys, make them uniform across factions. As is, FACTION_GAIANS == 0 and TRAIT_GAIANS == 0, but LEADER_DEE == 1. That's asking for a heap of trouble. I say, add FACTION_NATIVE and TRAIT_NATIVE and set those to 0.
        "Cutlery confused Stalin"
        -BBC news

        Comment


        • #5
          I'm not sure I understand correctly, but if this, in any way, directly affects the tags used in the xml code then I'd better post my comments.

          I've used CIVILIZATION_PEACEKEEPERS for the faction and LEADER_PRAVIN_LAL for the leader. I think using FACTION_PEACEKEEPERS and LEADER_LAL is good and I can change the tags I've already done. However, I would strongly prefer LEADER_DEIRDRE instead of LEADER_DEE! The same applies to ZAKHAROV and SVENSGAARD.

          Throughout the technology tree, I've used TECH_*NAME* (i.e. TECH_NONLINEAR_MATHEMATICS; TECH_SECRETS_OF_THE_HUMAN_BRAIN; TECH_PHOTON/WAVE_MECHANICS; TECH_PRE-SENTIENT_ALGORITHMS; TECH_NANOMINIATURISATION; etc.). This cannot be applied to the "Doctrine" technologies, because the code won't accept a colon. I simply used TECH_DOCTRINE_MOBILITY, etc. without the colon. (If we can figure out how to use the colon, I would probably prefer using that.)

          ---

          Other conventions used:

          I did not change the names of the technology audio quotes. They are all still tech1; tech2, tech12, etc. This should prevent any renaming, but may be less recognizeable for the "modder".

          The technology icon names I've used are a mix of the technology names and the original names (corresponding to the audio quotes):

          TECH00_Biogenetics.dds
          TECH13_High_Energy_Chemistry.dds
          TECH43_Doctrine_Loyalty.dds
          TECH78_Progenitor_Psych.dds
          ..., etc.

          ---

          An idea for units: If we need predefined units differing from the predefined SMACX ones (i.e. "Scout Patrol") we could adopt some kind of naming convention *WEAPON*_*ARMOR*_*MOVEMENT*_*ABIL1*_*ABIL2*_*REACT OR*... or something like that (perhaps "Scout Patrol" translates to 1_1_1_0_0_1, perhaps something like FORMER_1_2_SUPER_CLEAN_2 for the "fusion rover clean super former"; "Supply Crawler" could be SUPPLY_1_1_0_0_1 or SUP_1_1_0_0_FIS). As long as the naming convention is consistent and not too obscure.

          Comment


          • #6
            Originally posted by Chaos Theory
            If you want FACTION, LEADER, and TRAIT keys, make them uniform across factions. As is, FACTION_GAIANS == 0 and TRAIT_GAIANS == 0, but LEADER_DEE == 1. That's asking for a heap of trouble. I say, add FACTION_NATIVE and TRAIT_NATIVE and set those to 0.
            Sadly there is always method to my madness.

            In Civ4 the Barbarian leader is #0, but the barbarian faction seems to be the last one in the game. I'm just being consistent because I'm sure barb leader is in the first place for a reason. There is also no Barb traits, the barb civilization is in the last spot in the file.
            edit: I don't see why there couldn't be barb traits were it desirable though. We'll have to use the trait system in a bit of a weird way. Maybe this will be reviewed come SDK.
            Last edited by Blake; November 23, 2005, 18:47.

            Comment


            • #7
              I've used CIVILIZATION_PEACEKEEPERS for the faction and LEADER_PRAVIN_LAL for the leader. I think using FACTION_PEACEKEEPERS and LEADER_LAL is good and I can change the tags I've already done. However, I would strongly prefer LEADER_DEIRDRE instead of LEADER_DEE! The same applies to ZAKHAROV and SVENSGAARD.
              Very well, I'll change it. I prefer memorizable names but you're probably right.

              I don't support "coded names" for units, really, I think
              UNIT_IMPACT_ROVER
              and things like that would be fine. Since we'll be using promotion system (for the forseeable future anyway) it doesn't really make sense to attach the abilities to the unit itself.

              Okay, for units lets say:
              Weapon, Armor, Chassis:
              UNIT_GATLING_PLASMA_INFANTRY
              If weapon or armor are 1 they can be ommited.
              UNIT_PLASMA_INFANTRY
              Last edited by Blake; November 23, 2005, 19:03.

              Comment


              • #8
                ok, so I'd change the crawler to:

                UNIT_CRAWLER_INFANTRY
                UNIT_CRAWLER_ROVER
                UNIT_CRAWLER_FOIL
                UNIT_CRAWLER_CRUISER
                ...


                It's indeed a good idea. I'm not sure if I should have 1 UNITCLASS for all of them or not. Somebody knows what UNITCLASS is used for exactly ? Is it for upgrading purposes or just for grouping the UU's with the unit they replace ? something else ?
                no sig

                Comment


                • #9
                  PJayTycy, wouldn't your units be:

                  UNIT_SUPPLY_INFANTRY
                  UNIT_SUPPLY_ROVER
                  UNIT_SUPPLY_FOIL
                  UNIT_SUPPLY_CRUISER
                  ...?

                  I think you should make a UNITCLASS for each of them. Perhaps it will turn out useful later. (If you want, I could do some icon graphics and sounds to go with your new units.)

                  Comment

                  Working...
                  X