Announcement

Collapse
No announcement yet.

Step By Step Guide To Add A Unit?

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

  • #16
    When you get a whole string of error messages, it can mean you have a bracket-type problem, or that something is messed up with the line immediately preceeding the ones which show up on the error message.

    In this instance, that would be the UNIT_CATEGORY line. This line must refer to a valid category as listed in the ldl.str, btw.

    Comment


    • #17
      I can be a little more specific, using the problems I had adding a new government - they seem to be similar problems too.

      Here is the govern.txt I added for a new government 'Caliphate' I did not fiddle with the numbers, as I wanted to see if I could get the government into the game first.

      This was added at the end of the govern.txt file


      ################################################## ##########

      GOVERNMENT_CALIPHATE {
      Icon ICON_GOV_MONARCHY
      EnableAdvance ADVANCE_CALIPHATE
      Rank 2
      SameRankAdvice GOVERNMENT_MONARCHY_SAME_RANK_ADVICE
      HigherRankAdvice GOVERNMENT_MONARCHY_HIGHER_RANK_ADVICE
      RationsExpectation 0
      PositiveRationsCoef 1
      NegativeRationsCoef 1
      WorkdayExpectation 0
      PositiveWorkdayCoef 1
      NegativeWorkdayCoef 1
      WagesExpectation 0
      PositiveWagesCoef 1
      NegativeWagesCoef 1
      FoodCoef 1
      ProductionCoef 1.3
      InfrastructureCoefficient 0.5
      CrimeCoef 0.75
      CrimeOffset 95
      KnowledgeCoef 1.25
      MaxScienceRate 0.6
      GoldCoef 1
      CapitalizationCoefficient 0.5
      UnitRushModifier 5
      BuildingRushModifier 4
      WonderRushModifier 7
      EndGameRushModifier 7
      MaxIncomingTrade 100000
      MaxOutgoingTrade 100000
      PollutionCoef 1.15
      PollutionUnhappyCoef 0.02
      SupportCoef 0.75
      TurnsToNewReadiness 7
      ReadyPeaceCoef 0.5
      ReadyPeaceHP 0.5
      ReadyAlertCoef 0.75
      ReadyAlertHP 0.8
      ReadyWarCoef 1
      ReadyWarHP 1
      DefenseCoef 1.5
      WarDiscontentMaxUnits 15
      WarDiscontentPerUnit 0.5
      ConquestDistress -5
      ConquestDistressDecay 0.2
      OverseasCoef 0
      OverseasDefeatDecay 0
      OverseasDefeatCoef 1
      HomeDefeatDecay 0.5
      HomeDefeatCoef 1
      MaxMartialLawUnits 2
      MartialLawEffect 2
      MartialLawThreshold 80
      AtHomeRadius 2
      EmpireDistanceScale 0.001
      MinEmpireDistance 500
      MaxEmpireDistance 2000
      TooManyCitiesThreshold 35
      TooManyCitiesCoefficient 1
      ProfessionalUnits 0
      GrowthRank 2
      ProductionRank 4
      CommerceRank 2
      ScienceRank 2
      GoldRank 2
      MilitaryRank 5
      PollutionRank 2
      LoyaltyRank 5
      MartialLawRank 3
      }

      ################################################## ##########

      I also went through and edited all the other files that have been instructed to edit in earlier posts.

      When all the files are added to the scenario directory I created, I tried to launch the game, and get the error messages, starting with the following

      govern.txt 371 expected string ID

      followed by the following box(es)

      govern.txt 371 warning: required field positive workday Coef missing

      and so forth.

      None of the earlier posts for adding and editing governments/units have mentioned making changes in the ldl.str file. What exactly needs to be edited/added in that file - in relation to additions to governments and further down the line, new units?

      This makes me appreciate what you do even more..but I want to be able to do some of this myself too.
      Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
      ...aisdhieort...dticcok...

      Comment


      • #18
        As far as I know the number in the error message should be the line number for the error. Line 371 in govern.txt is in the fascism entry, so maybe you accidentally deleted/changed something there?

        Comment


        • #19
          The problem is about 90% fixed. What I did was basically start over with a clean govern.txt file. I cannot remember if anything critical got changed in Fascism, but I did tinker with that file earlier because I wanted to move it into the Modern Age. I cut and pasted the entry for Monarchy and re-entered the fields that I wanted to change for the 'Caliphate' government.

          I believe that the second, fifth and sixth line in the below sequence needs to remain unchanged from your template, as changing the entries from MONARCHY to CALIPHATE will cause crashs, and those lines need to be able to link up with other entries. If this is wrong, feel free to correct me on this. (I am sure of the second line, at least, as I do not have an icon for Caliphate)

          GOVERNMENT_CALIPHATE {
          Icon ICON_GOV_MONARCHY
          EnableAdvance ADVANCE_CALIPHATE
          Rank 2
          SameRankAdvice GOVERNMENT_MONARCHY_SAME_RANK_ADVICE
          HigherRankAdvice GOVERNMENT_MONARCHY_HIGHER_RANK_ADVICE

          BTW, what do the following lines signify?
          SameRankAdvice GOVERNMENT_MONARCHY_SAME_RANK_ADVICE
          HigherRankAdvice GOVERNMENT_MONARCHY_HIGHER_RANK_ADVICE

          I made my changes to Fascism too.

          The game launched without crashing.

          Now for the other 10%. I made changes in the Great Library file too, but what I get in the entries is a entry for 'Caliphate with a combination of information for 'Caliphate' and 'Monarchy' For example, I had written a history file for Caliphate, but it is not showing up - rather the history for Monarchy is there instead. Is there a line of text that will link up the Monarchy history instead of the Caliphate history.

          And now, what I am curious about are the ranking numbers that are at the end of each government entry in the govern.txt file.

          GrowthRank 2
          ProductionRank 4
          CommerceRank 2
          ScienceRank 2
          GoldRank 2
          MilitaryRank 5
          PollutionRank 2
          LoyaltyRank 5
          MartialLawRank 3

          Exactly what do these numbers do, and how do they work. I'm assuming they are the rating system that is used to compare different governments. Do these need to be changed too?

          I know this is somewhat off-topic to this thread about adding a unit, but the issues are related in the sense that in the .txt files, there may be lines of text that need to be left alone. So far, the instructions have been pretty straightforward, but if there are lines that need to be left alone, I hope it will be spelled out in the info provided.

          I also have a starting point to now go into the unit.txt files and see where the problem is at there for my add-on unit. Are there any entries within those files that need to be left alone? Or are there any entries that require an unusual alteration?

          Again, thanks for the help! It's relatively easy to make an alteration by changing a few numbers, but I am finding that adding a new unit/government/advance is a whole new ballgame.
          Yes, let's be optimistic until we have reason to be otherwise...No, let's be pessimistic until we are forced to do otherwise...Maybe, let's be balanced until we are convinced to do otherwise. -- DrSpike, Skanky Burns, Shogun Gunner
          ...aisdhieort...dticcok...

          Comment


          • #20
            To get your caliphate great library entries you must change ICON_GOV_MONARCHY to ICON_GOV_CALIPHATE and also add that to uniticon.txt (use one of the existing entries as a template).

            The rank numbers are used for the government comparison. You should change those numbers if you want to get accurate comparisons to other governments.

            The biggest problem with adding whole new units/governments/advances is that you don't have to just change units.txt, govern.txt or advance.txt but usually also several other files, especially if you also want great library entries for your added stuff.

            Comment

            Working...
            X