diff --git a/src/scripts/Custom/README.md b/src/scripts/Custom/README.md index 7b9e83d4e..05944b870 100644 --- a/src/scripts/Custom/README.md +++ b/src/scripts/Custom/README.md @@ -6,14 +6,20 @@ They will be git-ignored Remember to use cmake macro inside your CMakeLists.txt to correctly add scripts to project solution. -BTW, **We strongly suggest you** to use our module system to create your custom + + +/!\ BTW, **We strongly suggest you** to use our module system to create your custom powerful module instead of simple scripts. ----------------- -CMakeLists.txt example: +How to: + +1) Create a CMakeLists.txt in this directory + +Example (everything below is needed, just replace with your scripts' names): set(scripts_STAT_SRCS ${scripts_STAT_SRCS} @@ -24,3 +30,8 @@ set(scripts_STAT_SRCS AC_ADD_SCRIPT_LOADER("Custom" "ScriptLoader.h") message(" -> Prepared: My custom scripts") + + +2) Add them to ../ScriptLoader.cpp + +Open the file and go at the end of the file to know what to edit. diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 2c0814c9b..a5e9f710e 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -1171,3 +1171,15 @@ void AddOutdoorPvPScripts() #endif } + +//~ ********************** Put your custom scripts below, like the commented examples, uncomment and edit ************************************* + + +//~ void AddSC_MySuperScript(); + +void AddCustomScripts() +{ +#ifdef SCRIPTS + //~ AddSC_MySuperScript(); +#endif +}