AddPerk

From GECK
Jump to: navigation, search


A function included in the GECK for Fallout 3.

Description

Increments the rank of the specified Perk on the calling Actor. If actor doesn't already have the perk, it will be added with rank 1.

  • When called on the Player character, this function will add the perk to the player, unless the optional argument forTeammates is non-zero, in which case it will add the perk for all teammates.
  • When called on any actor other than the player, this function will work correctly only if the uNPCPerks optional JIP LN feature is toggled in Data\NVSE\plugins\jip_nvse.ini.

Syntax

[help]
ActorRef.AddPerk perk:form forTeammates:0/1

Example

Player.AddPerk LittleSlugger

The Player now has the benefits of the little slugger perk.

Player.AddPerk LittleSlugger 1

The Player's teammates now have the benefits of the little slugger perk.

ActorRef.AddPerk LittleSlugger

ActorRef now has the benefits of the little slugger perk.

Notes

  • In Fallout: New Vegas, the Player is implemented as a special Actor type that has additional capabilities, including having perks. The Player has two lists of perks, one list which applies to the Player and one list which is applied to all current Teammates (GetPlayerTeammate == 1). Perks for companions can be added to the Player via Player.AddPerk PerkEditorID 1. Perk entry points can be given conditions such as GetIsID if their effects should not apply to all companions. Perk requirements have no affect on companion perks and only apply to the players ability to take the perk at level up. Abilities in a perk should also be conditioned to check for GetPlayerTeammate == 1 or GetIsID.
  • Finally, if a companion is fired and rehired or another companion is hired, any companion perks must be removed (Player.RemovePerk PerkEditorID 1) from the player and readded to force a re-evaluation of the perks effects, and any abilities the perk adds.
  • With Fallout 3 version 1.4 or older: Loading a savegame in which the player has a mod-created perk, when the mod that created it is no longer installed, may crash the game. That issue was fixed in Fallout 3 v1.5. If you know the FormId of the Perk, you can remove it from yourself using the console. Modders are also advised to provide an in-game means for players to remove perks, should they wish to uninstall while keeping older versions of FO3, or at least provide instructions on how to remove the perks. 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, called something like "MyPerkRemovalQuest", set to "start game enabled", with a Quest-type script:
   ScriptName MyPerkRemovalQuestScript
   
   Begin GameMode
       player.RemovePerk MyExamplePerk
       StopQuest MyPerkRemovalQuest
   End

See Also