Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-09-22 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
September 21, 2012, 10:34:36 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [How To] Add translation in custom race  (Read 728 times)
rostex
Newbie
*
Posts: 8


View Profile Email
« on: March 09, 2011, 01:58:00 PM »

First of all you need to download race in .sp format.
So, then open .sp file in notepad.

Add this line in public OnPluginStart()
Code:
LoadTranslations("w3s.race.<shortname>.phrases");

<shortname> - short name of race. For example paladin => w3s.race.paladin.phrases

Then you need to edit some description in public OnWar3LoadRaceOrItemOrdered2()
Example code without translation
Code:
thisRaceID=War3_CreateNewRace("Full_race_name","Short_race_name");
SKILL_DEFENSIVE=War3_AddRaceSkill(thisRaceID,"Name_of_Skill1","Description_of_Skill1",false,4);
SKILL_OFFENSIVE=War3_AddRaceSkill(thisRaceID,"Name_of_Skill2","Description_of_Skill2",false,4);
SKILL_HEALING=War3_AddRaceSkill(thisRaceID,"Name_of_Skill3","Description_of_Skill3",false,4);
ULT_OVERDRIVE=War3_AddRaceSkill(thisRaceID,"Name_of_Skill4","Description_of_Skill4",true,4);
War3_CreateRaceEnd(thisRaceID);

It should look like that
Code:
thisRaceID=War3_CreateNewRaceT("paladin");
SKILL_DEFENSIVE=War3_AddRaceSkillT(thisRaceID,"Name_of_Skill1",false,4);
SKILL_OFFENSIVE=War3_AddRaceSkillT(thisRaceID,"Name_of_Skill2",false,4);
SKILL_HEALING=War3_AddRaceSkillT(thisRaceID,"Name_of_Skill3",false,4);
ULT_OVERDRIVE=War3_AddRaceSkillT(thisRaceID,"Name_of_Skill4",true,4);
War3_CreateRaceEnd(thisRaceID);

Pay attention on T after War3_AddRaceSkill. Only with this code translation would be work correctly.
Yes, you need to remove "Description_of_Skill". We add description later. "Name_of_Skill" should be without space.
Save file...

Ok, now creat a txt file and we add translation.
Example of translation:
Code:
"Phrases"
{
//<shortname>_RaceName
"<shortname>_RaceName"
{
"en" "Full_race_name"
}

//skills:
//<shortname>_skill_<SkillNameIdentifier> for the skill name
//<shortname>_skill_<SkillNameIdentifier>_desc for the skill description
"<shortname>_skill_<SkillNameIdentifier>"
{
"en" "Name of Skill1"
}
"<shortname>_skill_<SkillNameIdentifier>_desc"
{
"en" "Description of Skill4"
}

"<shortname>_skill_<SkillNameIdentifier>"
{
"en" "Name of Skill1"
}
"<shortname>_skill_<SkillNameIdentifier>_desc"
{
"en" "Description of Skill4"
}

"<shortname>_skill_<SkillNameIdentifier>"
{
"en" "Name of Skill1"
}
"<shortname>_skill_<SkillNameIdentifier>_desc"
{
"en" "Description of Skill4"
}

"<shortname>_skill_<SkillNameIdentifier>"
{
"en" "Name of Skill1"
}
"<shortname>_skill_<SkillNameIdentifier>_desc"
{
"en" "Description of Skill4"
}

}

This code have same hints but im repeat that

"<shortname>_RaceName" - it easy... example: "paladin_RaceName"
"<shortname>_skill_<SkillNameIdentifier>" - for the skill name. Example: "paladin_skill_DefensiveAura"
"<shortname>_skill_<SkillNameIdentifier>_desc" - for the skill description. Example: "paladin_skill_DefensiveAura_desc"

If you want to add another language you need edit "en" to your language (for example "ru") and translate description.

How it looks...
Code:
"Phrases"
{
//<shortname>_RaceName
"paladin_RaceName"
{
"en" "Paladin"
}

//skills:
//<shortname>_skill_<SkillNameIdentifier> for the skill name
//<shortname>_skill_<SkillNameIdentifier>_desc for the skill description
"paladin_skill_DefensiveAura"
{
"en" "Defensive Aura"
}
"paladin_skill_DefensiveAura_desc"
{
"en" "Give your teammates extra armor. You receive half of the benefits."
}

"paladin_skill_OffensiveAura"
{
"en" "Offensive Aura"
}
"paladin_skill_OffensiveAura_desc"
{
"en" "Give your teammates extra damage. You receive half of the benefits."
}

"paladin_skill_HealingAura"
{
"en" "Healing Aura"
}
"paladin_skill_HealingAura_desc"
{
"en" "Give your teammates passive regeneration. You receive half of the benefits."
}

"paladin_skill_AuraOverdrive"
{
"en" "Aura Overdrive"
}
"paladin_skill_AuraOverdrive_desc"
{
"en" "Activate all auras at once, giving you full benefits."
}

}

Finally, save your translation.
Translation should named w3s.race.<shortname>.phrases.txt (example: w3s.race.paladin.phrases.txt)

I think thats all...
You need to compile the .sp file, upload into the server, restart your server...

P.S. Sorry for English. If you find some mistake correct me...
« Last Edit: April 06, 2011, 06:02:53 PM by Ownz » Logged
-El Diablo
Full Member
***
Posts: 175


View Profile
« Reply #1 on: May 12, 2012, 08:01:40 AM »

I understand what your saying so far, but I don't see where some of these translations are coming from unless you watch for them in game:

For example: w3s.race.undead.phrases

   "Suicide bomber BUILDING damage: {amount} at distance {amount}"
   {
      "#format"   "{1:d},{2:f}"
      "en"      "[W3S] Suicide bomber BUILDING damage: {1} at distance {2}"
   }
   "Player {player} has immunity (protecting buildings)"
   {
      "#format"   "{1:d}"
      "en"      "[W3S] Player {1} has immunity (protecting buildings)"
   }
   "Suicide bomber damage: {amount} to {amount} at distance {amount}"
   {
      "#format"   "{1:d},{2:d},{3:f}"
      "en"      "[W3S] Suicide bomber damage: {1} to {2} at distance {3}"
   }
   "Could not damage player {player} due to immunity"
   {
      "#format"   "{1:d}"
      "en"      "[W3S] Could not damage player {1} due to immunity"
   }
   "Leeched +{amount} HP"
   {
      "#format"   "{1:d}"
      "en"      "[W3S] Leeched +{1} HP"
   }
}


Inside the source file War3Source_001_UndeadScourge.sp
I can not find these phrases.  It's as if these phrases must be during the game play and the phrase file is catching them??

I've read the Translations (SourceMod Scripting) webpage, and I think I'm on the right track, but can someone help me further understand the extras that are inside the phrases.txt files for the races?

I want to add translations to my new races.  Thanks.
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2032



View Profile WWW Email
« Reply #2 on: May 14, 2012, 06:05:01 PM »

yes he did miss the part of changing the phrases in prints inside the races themselves
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!