Difference between revisions of "SetLevel"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Maturin
(No difference)

Revision as of 14:34, 1 March 2006

Syntax:

SetLevel iNewLevel, LevelToPCFlag, MinLevel (optional), MaxLevel (optional)

Example:

SetLevel 10     ; sets the actor's level to 10
SetLevel 2, 1   ; sets the actor's level to PC+2
SetLevel 0, 1, 6, 0    ; sets the actor's level to PC+0, min 6, no maximum

For NPCs and Creatures, this function allows you to completely change their level as well as whether they are leveled to the player or not.

  • LevelToPCFlag == 1 means that level is an offset to the player's level
  • LevelToPCFlag == 0 means that level is a straight level (also that Min and Max params are meaningless)

MinLevel and MaxLevel correspond to the Calc Min and Calc Max settings on the NPC and Creature tabs in the editor.

Calling SetLevel will also immediately recalc an actor's stats and equipment (as if the player just leveled up).

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 AdvancePCLevel instead.

See Also

AdvancePCLevel