Getting Started with SKSE Plugin Development: Difference between revisions
Jump to navigation
Jump to search
Added technicality warning, standardised all path/directory backslashes to '/', specified some information because someone got confused and thought it was a guide on how to install SKSE... + minor
imported>3Nd R1m (Added background on the C++ Tool-set dilemma and minors changes) |
imported>3Nd R1m (Added technicality warning, standardised all path/directory backslashes to '/', specified some information because someone got confused and thought it was a guide on how to install SKSE... + minor) |
||
| Line 15: | Line 15: | ||
== Requirements == | == Requirements == | ||
* Skyrim Special Edition | * Skyrim Special Edition | ||
* [https://skse.silverlock.org/ SKSE for Skyrim SE] (Also referred as SKSE64) | * [https://skse.silverlock.org/ SKSE for Skyrim SE] (Also referred as SKSE64), which you should already have installed. | ||
* SKSE64 source code which is included in the SKSE64 distribution | * SKSE64 source code which is included in the SKSE64 distribution (In the '''src/''' folder) | ||
* A template SKSE Plugin. [https://github.com/Ryan-rsm-McKenzie/CommonLibSSE/wiki Ryan's Tutorial] provide one. | * A template SKSE Plugin. [https://github.com/Ryan-rsm-McKenzie/CommonLibSSE/wiki Ryan's Tutorial] provide one. | ||
* [https://visualstudio.microsoft.com/vs/ Visual Studio 2019], but you can use an earlier version if you wish. | * [https://visualstudio.microsoft.com/vs/ Visual Studio 2019], but you can use an earlier version if you wish. | ||
* And most importantly, you need to know C++ programming. | * And most importantly, you need to know C/C++ programming and have a good understanding of memory management. | ||
To eliminate any potential trouble, be sure to have Windows, SKSE and Skyrim Special Edition up-to-date. Please keep in mind that this guide does not guarantee backward/forward compatibility. | To eliminate any potential trouble, be sure to have Windows, SKSE and Skyrim Special Edition up-to-date. Please keep in mind that this guide does not guarantee backward/forward compatibility. | ||
| Line 38: | Line 38: | ||
To make a plugin we'll first need SKSE's source code. However, SKSE was made with an earlier version of Visual Studio and still use outdated toolsets that aren't available within VS2019. Therefore additional setups must be performed. | To make a plugin we'll first need SKSE's source code. However, SKSE was made with an earlier version of Visual Studio and still use outdated toolsets that aren't available within VS2019. Therefore additional setups must be performed. | ||
# Within the SKSE zip files obtained from [https://skse.silverlock.org/ the official website] locate and extract the '''src/''' directory. | # Within the SKSE zip files obtained from [https://skse.silverlock.org/ the official website] locate and extract the '''src/''' directory. | ||
# Open the SKSE64 solution '''src | # Open the SKSE64 solution '''src/skse64/skse64.sln''' with Visual Studio 2019. VS2019 should already be associated with the .sln file type. | ||
# Upon loading, you'll be prompted with the option to "Permanently remove source control association bindings". The SKSE team uses what is called "Source control", which is a way to share, update and checkout codes coming from multiple users. We won't (and can't) use their source control so we can permanently remove any source control association. [https://imgur.com/95b5KXK (image)] | # Upon loading, you'll be prompted with the option to "Permanently remove source control association bindings". The SKSE team uses what is called "Source control", which is a way to share, update and checkout codes coming from multiple users. We won't (and can't) use their source control so we can permanently remove any source control association. [https://imgur.com/95b5KXK (image)] | ||
# Just after that, a new window will appear and suggest to Retarget the Projects. The default options should be good enough and you can press '''"Ok"'''. [https://imgur.com/jnyPSWk (image)] | # Just after that, a new window will appear and suggest to Retarget the Projects. The default options should be good enough and you can press '''"Ok"'''. [https://imgur.com/jnyPSWk (image)] | ||
| Line 50: | Line 50: | ||
##: The project files include post-build events that we don't want (Such as automatically moving files into Skyrim's directory). | ##: The project files include post-build events that we don't want (Such as automatically moving files into Skyrim's directory). | ||
##: To disable post-build events, navigate to '''Build Events => Post-Build Event''' and change the '''Use in build''' field to '''No'''. | ##: To disable post-build events, navigate to '''Build Events => Post-Build Event''' and change the '''Use in build''' field to '''No'''. | ||
## Set C++ Language Standard | ## Set the C++ Language Standard | ||
##: Navigate to '''C/C++ => Language''' and set '''C++ Language Standard''' to '''ISO C++17 Standard (/std:c++17)'''. | ##: Navigate to '''C/C++ => Language''' and set '''C++ Language Standard''' to '''ISO C++17 Standard (/std:c++17)'''. | ||
## Force-include <string> | ## Force-include <string> | ||
| Line 70: | Line 70: | ||
== Making a plugin == | == Making a plugin == | ||
'''Be aware:''' SKSE Plugin cannot override or extends already existing script. In other words, consider an ''"ObjectReference"'' object and a ''"newMethod(<parameters>)"'' function you want to implement as an interaction of ''ObjectReference''. You won't be able to implement ''ObjectReference.newMethod(<parameters>)''. Instead, you can create a new ''"NewWrapperScript"'' object and implement ''NewWrapperScript.newMethod(ObjectReference, <parameters>)''. | |||
At this point, we should start making the actual plugin. You can follow [https://github.com/Ryan-rsm-McKenzie/CommonLibSSE/wiki Ryan's Tutorial] while this page is being written. | At this point, we should start making the actual plugin. You can follow [https://github.com/Ryan-rsm-McKenzie/CommonLibSSE/wiki Ryan's Tutorial] while this page is being written. | ||