[RELz] Oblivion Script Extender (OBSE) 0019

Post » Mon Nov 01, 2010 4:20 pm

Please note: OBSE 0019 has been updated to 0019a to fix an issue with stolen items. Please upgrade to the latest version.

Continuing from the http://www.gamesas.com/index.php?/topic/1118838-relz-oblivion-script-extender-obse-0018//.

The Oblivion Script Extender, or OBSE for short, is a modder's resource that expands the scripting capabilities of Oblivion. It doesn't make any modifications to oblivion.exe, TESConstructionSet.exe, or any other files in your oblivion install, so don't worry about permanent side effects. As of v0017, OBSE requires the 1.2.0.416 version of Oblivion.

http://obse.silverlock.org/download/obse_0019a.zip - current version
http://obse.silverlock.org/
http://obse.silverlock.org/obse_command_doc.html - newly reformatted documentation

0019 is now available for general use. Many thanks to the modders and testers who helped shape this release.

What's new:
Spoiler
0019:
-GetAllModLocalData
-Optional flag to RunScriptLine and RunBatchScript allows suppression of console output during script execution
-Suppress editor warning about unquoted string when using the '->' operator
-Add 'type' field to array returned by GetPackageData
-GetBaseAVForActor now works for all actor values defined on base actors
-Fix GetCellChanged command not reliably reporting cell transitions
-Fix editor CTD associated with a buffer overrun bug present in the unmodified Construction Set
-GetFirst/NextRef now support extremely large worldspaces
-Prevent OnHitWith events from being reported to event handler scripts twice per event
-Fix issues with GetBarterItem
-GetPackageData now includes a 'Type' field indicating the package type
-Various miscellaneous tweaks and bug fixes

0019 beta 4:
-GetWeatherOverride
-GetPackageType
-RemoveModLocalData
-ClearActiveQuest
-GetCurrentEventName
-Get/SetLightRGB
-GetTransactionInfo
-PrintActiveTileInfo
-MagicEffectCodeFromChars
-Fix potential vanilla buffer overrun when parsing commands entered at console (so-called '73-byte bug')
-Add OnActivate event handler support
-Event handlers can now be used with non-actor references
-Add PostLoadGame event handler
-GetActiveMenuSelection correctly recognizes and returns scrolls in magic menu
-GetInputText takes an optional argument to strip HTML from the returned string
-Make game preserve ownership data on inventory references
-Inventory references now correctly handle large quantities of items in a single stack
-Fix potential CTD in AddToLeveledList if called with an invalid list
-Updates to serialization of array/string variables
-Fix potential CTD if GetBarterItem called while a transaction is in progress
-SetClassSkills2 now works as advertised

0019 beta 3:
-GetClassMenuSelected/HighlightedClass
-GetEnchMenuBaseItem
-IsQuestCompleted, UncompleteQuest
-GetRaceHairs/Eyes, GetRaceDefaultHair
-GetInvRefsForItem
-Update plugin API to allow calling user-defined function scripts from plugin code
-Allow plugins to accept array variables by ID as command arguments
-Expand plugin array variable interface
-Fix incorrect number of parameters for SetPCAttributeBonusC
-Fix potential crash when saving after iterating over inventory references
-GetFirst/NextRef now ignore partially-loaded references
-Fix issue with ToggleSpecialAnim
-Misc. fixes and tweaks

0019 beta 2:
-RemoveEventHandler
-GetBookLength
-Get/Set/ModGoldValue now return correct values for alchemy items
-ar_Map and ar_List now accept up to 20 elements
-Fix potential crash when passing strings to script commands
-Fix issue with token/activator scripts which could cause Super Hotkeys to stop functioning

0019 beta 1:
-Inventory reference-walking functionality
-GetMagicEffectChars©
-Getters/Setters for spell flags
-Get/SetActiveQuest
-GetCurrent/CompletedQuests
-Commands for getting and setting location/target/schedule data for AI packages
-ar_Map, ar_Append
-Get/SetTexturePath
-Get/Set/ModSigilStoneUses
-SetDescription
-SetCreatureSoundBase
-GetBoundingBox
-Update3D
-Commands for getting information about the most recent barter transaction
-Commands for getting information about the quantity menu
-IsEquipped
-Get/SetPCAttributeBonusC
-RemoveMeIR, CopyIR
-CreateTempRef
-GetCellChanged
-SetClassSkills2
-Commands for getting information about the most recent Sigil Stone enchantment
-New operators: unary*, unary&, ::, ->
-Updates to plugin API
-New, more readable command documentation format (courtesy of TheMagician)
-Allow use of SetModelPath with creatures and NPCs
-Allow user-defined functions to be called from within array elements
-IsOffLimits uses player by default if argument omitted
-Move SetScript out of beta status
-SetEventHandler
-Linear Algebra functions
-Commands for manipulating actor value modifiers
-Miscellaneous bug fixes and tweaks


Readme (abbreviated):
Spoiler
Oblivion Script Extender v0019
by Ian Patterson, Stephen Abel, and Paul Connelly
(ianpatt, behippo, and scruggsywuggsy the ferret)

Additional contributions from Timeslip, The J, DragoonWraith, SkyRanger-1, badhair, JRoush, shademe, and kyoma.

The Oblivion Script Extender, or OBSE for short, is a modder's resource that expands the scripting capabilities of Oblivion. It doesn't make any modifications to oblivion.exe, TESConstructionSet.exe, or any other files in your oblivion install, so don't worry about permanent side effects. It is compatible with the 1.2.0.416 Oblivion patch, as well as the 1.2 version of the Construction Set. Versions of Oblivion downloaded via Steam are supported as well.

[ Installation ]

If you are using a retail (non-Steam) version of the game:

1. Copy obse_1_2_416.dll, obse_editor_1_2.dll, and obse_loader.exe to your Oblivion directory. This is usually in your Program Files folder, and should contain files called "Oblivion.exe" and "OblivionLauncher.exe".
2. Run oblivion by running obse_loader.exe from the Oblivion directory.

If you use a desktop shortcut to launch Oblivion normally, just update the shortcut to point to obse_loader.exe instead of oblivion.exe.

If you are using the Steam version of the game:

1. Copy obse_1_2_416.dll, obse_editor_1_2.dll, and obse_steam_loader.dll to your Oblivion directory. This is usually "C:\Program Files\Valve\Steam\SteamApps\common\oblivion".
2. OBSE will automatically be run along with Oblivion when launched. To disable this, rename or move obse_steam_loader.dll. You do not need to use obse_loader.exe unless you are running the editor.

Scripts written with these new commands must be written via the TESConstructionSet launched with obse_loader. Open a command prompt window, navigate to your oblivion install folder, and type "obse_loader -editor". The normal editor can open plugins with these extended scripts fine, it just can't recompile them and will give errors if you try.

For mod developers:
  • http://home.comcast.net/~scruggsyW/obse/ScriptViewer.zip - View offsets into compiled scripts to help debug errors reported by OBSE at run-time

User avatar
leni
 
Posts: 3461
Joined: Tue Jul 17, 2007 3:58 pm

Post » Tue Nov 02, 2010 12:32 am

Thank's Guys. been waiting for This! :celebration:
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Mon Nov 01, 2010 4:25 pm

congrats on the new release.
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Mon Nov 01, 2010 10:43 pm

Always good to see your stable releases, instant install. :foodndrink:
User avatar
Terry
 
Posts: 3368
Joined: Mon Jul 09, 2007 1:21 am

Post » Mon Nov 01, 2010 3:50 pm

A monumental release :cake: Any special plans for OBSE's 20th release ? 'Tis a special occasion after all :D
User avatar
Emma louise Wendelk
 
Posts: 3385
Joined: Sat Dec 09, 2006 9:31 pm

Post » Mon Nov 01, 2010 9:50 am

Congratulations on the release! I've been looking forward to it. Now I just need to finish up my new scripts...

Any special plans for OBSE's 20th release?

http://www.lua.org/about.html support! :hubbahubba:
(No, not really, I have no idea what's in the pipeline.)
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Mon Nov 01, 2010 10:27 am

With the new "User Defined Function" - do all scripts have to be object scripts? Will it still work with, say, quest scripts?
User avatar
Lalla Vu
 
Posts: 3411
Joined: Wed Jul 19, 2006 9:40 am

Post » Mon Nov 01, 2010 3:04 pm

Why would you define a User Defined Function as a quest script? It doesn't do anything until it's called anyway. I've called them from quest scripts, no problem.
User avatar
Russell Davies
 
Posts: 3429
Joined: Wed Nov 07, 2007 5:01 am

Post » Mon Nov 01, 2010 12:44 pm

Maybe I misunderstood what the feature does. Correct me if I'm wrong, but it allows you to call a totally separate script (x) from a script (y)? So I could write script x and, let's say it's too long to be compiled by the CS (which it is, the script I'm modifying now is too long for the CS) and call that script to be processed from script y.
User avatar
Josh Trembly
 
Posts: 3381
Joined: Fri Nov 02, 2007 9:25 am

Post » Mon Nov 01, 2010 5:33 pm

A User Defined Function is an Object script, so it starts with scriptname or scn as all other scripts do. However, in the body of the script you will have a function definition. The OBSE documentation has good examples of this, as does the CS wiki. In another script, whether it is a quest script or an object script, you would call your function when you need to do those actions.

The documentation uses a little Multiply function as an example. You would define that function exactly as they have listed, but it's an object function. In another script when you need to multiply something, you would just call that function. They use an example like this: let somevar := Call Multiply 10 5.

There's a really good example in the CS wiki. Do a search for ArrayDeepDump. If you want to use it, you'll have to fix a couple of minor errors, but it works really well. I use it to debug all my multi-dimensional arrays. So, in my other scripts (all quest scripts as it turns out), I simply type Call ArrayDeepDump args when I want to dump the contents of an array.

Basically a UDF is like any other OBSE function once you've defined it.
User avatar
Lou
 
Posts: 3518
Joined: Wed Aug 23, 2006 6:56 pm

Post » Mon Nov 01, 2010 6:33 pm

Thanks for the release :foodndrink:

Now I must hurry and finish up Enhanced Economy 5.0, which I postponed for the official OBSE 19 release...

Maybe I misunderstood what the feature does. Correct me if I'm wrong, but it allows you to call a totally separate script (x) from a script (y)? So I could write script x and, let's say it's too long to be compiled by the CS (which it is, the script I'm modifying now is too long for the CS) and call that script to be processed from script y.
Yes you can.

Script x must be defined as an object script, but can by called from anywhere, from a quest script, a magic effect script, from a quest stage script or whatever, and don't need any object reference. E.g
ScriptName maxfloat xfloat yBegin Function {x, y}{  if x > y    SetFunctionValue x  else     SetFunctionValue y  endif}


Can be called from anywhere, with the line:
set maxValue to Call max a, b

User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Mon Nov 01, 2010 1:08 pm

Yeeeeeeeee! :celebrate:

[edit]
Oh, and a question. How would I go about returning an empty array? Atm I got a QuestTargets function but it could happen that the quest doesn't have any (valid) quest targets. And if so, the (intermediary) vector is empty and calling ArrayFromStdVector causes a crash (makes sense as it tries to access &data[0]). Obviously I can check for this but then I'd still need a way to create an array with no elements. :(
[/edit]
User avatar
Adam Porter
 
Posts: 3532
Joined: Sat Jun 02, 2007 10:47 am

Post » Mon Nov 01, 2010 11:42 pm

Pass a size of zero.
OBSEArray* ArrayFromStdVector(const std::vector& data, Script* callingScript){	OBSEArray* arr = g_arrayIntfc->CreateArray(data.size() ? &data[0] : NULL, data.size(), callingScript);	return arr;}

User avatar
Taylah Haines
 
Posts: 3439
Joined: Tue Feb 13, 2007 3:10 am

Post » Mon Nov 01, 2010 2:19 pm

Thanks for the new version.

By the way, you may recall I previously reported an issue with OBSE 0018 and Mannimarco Revisited. With your help we determined that when running OBSE 0018, Mannimarco Revisited, and Oblivion Stutter Remover with bReplaceHeap = 1 set in the OSR ini file, the game will consistently CTD after the animation plays when you loot Mannimarco's corpse. The problem didn't occur when running OBSE 0017.

I tested the same scenario with the release version of OBSE 0019 last night and the CTD still occurs. In this case there is obviously a workaround: save game right before looting corpse, change OSR ini file to set bReplaceHeap = 0, launch Oblivion, loot corpse, save game, set bReplaceHeap = 1, launch Oblivion. In combination with other performance tweaks the bReplaceHeap setting makes my game much more stable in just about all other ways so I normally leave it on except for this obvious case.

I just wanted to mention that I've confirmed the issue is still outstanding in 0019. Hopefully if others encounter the same problem this workaround will help until such time as a more permanent fix is found.
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Tue Nov 02, 2010 12:02 am

Thanks for the new version.

By the way, you may recall I previously reported an issue with OBSE 0018 and Mannimarco Revisited. With your help we determined that when running OBSE 0018, Mannimarco Revisited, and Oblivion Stutter Remover with bReplaceHeap = 1 set in the OSR ini file, the game will consistently CTD after the animation plays when you loot Mannimarco's corpse. The problem didn't occur when running OBSE 0017.

I tested the same scenario with the release version of OBSE 0019 last night and the CTD still occurs. In this case there is obviously a workaround: save game right before looting corpse, change OSR ini file to set bReplaceHeap = 0, launch Oblivion, loot corpse, save game, set bReplaceHeap = 1, launch Oblivion. In combination with other performance tweaks the bReplaceHeap setting makes my game much more stable in just about all other ways so I normally leave it on except for this obvious case.

I just wanted to mention that I've confirmed the issue is still outstanding in 0019. Hopefully if others encounter the same problem this workaround will help until such time as a more permanent fix is found.

Isn't that an issue with OSR rather than with OBSE?
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Mon Nov 01, 2010 4:56 pm

Isn't that an issue with OSR rather than with OBSE?


If the behavior occurred in all versions of OBSE I would agree, however the problem was introduced with the release of OBSE 0018+ and isn't present when using OBSE 0017. Since the changes to OBSE introduced the behavior scruggs indicated he was going to try to track down the cause at some point.
User avatar
Richus Dude
 
Posts: 3381
Joined: Fri Jun 16, 2006 1:17 am

Post » Mon Nov 01, 2010 3:24 pm

Excellent work!

You all deserve a break, but would it be possible to visit PickIdle and other animation functions for V20?

I'd love something better than pickidle to force an animation, or even a way of finding the animation an actor is currently running. Unless I'm being dumb, there seems to be a lot of things you just can't control or determine.
User avatar
Devils Cheek
 
Posts: 3561
Joined: Sun Aug 13, 2006 10:24 pm

Post » Mon Nov 01, 2010 4:49 pm

I have a wired bug with obse 19 some items for example sack cloth pants disappear and reappear from my inventory when I load different saves. They are still rendered on my character but they don't appear in my inventory. (Reinstalling obse 18 fixes the problem.)

For example if I load save A my pants are gone from the inventory but I can still see them on my character, then I enter a shop they still aren't there but then I load the auto save and there they are, then I exit the shop and the pants are still in my inventory. Then I load the auto save and the pants are gone again.

I tried removing all the mods I have installed lately and then using obse 19 but it doesn't help. The reasoning behind removing the mods being that its a mod making use of obse 19 functions that is causing the problem and that the mod stops working when I switch back to obse 18 thus resolving the issue.
User avatar
Queen
 
Posts: 3480
Joined: Fri Dec 29, 2006 1:00 pm

Post » Mon Nov 01, 2010 10:16 am

can't wait for the wave of new mods this will bring!
User avatar
stevie critchley
 
Posts: 3404
Joined: Sat Oct 28, 2006 4:36 pm

Post » Mon Nov 01, 2010 9:48 am

Congrats and thanks for v19.

The side effect of finishing a version is that it opens the gate for new requests:

Question is: what are the changes of having pathgrid node enabling/disabling functions in v20?
I am not asking for a commitment or anything, of course. Just your best judgment with the data available atm.

I would love to use them in the first version of my http://www.thenexusforums.com/index.php?/topic/83048-the-evolving-society-mod/ mod, expected to be released somewhere between OBSE v20 and v21, but I have alternative solutions, in case the functions are not developed.

I am mostly interested in knowing If the chances are slim to none, in which case I would need to start working on the alternative approach right away, as it is kind of complex and would take a couple of months to develop. If the chances are a "maybe" or better, I would take my chances and wait.
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Mon Nov 01, 2010 9:09 pm

I am mostly interested in knowing If the chances are slim to none, in which case I would need to start working on the alternative approach right away, as it is kind of complex and would take a couple of months to develop. If the chances are a "maybe" or better, I would take my chances and wait.

Give me a couple days to look into the relevant code. I expect it to be better than a maybe.
If the behavior occurred in all versions of OBSE I would agree, however the problem was introduced with the release of OBSE 0018+ and isn't present when using OBSE 0017. Since the changes to OBSE introduced the behavior scruggs indicated he was going to try to track down the cause at some point.

Yeah, that is the interesting part. We've had some other bug reports which suggest the bReplaceHeap option isn't 100% stable in all situations.
You all deserve a break, but would it be possible to visit PickIdle and other animation functions for V20?

I'd love something better than pickidle to force an animation, or even a way of finding the animation an actor is currently running.

A certain moderator among several others has been requesting stuff like this for a while. I'll be digging through the game code to try and fulfill those requests in 0020.
I have a wired bug with obse 19 some items for example sack cloth pants disappear and reappear from my inventory when I load different saves.

PM'ed. Do they all appear to be items you started the game with (wrist irons, cloth pants/shirt) or are others affected as well?
User avatar
Jennifer May
 
Posts: 3376
Joined: Thu Aug 16, 2007 3:51 pm

Post » Mon Nov 01, 2010 8:23 am

Give me a couple days to look into the relevant code. I expect it to be better than a maybe.

That’s is good enough for me.
No hurry, thou. As already said, you well deserve a break.
User avatar
Eileen Collinson
 
Posts: 3208
Joined: Thu Dec 28, 2006 2:42 am

Post » Mon Nov 01, 2010 10:33 am

I have a wired bug with obse 19 some items for example sack cloth pants disappear and reappear from my inventory when I load different saves.

I've seen something similar on the active effects page. For instance, when I was testing nGCD v2, at one point I noticed a birthsign bonus was missing from that screen. (Birthsigns were vanilla for the test, so no chance of mod involvement.) However, nGCD was still detecting the bonus, so this was definitely just a display glitch.

I recently installed MenuQue, so that was my first hunch as to a possible culprit, but I haven't done enough testing to know for sure. Morbid, do you have MenuQue?
User avatar
Mr.Broom30
 
Posts: 3433
Joined: Thu Nov 08, 2007 2:05 pm

Post » Mon Nov 01, 2010 8:23 am

Nice. Keep up the good work.
User avatar
kristy dunn
 
Posts: 3410
Joined: Thu Mar 01, 2007 2:08 am

Post » Tue Nov 02, 2010 12:18 am

A certain moderator among several others has been requesting stuff like this for a while. I'll be digging through the game code to try and fulfill those requests in 0020.

Excellent news. Thanks!
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Next

Return to IV - Oblivion