Jump to content
IGNORED

Interesting un or poorly documented NVSE commands


Recommended Posts

Undocumented NVSE Commands

 

I've been poking through the NVSE source looking for commands that are available but not discussed in the GECK wiki, nor in the out of date documentation on silverlock. Here are some of the more interesting ones I've found.

 

Misc functions

- MessageEx string arg arg ... arg

This basically works like showmessage except you do not have to create the MESG in the GECK, and supports all the nvse string substitution (printf style) arguments. Example: MessageEx "%n is using %pp %n" actorREF actorREF weaponREF would result in something like "Veronica is using her power fist". I use this now in SexoutNG and in SexoutNotify.

 

- MessageBoxEx - same as MessageEx, but displays in a game-pausing box with an 'OK' button.

 

- ListClear listref (clears the given list of all entries) does not seem to work reliably.

 

- ref.GetScript

- ref.IsScripted

- ref.RemoveScript

- ref.SetScript

- ref.GetObjectEffect

Five more very interesting commands for the creative modder. With these you could do things like copy a script from one item to another. Not sure if it works only on base forms or what, haven't tried it, but seems interesting.

 

- SetDebugMode 0 or 1

- DebugPrint

SexoutNG uses this now to spam the console less. Lets you leave all the print statements in, but disable them through a knob such as an MCM setting. In the console, SetDebugMode takes an additional argument (the mod index) so you can turn it on and off for specific mods. In a script within your mod, it only affects your mod.

 

Game settings

- GetNumericGameSetting string

Returns the value (a float) for a game variable, the ones available in gameplay -> settings in the GECK.

 

- SetNumericGameSetting string float

Sets the game setting to the specified value.

 

 

 

These are fairly interesting, because there are a lot of settings there that, without these functions, can only be inspected or modified by changing them in the GECK and saving them with your ESP / ESM. They do affect the entire game, so using them in an isolated context is impossible unless you are very careful.

 

There are a lot of interesting settings there though, most of them undocumented and undiscussed.

 

 

 

- GetNumericINISetting / SetNumericINISetting. Same as the GameSetting functions above, but for the INI file I suppose, have not investigated.

 

- CloneForm / TempCloneForm item. Given an item, these will clone it and return a new BASE FORM. The 'Temp' variation will not save the new base form in save games. Looks like it only works on items, not other form types like formlists, spells, etc.

 

 

Math functions

- Exp x:float

- Log10 x:float

- Floor x:float (Nearest whole number <= x)

- Ceil x:float (Nearest whole number >= x)

- Pow x:float y:float (x^y)

- Fmod x:float y:float (floating point modulus, x MOD y)

- Rand x:float y:float (returns a random float between x and y.)

 

Bitwise functions - Despite the names, these are bitwise operators, not boolean logical operators.

- LeftShift x:int y:int (shifts X left by Y)

- RightShift x:int y:int (shifts X right by Y)

- LogicalAnd x:int y:int (bitwise AND of x and y. C '&')

- LogicalOr x:int y:int (bitwise OR of x and y. C '|')

- LogicalXor x:int y:int (bitwise XOR of x and y. C '^')

- LogicalNot x:int (bitwise compliment of x. C '~', compliment)

- SetBit x:int y:int (sets bit Y of X to 1. Y is optional, may set all bits on?)

- ClearBit x:int y:int (sets bit Y of X to 0.)

 

 

Link to comment

ref.GetType might be quite useful as well for the scanners and such

 

It's a useful function no doubt, but:

1. It's documented pretty well.. ;)

 

2. The scanners use GetFirstRef which takes a type argument itself, so they already only scan for NPCs (or whatever they are scanning for).

 

;)

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...