imported>CraftySentinel |
imported>CraftySentinel |
Line 1: |
Line 1: |
| [[Category:Scripting_Guides]]
| |
| This script will allow you to only allow access to an esp plug-in file if requirements are met.
| |
|
| |
| ==Usage==
| |
| There are many reasons why you may want to protect a plug-in file from only allowing authoirsed users to test said file or if you want to use said file for personal use. This method can also be used to prevent piracy.
| |
|
| |
| ==Preperations==
| |
| First lets make a quest to handle our script so that it will run as soon as the player loads into the game.
| |
|
| |
| To do this go to the <b>Object Window</b> and under the <b>Character tab</b>, open the <b>Quests</b> sub menu. Then right click on any quest and click <b>New</b>. Give this quest an ID and insure that <b>Allow Repeated Stages</b> is checked on the <b>Quest Data</b> menu. Then lets make a new stage under the <b>bQuest Stages</b> menu and call it stage 10. Make sure that <b>Run On Start</b> is checked. The close the <b>Quest Window</b> and reopen the same quest we just made. This will give us access to the stage fragments. Lets go over to the <b>Scripts</b> tab on the far right end of the quest window and make a new script by pressing <b>Add</b> followed by <b>[New Script]</b>.
| |
|
| |
| Once you have clicked on <b>[New Script]</b> name it what you would like and click <b>OK</b>. Now please refer to the <u>Script</u> part of this tutorial.
| |
|
| |
|
| |
|
| |
| ==Script== | | ==Script== |
| This is an example script. It can be used to prevent access to a plugin file by displaying a series of messages and menus that will either let the player into the game with the plug-in or take them back to the main menu where they can uninstall the plug-in file. | | This is an example script. It can be used to prevent access to a plugin file by displaying a series of messages and menus that will either let the player into the game with the plug-in or take them back to the main menu where they can uninstall the plug-in file. |
Line 41: |
Line 26: |
| Message Property FailMessage01 Auto Const | | Message Property FailMessage01 Auto Const |
| {Message To Show If User Has Plugin Installed} | | {Message To Show If User Has Plugin Installed} |
|
| |
| Message Property FailMessage02 Auto Const
| |
| {User Does Not Have Requirements}
| |
|
| |
|
| Message Property WarningMessage01 Auto Const | | Message Property WarningMessage01 Auto Const |
Line 59: |
Line 41: |
| Event OnQuestInit() | | Event OnQuestInit() |
| If (Game.IsPluginInstalled("ExamplePlugin01.esp")) | | If (Game.IsPluginInstalled("ExamplePlugin01.esp")) |
| If (Game.IsPluginInstalled("ExamplePlugin02.esp"))
| |
| FailMessage01.Show()
| |
| Self.Stop()
| |
| Self.Reset()
| |
| Game.QuitToMainMenu()
| |
| Else
| |
| Menu() | | Menu() |
| EndIf
| |
| Else | | Else |
| FailMessage02.Show() | | FailMessage01.Show() |
| Self.Stop() | | Self.Stop() |
| Self.Reset() | | Self.Reset() |
Line 106: |
Line 81: |
|
| |
|
| </source> | | </source> |
|
| |
| ==Finishing==
| |
| After you have finished with your script and it has successfully compiled, go back to that stage we created earlier and under the <b>kmyQuest</b> tab just above the fragments window, select the script you just made. Then in the fragment type <b>kmyQuest.Start()</b> . This will insure that the script will start when the player loads into the save game.
| |
|
| |
| And you are done! You now have a plug-in file that will only load if the user mets your requirements.
| |