Announcement

Collapse
No announcement yet.

How to rename attitude: from "cautious" to "neutral?"

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

  • How to rename attitude: from "cautious" to "neutral?"

    What is the best way to universally rename a leader attitude? I'm trying to change "cautious" to "neutral." I did a find-and-replace through all the .xml files, but still didn't catch them all. What's a simple way to do it? Going through and changing it in 100+ places isn't a good method, even done automatically. I'm inexperienced with XML, but it seems that the word "cautious" is coded into the string which stands for that middle "attitude level." To try to chage it is tough. I'd expect the attitude levels themselves to be generic, perhaps numbered one through five.

    How can I change the number of attitude levels to two, or seven?

  • #2
    stump

    This one must be a toughie!

    Comment


    • #3
      I'd expect the attitude levels themselves to be generic, perhaps numbered one through five.
      Indeed, they're defined as an enumerated type in CvEnums.h. These are just labels for numbers: NO_ATTITUDE is set to be -1 and then the remainder of the sequence is assigned the consecutively
      following numbers (ATTITUDE_FURIOUS = 0, ATTITUDE_ANNOYED = 1, etc.)

      Code:
       enum DllExport AttitudeTypes	// Exposed to Python 
      {
      	NO_ATTITUDE = -1,
      
      	ATTITUDE_FURIOUS,
      	ATTITUDE_ANNOYED,
      	ATTITUDE_CAUTIOUS,
      	ATTITUDE_PLEASED,
      	ATTITUDE_FRIENDLY,
      
      	NUM_ATTITUDE_TYPES
      };
      How can I change the number of attitude levels to two, or seven?
      Unless you're a natural born programming god, I wouldn't try. The above enum is used throughout the AI code. For example, the following method is used to determine if an AI team should start a war with another team:

      Code:
       int CvTeamAI::AI_startWarVal(TeamTypes eTeam)
      {
      	PROFILE_FUNC();
      
      	int iValue;
      
      	iValue = (AI_calculateAdjacentLandPlots(eTeam) * 4);
      
      	iValue += AI_calculateCapitalProximity(eTeam);
      
      	switch (AI_getAttitude(eTeam))
      	{
      	case ATTITUDE_FURIOUS:
      		iValue *= 5;
      		break;
      
      	case ATTITUDE_ANNOYED:
      		iValue *= 4;
      		break;
      
      	case ATTITUDE_CAUTIOUS:
      		iValue *= 3;
      		break;
      
      	case ATTITUDE_PLEASED:
      		iValue *= 2;
      		break;
      
      	case ATTITUDE_FRIENDLY:
      		iValue *= 1;
      		break;
      
      	default:
      		FAssert(false);
      		break;
      	}
      
      	return iValue;
      }
      In order to change the number of AttitudeTypes you'd have to go through the whole source code and rewrite tons of stuff.

      I did a find-and-replace through all the .xml files, but still didn't catch them all.
      The crucial one is in Civ4GameTextInfos.xml:

      Code:
      < TEXT>
      	< Tag>TXT_KEY_ATTITUDE_CAUTIOUS< /Tag>
      	< English>Cautious< /English>
      	< French>Se méfie< /French>
      	< German>Vorsichtig< /German>
      	< Italian>Cauto:Cauta< /Italian>
      	< Spanish>Cauta< /Spanish>
      < /TEXT>
      If you've changed "< English>Cautious< /English>" to "< English>Neutral< /English>", that *should* catch the main occurences of the word. Where else is it popping up?

      Comment


      • #4
        Thanks very much for your detailed explanation. I'm going to give it another look and I'll tell you how it works out.

        Comment


        • #5
          adding

          Changing the number of attitude levels isn't important to me, so I'm not going to try that.

          My main goal is to change the names of various status levels to more intuitive words. For example "friendly, pleased, cautious, annoyed, furious" to "happiest, happy, neutral, angry, angriest." I want to change the culture levels as well, for example from "poor, fledgling, etc." to "low, medium, etc." Those level names should be more directly indicative, and less arbitrary.

          My next goal is to clean up the in-game text. The writers at Firaxis have some weak habits, such as overuse of the passive voice, and sometimes affecting a "breezy manner."

          Comment


          • #6
            place

            The main occurance that I've been unable to change is in the title bar above the leader's picture, where the attitude is listed in parenthesis after the leader's name and nation. I can't find it.

            Comment

            Working...
            X