Jump to content

Recommended Posts

File Name: NVSE Extender

File Submitter: prideslayer

File Submitted: 04 Feb 2013

File Category: Other

 

I am uploading this on prideslayer's behalf since he is currently inactive.

I am happy to present to you loyal LL minions my custom NVSE build, and the NVSE extender. This is a plugin for NVSE, providing new script functions for modders, and a custom build of NVSE with save/load support.

 

!!! NOTICE !!!

Make sure you install the latest BETA of NVSE. As of now, that is NVSE V3 beta 2, available here.

 

Thank you all for participating in the custom NVSE experiment, with almost 4000 downloads prior to me removing it, and almost no reported problems beyond the nogore hiccup!

!!! NOTICE !!!

Extender Version: 11

- Added exception handling and logging.

Released: 25-Aug-2012

 

Project source code: nvseex@sourceforge

 

What does it do?

NVSE Extender provides additional functions available to modders. Some will provide information via the console as well. It uses the save/load notifications to save (and load!) its data whenever the game is saved.

 

How do I install it?

Install NVSE (v3b2 or newer) as normal, simply extract all the files to your fallout new vegas directory.

Install the extender by extracting the DLLs to the data/nvse/plugins directory.

 

What functions are available?

There are eight functions available at present. You may see others if you examine the DLL under a microscope. Do not use them. Only use the published interface. Using anything else WILL cause the mods using it to break in an entirely unpredictable fashion.

 

Current implemented function list:

 

 

NX_GetVersion

Available since: V1

- Returns an integer representing the version (release #), starting from 1.

 

int (ref.)NX_IsUsingSkeleton name:string (actor:ref)

Available since: V1 Fixed in V6, thanks Ashmedai

- Given a skeleton name fragment and an actor reference (player, NPC, or creature), returns the 1 if the actor is using a skeleton in that directory, 0 otherwise. The directory fragment must match the subdirectory under meshes, and is not case sensitive.

player.NX_IsUsingSkeleton "_male" ; will return 1player.NX_IsUsingSkeleton "nvgecko" ; will return 0RexREF.NX_IsUsingSkeleton "_male" ; will return 0RexREF.NX_IsUsingSkeleton "dog" ; will return 1
int NX_IsInList list:formlist item:object (recurse:int)

Available since: V1 Fixed in V5

- Given a formlist and an item (base object, reference, or dynamic reference), will return 0 if the item is not in the list at all, or a value greater than 0 indicating how the object was found. The recurse flag is an optional integer that should be 1 or 0. It is currently not implemented. In the future, it will search formlists contained within formlists.

 

0 : item not in list.

1 : item in list exactly.

2 : base form of item in list.

3 : item is a baseform of another item in list.

4 : base form of item is the same as base form of another item in list.

 

Take the following three vars:

set itemA to AcousticGuitarset itemB to player.placeatme AcousticGuitar 1set itemC to player.placeatme AcousticGuitar 1
And two formlists. List1 contains itemA, list2 contains itemB.

 

"NX_IsInList List1 itemA" and "NX_IsInList List2 itemB" will both return 1.

"NX_IsInList List1 itemB" will return 2.

"NX_IsInList List2 itemA" will return 3.

"NX_IsInList List2 itemC" will return 4.

 

Notes on the SetEV* and GetEV* functions:

1. The persist flag, as yet, does nothing. These values are saved with savegames will persist across game sessions.

 

2. The keys are NOT shared between types. You can safely store a float and a form both under the key 'my key' and they will not overwrite one another. Internally they are stored in entirely separate arrays (maps actually), one per "type."

 

(ref.)NX_SetEVFl key:string value:float (persist:int)

Available since: V3

- Stores a floating point value with a reference. 'key' is the name for the value used in the SET and GET functions. 511 character maximum.

playerREF.NX_SetEVFl "test value" 3.1415 0
Will create the variable 'test value', associated with the player, and set it equal to 3.1514. This is basically the same thing as an associative array in perl, php, java (via an object), etc. As yet, there is no key iterator.

 

(ref.)NX_GetEVFl key:string

Available since: V3

- Retrieves a floating point value set via the above syntax. Will return 0 if the value has never been set.

 

(ref.)NX_SetEVFo key:string value:form (persist:int)

Available since: V3 (Fixed in v9)

- See NX_SetEVFl above. This is the same, but stores a form instead (reference, base, or dynamic).

 

(ref.)NX_GetEVFo key:string

Available since: V3

- See NX_GetEVFl above. This is the same but retrieves a form.

 

(ref.)NX_GetConversationPartner

Available since: V7 Thanks a ton, jaam!

- Returns the current conversation partner if in a conversation AND the NPC initiated the conversation via StartConversation topic. Only makes sense when called on the player. Only works in MENUMODE blocks, as that is where conversations happen. To use in gamemode scripts, just create a menumode block that calls it fairly often and stores the result in a quest var that you can use in GAMEMODE blocks.

someref.startconversation sometopic; wait a bit, and be in a menumode blockref = player.NX_GetConversationPartner; ref now == someref
(ref.)NX_ClrEVFl key (match)

Available since: V9

- Clears out the key on ref.

- Match is optional. If set to 2, clears all keys starting with the one you specify, e.g. "mymod" will clear all keys starting with the string "mymod".

 

(ref.)NX_ClrEVFo key (match)

Available since: V9

- Same as NX_ClrEVFl, but for the form vars.

 

 

 

Can I include this with my mod, upload it elsewhere, etc?

Sure. You can do whatever you want with it.

 

If you screw up your players by installing an older version than they already have, you deserve a slap. If you upload it somewhere else and claim to be the author, you can field the bug reports and write the fixes, while rotting in hell.

 

I'm all about letting people do whatever they want with stuff I create, but be responsible about it and don't be a dick.

 

What does the future hold?

Many other functions are planned, they are discussed here. Also, Ian of the NVSE team has expressed interest in integrating some of the functionality into core NVSE once they are less busy, and I've agreed to furnish him with the source code to do that.

 

Sourcecode is available on sourceforge.

 

 

Click here to download this file

Link to post

Just an fyi prideslayer, I'm not complaining mind you, but you might want to check compatibility with the 4GB executable that the NVSE team supplies, I tried loading up FONV with your plugin in the NVSE/Plugins directory with the 4GB extender and I got the infinite loading screen error. Of course it might be the mods I'm running too, never know. Keep up the great work!

Link to post

Just an fyi prideslayer' date=' I'm not complaining mind you, but you might want to check compatibility with the 4GB executable that the NVSE team supplies, I tried loading up FONV with your plugin in the NVSE/Plugins directory with the 4GB extender and I got the infinite loading screen error. Of course it might be the mods I'm running too, never know. Keep up the great work!

[/quote']

 

Can you test further and let me know? I never got that 4GB thing to work right anyway, not for lack of trying. I have 16GB of memory in my machine and would love for fallout to take advantage of more, but the 4GB loader from NVSE did not seem to work properly when I tried it.

Link to post

V3 coming soon. I have the "extended actor value" for floats working. This allows you to store any number of named floats with a ref. Using pregnancy as an example (since it's a good -- and bad -- example for this):

 

playerREF.NX_SetEVFl "pregnancy stage" 2.1

 

Will create a new internal value on the player named "pregnancy stage" and set to 2.1.

 

It can be retrieved (by the mod that set it or any other) via:

float myFloat
set myFloat to playerREF.NX_GetEVFl "pregnancy stage"

 

(that is a lower case L, for Float, btw)

 

Similar functions are coming for formIDs and strings.

 

That's the good news.

 

The bad news: I currently have no "good" way to keep these values around between saves. I can read and write them to a file easy enough, but right now I have no way to know if a savegame has been loaded, and if so, what it's name/ID is -- the last part is the important part.

 

Unfortunately, the save/load hooks and serialization are documented in the NVSE plugin API, but they never actually made in from FOSE into FONV. I'll ask them to add them in, but they're very busy with skyrim stuff. Until they do or I figure out a solution to this mess myself, they can at least serve as a way to set/get values within a mod or between mods during a given "run" without needing to add variables or set mods as masters to each other.

 

 

Link to post

Glad to hear that Chase! Let me know if there is anything else I can add for you, in this thread or the other one. I have a fairly long todo list already in the other thread, but the more ideas that come up the better!

Link to post

V3 plugin in OP.

 

What's new:

 

Notes on the SetEV* and GetEV* functions:

1. The persist flag, as yet, does nothing. These values will not persist across game sessions. They WILL persist across loads in a single session. I advise you resetting any values you use in a "GetGameLoaded || GetGameRestarted" block for now. If that is too cumbersome (and I expect it will be), I will provide a "clearEVs" call.

 

2. The keys are NOT shared between types. You can safely store a float and a form both under the key 'my key' and they will not overwrite one another. Internally they are stored in entirely separate arrays (maps actually), one per "type."

 

(ref.)NX_SetEVFl key:string value:float (persist:int)

Available since: V3

- Stores a floating point value with a reference. 'key' is the name for the value used in the SET and GET functions. 511 character maximum.

playerREF.NX_SetEVFl "test value" 3.1415 0

Will create the variable 'test value', associated with the player, and set it equal to 3.1514. This is basically the same thing as an associative array in perl, php, java (via an object), etc. As yet, there is no key iterator.

 

(ref.)NX_GetEVFl key:string

Available since: V3

- Retrieves a floating point value set via the above syntax. Will return 0 if the value has never been set.

 

(ref.)NX_SetEVFo key:string value:form (persist:int)

Available since: V3

- See NX_SetEVFl above. This is the same, but stores a form instead (reference, base, or dynamic).

 

(ref.)NX_GetEVFo key:string

Available since: V3

- See NX_GetEVFl above. This is the same but retrieves a form.

 

Link to post

Hmm OBSE persists itself by having a save file with the extension .obse with the same name as the .ess save file. Seems fose and nvse don't...

 

FOSE has something similar, but it has callback hooks as well that don't actually "exist" in NVSE. The code is mostly there, but either commented or ifdef'd out -- so I don't know if it works or not, and even if it does, enabling it would mean I'd have to release my own copy of NVSE.

 

Ian said the hooks were never implemented in NVSE due to lack of demand.

 

I just need to be notified (or be able to detect through polling) when a game is saved or loaded, and at a minimum, what that games savegame # is. That's enough for me to make things persist and stay associated with a save. Right now, I'm not sure there is any way to do that.

 

Worst case I could monitor the savegame directory which would tell me when things are saved (modified / created date), but it doesn't help me determine if/when a save was loaded.

Link to post

If you're interested.. in the NVSE and FOSE source.. Hooks_SaveLoad.cpp/h.

 

ianpatt said in the beth forum that he could reactivate those if needed. You may ask him.

Also don't hesitate to ask DragoonWraith if he started on porting NIFSE, you will need it if you want update3D as far as I know.

 

Link to post
V4 download in OP.

NX_IsInList fixed.

 

This should fix the creature issues with the current beta release of SexoutNG' date=' and anything else using this plugin.[/quote']

Cool, will look at changing to use it when I finish my battle with MCM implementation today :)

 

Link to post

V5 download in OP.

 

NX_IsInList fixed (for real this time(*)).

 

This should fix the creature issues with the current beta release of SexoutNG, and anything else using this plugin (for real this time(*)).

 

(*)I still need to go back and make a similar fix for HUMANS. This is not nearly as pressing an issue as creatures, but the fact remains if you have a human NPC coming from a leveled list or something like that, and try to find them in a formlist that has just their baseforms etc, it (probably, did not test) is not going to find them.

 

 

 

Link to post

Cant play.

No load, continue or new games in first main screen.

I dont have NVSE folder, so i make one, and i make plugins folder and put nvse_extender.dll.

But it's the only one file in the nvse/plugins folder.( or data/nvse:empty, exept plugins folder)

NVSE is install in data folder manually, i have just copy/paste in it....

 

when the first time you make "common ressource", i never can play the game, always stuck in title screen.

 

I'll searh again, i remember you make good work.(But it's complicated now, a lot of mods, requires, loads orders, i have probbly old files, news, i dont know what's files is good or not, what's compatible... -.-)

 

But if i'm wrong with NVSE install say it, i hope it's only that (maybe i need to delete NVSE and install ir with a floder complete whit more file than one (nvse_extender.dll here.))

 

Bye bye..

Link to post

That is the only dll that should be there unless you have other nvse plugins installed. It's the directory for nvse plugins, not for nvse itself.

 

Try it without any mods loaded at all, then enable them one by one. Your issue sounds like a general mod issue, not anything to do with NVSE or with this plugin.

Link to post
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...