RawRegionDisplayName Explanation

From Terra Invicta Official Wiki

Explanation

The RawRegionDisplayName page is a workaround for efficiently converting Region data names into Region display names. I previously attempted to use a template file using a #switch function, but it was extremely inefficient since there are so many Regions to check through one by one, and the template had to be called over and over for every Region data name on the page that needed to be converted. This method is way faster.

Usage

Error while fetching data from URL https://wiki.hoodedhorse.com/Terra_Invicta/index.php?title=RawRegionDisplayName&action=raw: $2.
There was a problem during the HTTP request: 403 Forbidden
Error while fetching data from URL https://wiki.hoodedhorse.com/Terra_Invicta/index.php?title=RawRegionDisplayName&action=raw:
<!DOCTYPE html>
 <html class="no-js" lang="en-US"> 
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<style>body{margin:0;padding:0}</style>


<script type="bcd883b7d2189149051648e5-text/javascript">
  if (!navigator.cookieEnabled) {
    window.addEventListener('DOMContentLoaded', function () {
      var cookieEl = document.getElementById('cookie-alert');
      cookieEl.style.display = 'block';
    })
  }
</script>

</head>
<body>
  

Sorry, you have been blocked

You are unable to access hoodedhorse.com

Why have I been blocked?

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?

You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

<script type="bcd883b7d2189149051648e5-text/javascript"> window._cf_translation = {}; </script> <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="bcd883b7d2189149051648e5-|49" defer></script><script>(function(){function c(){var b=a.contentDocument||(a.contentWindow&&a.contentWindow.document);if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a3f03d3de8e57e5c',t:'MTc5MDA2ODg4NA=='};var a=document.createElement('script');a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script><script type="module" src="https://static.cloudflareinsights.com/beacon.min.js/v31edd6df95cf4e85bb4c19e7a9bdbcba1788362987495" integrity="sha512-iIg7k2xntmwu6/uSb5tpc/hySgZc4eoL31yB29W6tJFo2akwjPWcEqnCEdJvGexCL0KEQwVYv5BlowfhVz26hg==" data-cf-beacon='{"version":"2024.11.0","token":"51862476f1994747843f52d73cd5e123","spa":2}' crossorigin="anonymous"></script> </body> </html>
.

Just put this once anywhere in your wiki page that is before the Region data names that you wish to convert.

{{#get_web_data:
|url={{fullurl:RawRegionDisplayName|action=raw}}
|data=__all
}}

Then, to convert a Region data name such as "IvoryCoast", simply type:

{{#external_value:IvoryCoast}}

Which would output: Error: no local variable "IvoryCoast" has been set.

How to Update RawRegionDisplayName

Whenever the game adds more Regions, RawRegionDisplayName can be easily updated as follows:

  1. Open the file
     TIRegionTemplate.en 
    , which is located in
     \Terra Invicta\TerraInvicta_Data\StreamingAssets\Localization\en 
  2. Do a search for every line that starts with
    TIRegionTemplate.displayName.
  3. Copy every line found, and paste it into RawRegionDisplayName, replacing everything after the line
    EXPLANATION=[[RawRegionDisplayName Explanation]]
  4. Finally do a search and replace to replace every
    TIRegionTemplate.displayName.
    with nothing.

Note: There are also some comments in TIRegionTemplate.en that need to be removed.