Difference between revisions of "Talk:AddPerk"
Jump to navigation
Jump to search
→Codearound: ooh, cool!
imported>Cipscis |
imported>DewiMorgan (→Codearound: ooh, cool!) |
||
Line 21: | Line 21: | ||
If player.HasPerk ExamplePerk | If player.HasPerk ExamplePerk | ||
player.RemovePerk ExamplePerk | player.RemovePerk ExamplePerk | ||
ShowMessage "ExamplePerk Disabled - mod is now safe to remove." | |||
Else | Else | ||
player.AddPerk ExamplePerk | player.AddPerk ExamplePerk | ||
ShowMessage "ExamplePerk Enabled - don't uninstall this mod without disabling!" | |||
EndIf | EndIf | ||
End | End | ||
Line 36: | Line 36: | ||
End | End | ||
::::One minor point - the name of the function for making a message appear is [[ShowMessage]], not "Message".<br /><br />One idea that I saw come up a while ago that I found quite interesting was to "catch" when the player was saving their game, and remove the perks from the save, then adding them back again afterwards. While this was possible for regular saves and console saves, it was not so for quicksaves, autosaves, or scripted saves.<br /><br />Once FOSE v2 is released, it will be possible to create a plugin that can detect autosaves, and activate all Activators within a dummy cell before and after a quicksave is created. This could be used to utilise "save-catching" in a mod so that an uninstallation method is not (necessarily) required. However, such a method ''would'' require FOSE, and some perks may need to be set up a little differently so that there aren't any bugs when they are added back after saving.<br />-- [[User:Cipscis|Cipscis]] 22:39, 16 April 2009 (UTC) | ::::One minor point - the name of the function for making a message appear is [[ShowMessage]], not "Message".<br /><br />One idea that I saw come up a while ago that I found quite interesting was to "catch" when the player was saving their game, and remove the perks from the save, then adding them back again afterwards. While this was possible for regular saves and console saves, it was not so for quicksaves, autosaves, or scripted saves.<br /><br />Once FOSE v2 is released, it will be possible to create a plugin that can detect autosaves, and activate all Activators within a dummy cell before and after a quicksave is created. This could be used to utilise "save-catching" in a mod so that an uninstallation method is not (necessarily) required. However, such a method ''would'' require FOSE, and some perks may need to be set up a little differently so that there aren't any bugs when they are added back after saving.<br />-- [[User:Cipscis|Cipscis]] 22:39, 16 April 2009 (UTC) | ||
:::::Thanks, fixed the showmessages! The save-catching method sounds the best so far: a best-practice version of the code would be a great resource, especially after the release of FOSE v2. I guess ideally the code should fail back to just doing it for regular saves if FOSE isn't installed, if that could be detected. |