Difference between revisions of "SetLevel"

475 bytes added ,  13:16, 13 July 2010
m
imported>Geckbot
m (Robot: Automated text replacement (-\[\[Category:(.*?)\(GECK 1.0\)\]\] +Category:\1(GECK 1.1)))
imported>Talkie Toaster
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''Syntax:'''
'''Syntax:'''
  SetLevel iNewLevel
  SetLevel iNewLevel, LevelToPCFlag, MinLevel (optional), MaxLevel (optional)
In theory, if the LevelToPCFlag is set to 1 then the level provided is an offset to the player's level, which will not take their level above or below the provided maximum and minimum levels. In practise, the function does not work correctly when called on NPCs- SetLevel will often (if not always) set their level to the provided MinLevel, disregarding any level offset, maximum or anything else.


NOTE: This function can be called on the player and will change the player's level, but not any of his stats (and the world will not "level up" with the player), so this is not recommended. Use [[RewardXP]] instead.
This function can be called on the player and will change the player's level, but not any of his stats (and the world will not "level up" with the player), so this is not recommended. Use [[RewardXP]] instead.


===Notes===
===Notes===
Calling SetLevel on an actor other than the player will cause that actor's inventory to be regenerated. Any existing items will be removed and a fresh inventory will be generated, re-evaluating any leveled lists that may make up the actor inventory. You can witness this in action by finding a random raider and calling setlevel on them via the console. They will usually end up wearing a different piece of armor, because their inventory was repopulated.
Calling SetLevel on an actor other than the player will cause that actor's inventory to be regenerated, re-evaluating any leveled lists that may make up the actor inventory. You can witness this in action by finding a random raider and calling setlevel on them via the console. They will usually end up wearing a different piece of armor, because their inventory was repopulated. This repopulation effect takes effect even if the SetLevel command did not change the actor's level.


[[Category: Functions]]
[[Category: Functions]]