ATTENTION! The process of updating WiKi to version Eco 10.x has begun. Those wishing to participate can find out more Information on our ECO Contribution Wiki Discord.
From April 26 to May 12, errors may occur in the Wiki, as we will be carrying out a major update to the information processing modules.

Editing Ecopedia Modding

From Eco - English Wiki

Your changes will be displayed to readers once an authorized user accepts them. (help)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 28: Line 28:
Starting with Eco 9.4 custom pages created by Strange Loop Games can be found in your server's mod directory under '''Mods/__core__/Ecopedia.''' Editing the XML files found in this directory will effect the pages found in the Ecopedia in game.
Starting with Eco 9.4 custom pages created by Strange Loop Games can be found in your server's mod directory under '''Mods/__core__/Ecopedia.''' Editing the XML files found in this directory will effect the pages found in the Ecopedia in game.
=== Adding Custom Ecopedia Pages ===
=== Adding Custom Ecopedia Pages ===
It is possible to add your own custom pages to the Ecopedia by creating XML files '''in a sub-folder''' (required!) under '''Mods/UserCode/Ecopedia'''. These files must follow the same XML file layout as the ones in '''Mods/__core__/Ecopedia.'''
It is possible to add your own custom pages to the Ecopedia by creating XML files under '''Mods/__core__/Ecopedia''', preferably in a sub-folder. These files must follow the same XML file layout as the other ones in the Ecopedia folder'''.''' We plan to introduce support for putting Ecopedia files into Mods/UserCode/Ecopedia at a later date, it is currently not supported. An example custom page can be found [https://github.com/StrangeLoopGames/EcoModKit/tree/master/Examples/EcopediaPage/Server/Ecopedia/Welcome here].
=== Example Mod ===
 
An example mod that is comprised of five parts.
 
* Server.xml - The chapter name within the Ecopedia. ''(Folder name should also be the same.)''
The example mod is comprised of three parts.
*Server Info.xml - '''Root page''' within within Ecopedia. ''(File name dictates its in game presentation.)''
* Rules.xml - The root page file for the Ecopedia chapter.
* Server Info;Info.xml - Sub page. ''(File name dictates its in game presentation.)''
* Rules;Server Rules.xml - The Server Rules sub page.
* Server Info;Mods.xml - Sub page. ''(File name dictates its in game presentation.)''
* ServerInfo.xml - The root Ecopedia chapter that shows up in the left navigation.
*Server Info;Rules.xml - Sub page. ''(File name dictates its in game presentation.)''




'''Example Chapter'''
'''Example Chapter'''


A chapter file contains only the '''ecopediachapter''' tag used to define the chapter on the left navigation bar. The priority is used to sort where it will be placed in the list. ''(As of 09/01/2022 a priority of -10 will arrange the chapter at the top of the list)''<syntaxhighlight lang="xml">
A chapter file contains only the '''ecopediachapter''' tag used to define the chapter on the left navigation bar. The priority is used to sort where it will be placed in the list.<syntaxhighlight lang="xml">
<ecopediachapter priority="0" />
<ecopediachapter priority="0" />
</syntaxhighlight>'''Example Root Page'''
</syntaxhighlight>'''Example Root Page'''
In the root page XML document we define our '''ecopedia''' tag which contains the Icon we would like to display and the chapter file that owns this page. The chapter field must match the name used in the chapter file minus the extension. Inside the '''ecopedia''' tag we define our summary text used in the Ecopedia page. ''(A priority/location of -270 will make this the default page when the Ecopedia is opened as of 09/01/2022)''<syntaxhighlight lang="xml">
In the root page XML document we define our '''ecopedia''' tag which contains the Icon we would like to display and the chapter file that owns this page. The chapter field must match the name used in the chapter file minus the extension. Inside the '''ecopedia''' tag we define our summary text used in the Ecopedia page.<syntaxhighlight lang="xml">
<ecopedia chapter="Server" priority="0" icon="PaperItem">
<ecopedia icon="PaperItem" chapter="ServerInfo">
   <summary loc="0">Summary of Server Info</summary>
   <summary>Summary of Server Rules</summary>
</ecopedia>
</ecopedia>
</syntaxhighlight>'''Example Sub Page'''
</syntaxhighlight>'''Example Sub Page'''
In the sub example page we define another page using the '''ecopedia''' tag and icon however we do not define a parent field as this is defined by the file name which follows the rule of "OwningPage;SubPageName.xml". Inside this file we again define our summary text we would like to display as well as our custom content. In this case a section defining our server rules. All tags supported by Eco such as the '''ecoicon''' as well as some custom tags relating to sections are supported on in this file.<syntaxhighlight lang="xml">
In the sub example page we define another page using the '''ecopedia''' tag and icon however we do not define a parent field as this is defined by the file name which follows the rule of "OwningPage;SubPageName.xml". Inside this file we again define our summary text we would like to display as well as our custom content. In this case a section defining our server rules. All tags supported by Eco such as the '''ecoicon''' as well as some custom tags relating to sections are supported on in this file.<syntaxhighlight lang="xml">
<ecopedia priority="2" icon="PaperItem">
<ecopedia icon="PaperItem">
   <summary loc="1">Server Rules</summary>
   <summary>Welcome to our Eco Server!</summary>
   <section>
   <section>
1. Don't be an jerk.
1. Don't be an jerk.
Line 59: Line 58:
We hope you enjoy your stay!
We hope you enjoy your stay!
   </section>
   </section>
</ecopedia>
</syntaxhighlight>We can expand further upon the server rules example and add additional tabs, the priority field influences it's location when a tab system is created. (The below example will now be placed first in the list.)<syntaxhighlight lang="xml">
<ecopedia priority="1" icon="Prevent_LegalAction">
  <summary loc="1">Server Info</summary>
  <section loc="1">
Server Info:
Here we can talk about the server information, website/Discord Server/Specifics about what the playstyle are etc.
  </section>
</ecopedia>
</syntaxhighlight>We can further expand this with an additional tab that would be placed at the end of the tab list.<syntaxhighlight lang="xml">
<ecopedia priority="3" icon="Ecopedia_ChoosingProfession">
  <summary loc="1">Server Mods</summary>
  <section loc="1">
  Mods applied to the server list can go here!
  </section>
</ecopedia>
</ecopedia>
</syntaxhighlight>
</syntaxhighlight>
Please note that all contributions to Eco - English Wiki are considered to be released under the CC BY-NC-SA 4.0 (see Eco:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)