RawBatteryDisplayName Explanation

From Terra Invicta Official Wiki
Revision as of 00:55, 18 June 2025 by Redwah (talk | contribs) (Created page with "== Explanation == The RawBatteryDisplayName page is a workaround for efficiently converting Battery data names into Battery display names. I previously attempted to use a template file using a <nowiki>#switch function</nowiki>, but it was extremely inefficient since there are so many Batteries to check through one by one, and the template had to be called over and over for every Battery data name on the page that needed to be converted. This method is way faster. =...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Explanation

The RawBatteryDisplayName page is a workaround for efficiently converting Battery data names into Battery display names. I previously attempted to use a template file using a #switch function, but it was extremely inefficient since there are so many Batteries to check through one by one, and the template had to be called over and over for every Battery 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=RawBatteryDisplayName&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=RawBatteryDisplayName&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="bfe2e3db8022fca703d85da7-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="bfe2e3db8022fca703d85da7-text/javascript"> window._cf_translation = {}; </script> <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="bfe2e3db8022fca703d85da7-|49" defer></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> <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:'a3eaf4b48d84d8ac',t:'MTc5MDAxMzQ4NA=='};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></body> </html>
.

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

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

Then, to convert a Battery data name such as "AlienSuperconductingCoilBattery", simply type:

{{#external_value:AlienSuperconductingCoilBattery}}

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

How to Update RawBatteryDisplayName

Whenever the game adds more Batteries, RawBatteryDisplayName can be easily updated as follows:

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