Difference between revisions of "Modding Guide"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(Add more description)
Line 23: Line 23:
 
# If you are editing a mod that you already created, select the consistent mod name in the "Mod" pull-down list (You might have to "save" first and reopen the Settings).
 
# If you are editing a mod that you already created, select the consistent mod name in the "Mod" pull-down list (You might have to "save" first and reopen the Settings).
 
# If you are starting a new mod, select "Create Mod" under the "LoA Toolkit" menu.
 
# If you are starting a new mod, select "Create Mod" under the "LoA Toolkit" menu.
 +
 +
Your Mod folder should then have the following structure:
 +
[[File:Folder Structure.png|thumb|Mod Folder Structure]]
  
 
=== Modding the Celador maps ===
 
=== Modding the Celador maps ===
Line 28: Line 31:
 
# Look in Unity's "Project" widget, select the "Legends of Aria Toolkit" folder and double-click on the "ShardsToolkit.unity" Unity asset (It's a scene map loader helper).
 
# Look in Unity's "Project" widget, select the "Legends of Aria Toolkit" folder and double-click on the "ShardsToolkit.unity" Unity asset (It's a scene map loader helper).
 
# Select the "Game" above the viewer window and press the "Play" button on the top right of that same window.
 
# Select the "Game" above the viewer window and press the "Play" button on the top right of that same window.
# You can select any scene map to be loaded by pressing its button. For "New Celador", there is an exception: The map is split into sub-scene because it is very big.
+
# You can select any scene map to be loaded by pressing its button. For "New Celador", there is an exception: the map is split into sub-scenes because it is very big.
 
# Open "LoA Toolkit" then "Utils" then "World Streamer Manager" and you can select a "Preset" selection of scene respective to the area you are looking to edit. You can alternatively load individual scenes by clicking on them.
 
# Open "LoA Toolkit" then "Utils" then "World Streamer Manager" and you can select a "Preset" selection of scene respective to the area you are looking to edit. You can alternatively load individual scenes by clicking on them.
 
# Switch to the "Scene" view by pressing the "#Scene" button above the Unity viewer (from the "Game" view you currently are on).
 
# Switch to the "Scene" view by pressing the "#Scene" button above the Unity viewer (from the "Game" view you currently are on).
 +
# You can add Prefabs to the map, as well as Seed Objects (cf. below).
  
 
=== Starting a new map ===
 
=== Starting a new map ===
Line 40: Line 44:
 
# You can edit the terrain properties (size, center, texture, etc.) from Unity's "Inspector" widget. You can also use some Unity Terrain generators to help you create terrains easily.
 
# You can edit the terrain properties (size, center, texture, etc.) from Unity's "Inspector" widget. You can also use some Unity Terrain generators to help you create terrains easily.
 
# You can add Prefabs to the map, as well as Seed Objects (cf. below).
 
# You can add Prefabs to the map, as well as Seed Objects (cf. below).
# When done, select "MapData" in Unity's "Hierarchy" widget. Select "Reset Permanent IDs" in Unity's "Inspector" widget and press "Build".
+
 
# Check the "Saving your mod" section below. If you haven't saved the project yet, Unity will require you to save it first.
+
Make sure you save your mod after edition.
  
 
=== Saving your mod ===
 
=== Saving your mod ===
  
Make sure you have save your Unity project, built your map data (if applies, cf. above), and saved all your seed objects (see below).
+
Make sure you have save your Unity project, built your map data (if applies), and saved all your seed objects (see below).
 +
# When done, select "MapData" in Unity's "Hierarchy" widget. Select "Reset Permanent IDs" (unless you have a script that refers to any Permanent IDs) in Unity's "Inspector" widget and press "Build".
 +
# Check the "Saving your mod" section below. If you haven't saved the project yet, Unity will require you to save it first.
 +
# To make sure your server loads your modifications, make sure you consistently edit the "<Mod>" section of the ClusterConfig.xml file, i.e. put your mod name there.
 +
# If you have created a new map, make sure you add a "<ClientBundle>" subsection in that section and add or edit the consistent "<Region>".
 +
# Also, make sure you clean up all your server backups before to reload it (careful of what you delete as well, like characters' data, if you're in production).
  
To make sure your server loads your modifications, make sure you consistently edit the "<Mod>" section of the ClusterConfig.xml file, i.e. put your mod name there.
+
== Prefabs ==
If you have created a new map, make sure you add a "<ClientBundle>" subsection in that section and add or edit the consistent "<Region>".
 
  
Also, make sure you clean up all your server backups before to reload it (careful of what you delete as well, like characters' data, if you're in production).
+
Prefabs are usually static objects that can be place on a map, i.e. a building, trees, etc.
 +
You can use "Default" Celador prefabs, which can be found in Unity's "Project" widget, under "Assets", "Legends of Aria Toolkit", "Default Object Library", "Prefabs".
  
 
== Seed Objects ==
 
== Seed Objects ==
Line 83: Line 92:
 
You can choose to "Save All Seed Objects" or select individual groups/categories to be saved.
 
You can choose to "Save All Seed Objects" or select individual groups/categories to be saved.
 
Make sure you save the seeds as often as possible not to loose your work (since it's independent from Unity's scene/project saving).
 
Make sure you save the seeds as often as possible not to loose your work (since it's independent from Unity's scene/project saving).
 
== Prefabs ==
 
 
Prefabs are usually static objects that can be place on a map, i.e. a building, trees, etc.
 
You can use "Default" Celador prefabs, which can be found in Unity's "Project" widget, under "Assets", "Legends of Aria Toolkit", "Default Object Library", "Prefabs".
 

Revision as of 07:58, 28 August 2018

Necessary Tools

For the time being, modding is only feasible on Windows machines.

  1. Unity 3D editor: Download Unity3D Installer version 2018.1.9 (at least version 5.6). You will need to create an account.
  2. Lua editor: Download Sublime Text or any other editor with syntax highlighting, e.g. Notepad++.
  3. The latest Legends of Aria Toolkit.

Creating a new project, based or not on the Celador map

Cf. this video introducing the setup NOTE: You must have first installed a LoA server before to proceed with the direction below.

  1. Launch Unity3D, create a "New" "3D" project, assigning it with a name, preferably in a folder of your choice. No Unity Analytics is needed.
  2. Import assets: in "Assets" menu, "Import Package" and import both "Effects" and "Environment" (Press "Import" for each new window opening).
  3. From the Assets store (in "Window" menu, select "Asset Store"), search for the "Post Processing Stack" package ("Unity Essentials" from "Unity Technologies").
  4. in "Assets" menu, "Import Package", import "Custom Package" and select the Legends of Aria Toolkit you previously downloaded. Click "Import" on the new widow, this will take several minutes.
  5. You should now have a new "LoA Toolkit" menu item in Unity3D.
  6. Under that new menu item, select "Settings".
  7. "Browse" the "Base Path" to reflect the path: <server>\Build\base
  8. "Browse" the "mods Path" to reflect the path: <server>\mods
  9. Press "Save".
  10. If you are editing a mod that you already created, select the consistent mod name in the "Mod" pull-down list (You might have to "save" first and reopen the Settings).
  11. If you are starting a new mod, select "Create Mod" under the "LoA Toolkit" menu.

Your Mod folder should then have the following structure:

Mod Folder Structure

Modding the Celador maps

  1. Look in Unity's "Project" widget, select the "Legends of Aria Toolkit" folder and double-click on the "ShardsToolkit.unity" Unity asset (It's a scene map loader helper).
  2. Select the "Game" above the viewer window and press the "Play" button on the top right of that same window.
  3. You can select any scene map to be loaded by pressing its button. For "New Celador", there is an exception: the map is split into sub-scenes because it is very big.
  4. Open "LoA Toolkit" then "Utils" then "World Streamer Manager" and you can select a "Preset" selection of scene respective to the area you are looking to edit. You can alternatively load individual scenes by clicking on them.
  5. Switch to the "Scene" view by pressing the "#Scene" button above the Unity viewer (from the "Game" view you currently are on).
  6. You can add Prefabs to the map, as well as Seed Objects (cf. below).

Starting a new map

See this video for more detail.

  1. From the "LoA Toolkit" menu, select "Custom Assets", then "Create New Custom Map". You can choose either it's an exterior or interior map. A new "MapData" asset will be create under your new "Untitled" (a least until you save it) unity scene in Unity's "Hierarchy" widget.
  2. Create a new terrain, either by right clicking in the "Hierarchy" widget or under the "GameObject" menu, then "3D Object" and "Terrain".
  3. You can edit the terrain properties (size, center, texture, etc.) from Unity's "Inspector" widget. You can also use some Unity Terrain generators to help you create terrains easily.
  4. You can add Prefabs to the map, as well as Seed Objects (cf. below).

Make sure you save your mod after edition.

Saving your mod

Make sure you have save your Unity project, built your map data (if applies), and saved all your seed objects (see below).

  1. When done, select "MapData" in Unity's "Hierarchy" widget. Select "Reset Permanent IDs" (unless you have a script that refers to any Permanent IDs) in Unity's "Inspector" widget and press "Build".
  2. Check the "Saving your mod" section below. If you haven't saved the project yet, Unity will require you to save it first.
  3. To make sure your server loads your modifications, make sure you consistently edit the "<Mod>" section of the ClusterConfig.xml file, i.e. put your mod name there.
  4. If you have created a new map, make sure you add a "<ClientBundle>" subsection in that section and add or edit the consistent "<Region>".
  5. Also, make sure you clean up all your server backups before to reload it (careful of what you delete as well, like characters' data, if you're in production).

Prefabs

Prefabs are usually static objects that can be place on a map, i.e. a building, trees, etc. You can use "Default" Celador prefabs, which can be found in Unity's "Project" widget, under "Assets", "Legends of Aria Toolkit", "Default Object Library", "Prefabs".

Seed Objects

Seed objects are dynamic object that spawns when the server resets or when loaded the first time. They can be grouped, under "category" or "group", so they can be loaded, saved and edited all at once or separately. Celador base map's Seed Objects are grouped by zone and types.

To access Seed Objects functionality, go to "LoA Toolkit", "Dynamic Editors" then "Seed Object Editor".

Loading

If you are editing from the Celador base map, select the "Default" "Mod", otherwise load your module's specific group (if not already loaded). You can select in the "Seed Object Editor" to "Load All Seed Objects" or the specific "Group" that you want to load to edit.

Creating

It is advised to create groups/categories to have a finer detail of finding, editing and saving/loading of seed objects. In order to do this, click on "Create New Category" on the "Seed Object Editor" window. You can rename each category or seed object from Unity's "Hierarchy" widget. Then you can "Create New Seed Object" from the "Seed Object Editor" window. You will want to drag that "New Seed" object within the consistent category (that you created above) in Unity's "Hierarchy" widget, and rename it. Then select that seed in the "Hierarchy" widget and you will see Unity's "Inspector" widget updating, as well as the bottom of the "Seed Object Editor" window, showing "Seed Object Selected". You can "Select" a template to be used for that seed (You might have to re-select "Default" for "Mod" to get all the templates if you had changed it before).

A useful thing when your editing point-of-view is pointing at the location you want to place your item at, is to use the "GameObject" menu's "Move To View" function. Double-clicking on an object in Unity's "Hierarchy" will move the point-of-view to point to the object's location.

Make sure you save your seed objects when done.

Saving

If you have modified any group of seed object or single object from the "Default" Celador map, make sure you select your "Mod" in the "Seed Object Editor" before saving. Ditto if you want to override any "Default" group, you can also create a group of the same name of a "Default" Celador group to override.

You can choose to "Save All Seed Objects" or select individual groups/categories to be saved. Make sure you save the seeds as often as possible not to loose your work (since it's independent from Unity's scene/project saving).