Difference between revisions of "Modding Guide"

From Legends of Aria Admin and Modding Wiki
Jump to: navigation, search
(First version)
 
Line 12: Line 12:
 
'''NOTE''': You must have first [[Installation_Instructions|installed a LoA server]] before to proceed with the direction below.
 
'''NOTE''': You must have first [[Installation_Instructions|installed a LoA server]] before to proceed with the direction below.
  
# In Windows Explorer. Create a new folder under the <server>\mods folder, with the name of your new mod (whether you are going to mod the Celador map or that you are going to create a new mod)
+
# Launch Unity3D, create a "New" "3D" project, assigning it with a name, preferably in a folder of your choice. No Unity Analytics is needed.
# Launch Unity3D
 
# Create a "New" "3D" project, assigning it with a name, preferably in a folder of your choice. No Unity Analytics is needed.
 
 
# Import assets: in "Assets" menu, "Import Package" and import both "Effects" and "Environment" (Press "Import" for each new window opening).
 
# Import assets: in "Assets" menu, "Import Package" and import both "Effects" and "Environment" (Press "Import" for each new window opening).
 
# From the Assets store (in "Window" menu, select "Asset Store"), search for the "Post Processing Stack" package ("Unity Essentials" from "Unity Technologies").
 
# From the Assets store (in "Window" menu, select "Asset Store"), search for the "Post Processing Stack" package ("Unity Essentials" from "Unity Technologies").
 
# 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.
 
# 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.
 
# You should now have a new "LoA Toolkit" menu item in Unity3D.
 
# You should now have a new "LoA Toolkit" menu item in Unity3D.
# Under that new menu item, select "Settings". Let's say you installed the LoA server on path <server>.
+
# Under that new menu item, select "Settings".
 
# "Browse" the "Base Path" to reflect the path: <server>\Build\base
 
# "Browse" the "Base Path" to reflect the path: <server>\Build\base
 
# "Browse" the "mods Path" to reflect the path: <server>\mods
 
# "Browse" the "mods Path" to reflect the path: <server>\mods
# Select the consistent module name you create in step 1 in the "Mod" pull-down list (You might have to "save" first and reopen the Settings). Then "Save".
+
# Press "Save".
 +
# 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.
  
 
=== Modding the Celador maps ===
 
=== Modding the Celador maps ===
  
# When the toolkit is loaded, look in the "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-scene because it is very big.
Line 33: Line 33:
  
 
=== Starting a new map ===
 
=== Starting a new map ===
 +
 +
See this [https://www.youtube.com/watch?v=5vHuc-ccNro video] for more detail.
 +
 +
# 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.
 +
# Create a new terrain, either by right clicking in the "Hierarchy" widget or under the "GameObject" menu, then "3D Object" and "Terrain".
 +
# 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).
 +
# 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.
  
 
=== Saving your mod ===
 
=== Saving your mod ===
Line 46: Line 55:
  
 
Seed objects are dynamic object that spawns when the server resets or when loaded the first time.
 
Seed objects are dynamic object that spawns when the server resets or when loaded the first time.
They can be grouped, under "categories", 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.
+
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".
 
To access Seed Objects functionality, go to "LoA Toolkit", "Dynamic Editors" then "Seed Object Editor".
Line 61: Line 70:
 
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".
 
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).
 
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.
 
Make sure you save your seed objects when done.
Line 68: Line 80:
 
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.
 
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.
 
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.
 
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 20:55, 27 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.

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-scene 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).

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).
  5. When done, select "MapData" in Unity's "Hierarchy" widget. Select "Reset Permanent IDs" in Unity's "Inspector" widget and press "Build".
  6. Check the "Saving your mod" section below. If you haven't saved the project yet, Unity will require you to save it first.

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).

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).

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).

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".