User Tools

Site Tools


democap:modding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
democap:modding [2024/07/26 09:44] – [Project Preparation] dragonlorddemocap:modding [2024/09/06 09:33] (current) – [Modding] dragonlord
Line 8: Line 8:
 DEMoCap supports modifications developer by anybody using the [[https://mod.io/g/democap|Mod.io]] platform. Various modifications can be made including (but not limited to): characters, props, worlds and script code. DEMoCap supports modifications developer by anybody using the [[https://mod.io/g/democap|Mod.io]] platform. Various modifications can be made including (but not limited to): characters, props, worlds and script code.
  
 +====== Examples ======
 +
 +Example modifications can be found on the [[https://github.com/LordOfDragons/democap/tree/main/modding/examples|Github Repository]].
 ====== Using Modifications ====== ====== Using Modifications ======
  
Line 29: Line 32:
  
 For developing scripts it is recommended to use [[https://code.visualstudio.com/|Visual Studio Code]]. Start it up and open the ''Extension'' panel (the one with the 4 cubes icon). Search for ''DragonScript'' and install the ''DragonScript Language Support''. This adds support to easily edit DragonScript files with complete project management. For developing scripts it is recommended to use [[https://code.visualstudio.com/|Visual Studio Code]]. Start it up and open the ''Extension'' panel (the one with the 4 cubes icon). Search for ''DragonScript'' and install the ''DragonScript Language Support''. This adds support to easily edit DragonScript files with complete project management.
 +<WRAP center round tip 60%>
 +DragonScript used in the Drag[en]gine Game Engine does not require compiling, bundling or otherwise process scripts before using them. Visual Studio Code and the DragonScript extension are only required to simplify and accelerate writing scripts. To run your scripts you can just launch DEMoCap with them as-is.
 +</WRAP>
 +
  
 You have now an empty workspace. Start by clicking on ''File'' -> ''Add Folder to Workspace''. Select your ''MyMod'' directory. You have now a workspace with the two directories ''content'' and ''scripts''. You have now an empty workspace. Start by clicking on ''File'' -> ''Add Folder to Workspace''. Select your ''MyMod'' directory. You have now a workspace with the two directories ''content'' and ''scripts''.
Line 38: Line 45:
 Under ''Script Directories'' click on ''Edit in settings.json''. This creates and opens the settings file in your project placing the cursor at the ''dragonscriptLanguage.scriptDirectories'' setting. Replace the ''"."'' value with ''"scripts"'' value. This ensures script parsing is only done on the ''scripts'' directory and not the entire project. Go back to the ''Settings'' tab. Under ''Script Directories'' click on ''Edit in settings.json''. This creates and opens the settings file in your project placing the cursor at the ''dragonscriptLanguage.scriptDirectories'' setting. Replace the ''"."'' value with ''"scripts"'' value. This ensures script parsing is only done on the ''scripts'' directory and not the entire project. Go back to the ''Settings'' tab.
  
-Under ''Base Packages'' click on ''Edit in settings.json''. This opens again the settings file placing the cursor at the ''dragonscriptLanguage.basePackages'' setting. Here you can enter the ''*.delga'' file of DEMoCap. This will make the DEMoCap script files available in the project. To find the correct path you can launch from the start menu ''Drag[en]gine GUI Launcher''. On Linux you can also run ''delauncher-gui'' from a terminal window. Find the ''DEMoCap'' game entry in the list and <key>RMB</key> click on it. Select ''Properties''. In the dialog window locate the ''DELGA:'' value. This is the path to the last known location of DEMoCap. Copy this path and enter it into the ''dragonscriptLanguage.scriptDirectories'' list. On Windows only make sure to replace each single ''\'' with double ''\\'' otherwise the directory will not be found.+Under ''Base Packages'' click on ''Edit in settings.json''. This opens again the settings file placing the cursor at the ''dragonscriptLanguage.basePackages'' setting. Here you can enter the ''*.delga'' file of DEMoCap. This will make the DEMoCap script files available in the project. To find the correct path you can launch from the start menu ''Drag[en]gine GUI Launcher''. On Linux you can also run ''delauncher-gui'' from a terminal window. Find the ''DEMoCap'' game entry in the list and <key>RMB</key> click on it. Select ''Properties''. In the dialog window locate the ''DELGA:'' value. This is the path to the last known location of DEMoCap. Copy this path and enter it into the ''dragonscriptLanguage.scriptDirectories'' list. 
 +<WRAP center round important 60%> 
 +On Windows make sure to replace each single ''\'' in the path with double ''\\''. Otherwise the directory will not be found and you miss IDE support for DEMoCap script classes. 
 +</WRAP>
  
 Once done your settings file looks similar to this: Once done your settings file looks similar to this:
Line 59: Line 69:
 } }
 </code> </code>
 +<WRAP center round tip 60%>
 +You can also manually create and edit this file and the content of it. This can be useful if you create multiple modifications by copying the content of this file.
 +</WRAP>
 +
  
 Your workspace is now ready to developer the modification using scripts. Your workspace is now ready to developer the modification using scripts.
Line 70: Line 84:
 Open file browser with path ''~/.config/delauncher/games/e31f1c11-3ca6-c66b-adca-95484bedfc1f''. Create directory ''overlay''. Content in this directory will be overlaid in DEMoCap. Open the ''overlay'' directory. Open your ''MyMod'' directory in another file browser. Create symbolic links of ''content'' and ''scripts'' into the ''overlay'' directory. Open file browser with path ''~/.config/delauncher/games/e31f1c11-3ca6-c66b-adca-95484bedfc1f''. Create directory ''overlay''. Content in this directory will be overlaid in DEMoCap. Open the ''overlay'' directory. Open your ''MyMod'' directory in another file browser. Create symbolic links of ''content'' and ''scripts'' into the ''overlay'' directory.
  
-Now when you run DEMoCap your modification content will be used as if a user has installed your final modification. Once you are finished developing your modification remove these two symbolic links.+Now when you run DEMoCap your modification content will be used as if a user has installed your final modification.
  
 ==== Windows ==== ==== Windows ====
Line 85: Line 99:
 Replace ''C:\Users\DragonDreams\MyMod'' with the path to your ''MyMod'' directory. These calls create first the ''overlay'' directory. Then the ''content'' and ''scripts'' directories from inside your ''MyMod'' directory are symbolic-linked to the ''overlay'' directory. Replace ''C:\Users\DragonDreams\MyMod'' with the path to your ''MyMod'' directory. These calls create first the ''overlay'' directory. Then the ''content'' and ''scripts'' directories from inside your ''MyMod'' directory are symbolic-linked to the ''overlay'' directory.
  
-Now when you run DEMoCap your modification content will be used as if a user has installed your final modification. Once you are finished developing your modification remove these two symbolic links.+Now when you run DEMoCap your modification content will be used as if a user has installed your final modification. 
 +<WRAP center round important 60%> 
 +Once you are finished developing your modification remove these two symbolic links (''content'' and ''scripts'' directories)Otherwise they keep overlaying DEMoCap even if you test-install your own modification after uploading it to Mod.io. 
 +</WRAP>
  
 ===== Content Modifications ===== ===== Content Modifications =====
Line 95: Line 112:
 See the [[https://github.com/LordOfDragons/democap/tree/main/data/scripts|DEMoCap repository]] for the kind of scripts you can add. See the [[https://github.com/LordOfDragons/democap/tree/main/data/scripts|DEMoCap repository]] for the kind of scripts you can add.
  
-In general the scripts you write need to be added at the right time while DEMoCap is loaded. This is done by creating a modification script file in your project. Create a file ''ModTestScript.ds'' in your project (the name is not important just but the extension has to be ''.ds'') with the following content:+In general the scripts you write need to be added at the right time while DEMoCap is loaded. This is done by creating a modification script file in your project. Create a file ''ModTestScript.ds'' in your project. The name of the file is not important as long as the extension is ''.ds''. Add the following content to the file:
 <code> <code>
 namespace Democap.Modifications namespace Democap.Modifications
Line 105: Line 122:
 end end
 </code> </code>
 +<WRAP center round important 60%>
 +The ''namespace'' line is important. DEMoCap searches for modification script files only in this namespace.
 +</WRAP>
  
 Use for ''MyModification'' a unique namespace name for your modification to keep files from mixing with other modifications. Place your script files in this namespace. You can choose your file structure as you like. It is not required to mirror namespace structure but doing so can help organize your files. Use for ''MyModification'' a unique namespace name for your modification to keep files from mixing with other modifications. Place your script files in this namespace. You can choose your file structure as you like. It is not required to mirror namespace structure but doing so can help organize your files.
Line 128: Line 148:
 You then would have to add a new script file implementing the ''MyCoolObjectClass''. See [[https://github.com/LordOfDragons/democap/blob/main/data/scripts/element/DynamicPropClass.ds|DEMoCap internal element classes]] for examples on how they are structured. You then would have to add a new script file implementing the ''MyCoolObjectClass''. See [[https://github.com/LordOfDragons/democap/blob/main/data/scripts/element/DynamicPropClass.ds|DEMoCap internal element classes]] for examples on how they are structured.
  
-Pay attention to the problems panel. If errors are shown DEMoCap will fail launching. If you have no errors shown you can launch DEMoCap and your modification will be loaded.+Pay attention to the ''Problems'' panel in ''Visual Studio Code''. If errors are shown DEMoCap will fail launching. If you have no errors shown you can launch DEMoCap and your modification will be loaded. No compiling of any kind is required. DEMoCap loads the scripts as is during starting up.
  
 Once your modification is working as intended you can create the ''.zip'' archive and get ready to publish it on Mod.io. Once your modification is working as intended you can create the ''.zip'' archive and get ready to publish it on Mod.io.
democap/modding.1721987061.txt.gz · Last modified: 2024/07/26 09:44 by dragonlord