Difference between revisions of "AddPerk"

174 bytes removed ,  14:56, 16 April 2009
m
→‎Notes: It's meant to be a simple note: this is the simplest way. Other, more complex ways, can be put on their own pages.
imported>Cipscis
m (terminology + token clarification)
imported>DewiMorgan
m (→‎Notes: It's meant to be a simple note: this is the simplest way. Other, more complex ways, can be put on their own pages.)
Line 15: Line 15:
* Loading a savegame in which the player has a mod-ceated perk, when the mod that created it is no longer installed, may crash the game. If you know the FormId of the Perk, you can remove it from yourself using the console. Modders are also strongly advised to provide an in-game means for players to remove perks, should they wish to uninstall.
* Loading a savegame in which the player has a mod-ceated perk, when the mod that created it is no longer installed, may crash the game. If you know the FormId of the Perk, you can remove it from yourself using the console. Modders are also strongly advised to provide an in-game means for players to remove perks, should they wish to uninstall.


One way is to add a zero weight token (an unplayable, therefore invisible, piece of armour) to the player: first, an item called, eg "ExampleToken", with an "object" type script like the following is created:
One simple way is to provide an "uninstaller" esm file, that the user must install, load their game, and save it, before they remove the mod. The esm will do nothing but remove the perks, and contains one quest, "PerkRemovalQuest", set to "start game enabled", with a Quest-type script:
    ScriptName ExampleTokenScript
   
    Begin OnAdd player
        player.AddPerk ExamplePerk
    End
    Begin OnDrop player
        player.RemovePerk ExamplePerk
    End
Then a quest called, eg "ExampleQuest" is created and set to "start game enabled", with a "quest" type script:
     ScriptName ExampleQuestScript
     ScriptName ExampleQuestScript
      
      
     Begin GameMode
     Begin GameMode
         player.addItem ExampleToken 1
         player.AddItem ExampleBook 1
        player.AddPerk ExamplePerk
         StopQuest ExampleQuest
         StopQuest ExampleQuest
     End
     End
Anonymous user