[Rel] Oblivion Script Extender (OBSE) 0021 Beta

Post » Sun Sep 09, 2012 11:28 pm

Continuing from the http://www.gamesas.com/topic/1390476-relz-oblivion-script-extender-obse-0020/

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/beta/obse_0021_beta_1.zip - current beta build, for mod and plugin developers
http://obse.silverlock.org/download/obse_0020.zip - current stable version, recommended for general use
http://obse.silverlock.org/
http://obse.silverlock.org/obse_command_doc.html - newly reformatted documentation

What's new:
Spoiler

0021 beta:
-SetCombatStylePowerAttackFatigueModMult
-HasTail, GatTailModelPath
-GetLuckModifiedSkill
-sv_ToUpper, sv_ToLower
-SetCellMusicType
-Get/SetSoundAttenuation
-GetStageIDs, GetStageEntries
-Set/UnsetStageText
-SetStageDate
-UpdateContainerMenu, UpdateSpellPurchasemanu
-LinkToDoor
-CopyRace
-SetCreatureType
-DispatchEvent
-Support for user-defined events
-ToggleSkillPerk supports Journeyman and Master Mercantile perks
-OnSoulTrap, OnSaveIni, OnMagicEffectHit2 events
-Pass string variables to vanilla commands using '$quest.stringVar' syntax
-MessageEX takes an optional duration, effective only if MenuQue plugin is running
-ModPCMovementSpeed and ModPlayerSpellEffectiveness accept an optional parameter indicating if their effects should persist in the savegame
-Fix recursive calls to *_NS commands not blocking message spam
-Combat style commands allocate memory for "advanced" settings if not already present
-Made annoying editor warning about unquoted strings/function pointers toggle-able through INI file (in the Data\OBSE folder)
-Plugin API allows authors to optionally avoid dependencies on GameAPI/Utilities header files
-Patch vanilla bug in which RemoveAllItems and GotoJail commands cause equipped quest item enchantments to become permanent
-New loader injection method for the editor
-Fix issue with PluginManager that caused a CTD when a plugin registered a listener inside a dispatch callback
-Updated project to Visual Studio 2010

0020:
-ToggleSkillPerk
-Fix compiler override using localized actor value strings
-Fix IsNthEffectItemScriptHostile returning inconsistent values
-Prevent equipping an item from generating multiple OnActorEquip events
-Prevent power-attacking generating multiple OnAttack events
-Fix GetActiveSpell returning zero if the player has not switched from the default starting spell
-Add compiler override support for script bytecode lengths exceeding 0x4000 bytes when using the CSE OBSE plugin
-Minor documentation fixes


Readme (abbreviated):
Spoiler
Oblivion Script Extender v0021 beta
by Ian Patterson, Stephen Abel, Paul Connelly and Madeesh Kannan
(ianpatt, behippo, scruggsywuggsy the ferret, shadeMe)

Additional contributions from Timeslip, The J, DragoonWraith, SkyRanger-1, badhair, JRoush 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.

This release adds:
-Support for user-defined events
-Ability to turn off certain compiler warnings
-Fix for the vanilla bug in which RemoveAllItems and GotoJail commands cause equipped quest item enchantments to become permanent
-New events: OnSoulTrap, OnSaveIni, OnMagicEffectHit2
-Quest stage, combat style and cell related commands
-New loader injection method for the editor
-Misc commands and bug-fixes


[ Installation ]

The instructions for installing and running OBSE differ based on whether you are using a retail or Steam version of the game.

IF YOU PURCHASED A RETAIL (NON-STEAM) VERSION OF OBLIVION:

1. Copy obse_1_2_416.dll, obse_editor_1_2.dll, obse_loader.exe and the Data folder to your Oblivion directory. This is usually in your Program Files folder, and should contain files called "Oblivion.exe" and "OblivionLauncher.exe".
3. 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 OBLIVION:

1. Copy obse_1_2_416.dll, obse_editor_1_2.dll, obse_steam_loader.dll and the Data folder to your Oblivion directory. This is usually "C:\Program Files\Valve\Steam\SteamApps\common\oblivion".
2. Ensure you have enabled the Steam community in-game, or OBSE will fail to load. Go to Steam > Settings > In-Game and check the box marked "Enable Steam Community In-Game".
3. Launch Oblivion via Steam or by running Oblivion.exe. 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
http://oblivion.nexusmods.com/mods/36370 - An OBSE plugin that fixes bugs in the CS and adds new features to it
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm

Post » Sun Sep 09, 2012 8:21 pm

Does it include the http://www.4shared.com/zip/IpMPZPDr/obse_0020_dangle_2.html? that Scrubby released?
User avatar
Hearts
 
Posts: 3306
Joined: Sat Oct 20, 2007 1:26 am

Post » Mon Sep 10, 2012 12:54 am

Does it include the http://www.4shared.com/zip/IpMPZPDr/obse_0020_dangle_2.html? that Scrubby released?
Yes, it should.
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Mon Sep 10, 2012 6:55 am

User-defined events look interesting - am I right in thinking that means I write a little script that checks for something happening, and when it does, the script fires off an event that can be handled by a separate script?
User avatar
Megan Stabler
 
Posts: 3420
Joined: Mon Sep 18, 2006 2:03 pm

Post » Sun Sep 09, 2012 7:32 pm

So what is your recommendation on using this or not?
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Sun Sep 09, 2012 5:45 pm

User-defined events look interesting - am I right in thinking that means I write a little script that checks for something happening, and when it does, the script fires off an event that can be handled by a separate script?
Yes, you are.

So what is your recommendation on using this or not?
If you would like to try out the new functionality or help test the beta, go for it. Make sure you create backups of your save game if you chose to try it out, just in case.
User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Sun Sep 09, 2012 10:33 pm

Hello, ShadeMe, and thanks for the update.

However, I'm having a problem with the new obse_loader.exe. When I try to run the CS (with CSE installed) I'm getting the following error:

"Unhandled exception has occured in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.

DragDrop registration did not succeed."

"Details" button shows the following:
See the end of this message for details on invokingjust-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************System.InvalidOperationException: DragDrop registration did not succeed. ---> System.Threading.ThreadStateException: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.   at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)   --- End of inner exception stack trace ---   at System.Windows.Forms.Control.SetAcceptDrops(Boolean accept)   at System.Windows.Forms.Control.OnHandleCreated(EventArgs e)   at DevComponents.AdvTree.AdvTree.OnHandleCreated(EventArgs e)   at System.Windows.Forms.Control.WmCreate(Message& m)   at System.Windows.Forms.Control.WndProc(Message& m)   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)************** Loaded Assemblies **************mscorlib	Assembly Version: 2.0.0.0	Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)	CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------ScriptEditor	Assembly Version: 0.0.0.0	Win32 Version: 4, 0, 0, 0	CodeBase: file:///E:/Oblivion/Data/OBSE/Plugins/ComponentDLLs/CSE/ScriptEditor.dll----------------------------------------msvcm90	Assembly Version: 9.0.30729.4940	Win32 Version: 9.00.30729.4940	CodeBase: file:///C:/Windows/WinSxS/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_50916076bcb9a742/msvcm90.dll----------------------------------------System.Windows.Forms	Assembly Version: 2.0.0.0	Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)	CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System	Assembly Version: 2.0.0.0	Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)	CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------System.Drawing	Assembly Version: 2.0.0.0	Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)	CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------TagBrowser	Assembly Version: 0.0.0.0	Win32 Version: 2, 0, 0, 0	CodeBase: file:///E:/Oblivion/Data/OBSE/Plugins/ComponentDLLs/CSE/TagBrowser.dll----------------------------------------DevComponents.DotNetBar2	Assembly Version: 8.0.0.0	Win32 Version: 8.0.0.0	CodeBase: file:///E:/Oblivion/DevComponents.DotNetBar2.DLL----------------------------------------************** JIT Debugging **************To enable just-in-time (JIT) debugging, the .config file for thisapplication or computer (machine.config) must have thejitDebugging value set in the system.windows.forms section.The application must also be compiled with debuggingenabled.For example:	When JIT debugging is enabled, any unhandled exceptionwill be sent to the JIT debugger registered on the computerrather than be handled by this dialog box.

If I click "Continue" CS crashes.
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Sun Sep 09, 2012 9:06 pm

Thanks for continuing to work on OBSE. I've got a few requests, of which hopefully some can be implemented.

GetRegionWeather, returns an array with weather ids of a region (to check if it can snow for instance)
GetWeatherWindDirection, like GetWeatherWindSpeed, but returns the direction of wind and clouds
SetWeatherWindDirection, like SetWeatherWindSpeed, but sets direction of wind and clouds
SetBaseLevel, like SetLevel but works directly on base objects
GetTerrainType, Like GetTerrainHeight, but returns the terrain type the player character is currently standing on (like snow, road, etc.)
IsInDungeon, Like IsInInterior, but returns if the player character is currently in a dungeon
IsInSE, returns if the player character is in Shivering Isles
User avatar
Killah Bee
 
Posts: 3484
Joined: Sat Oct 06, 2007 12:23 pm

Post » Mon Sep 10, 2012 7:24 am

Maskar! Good to see you here!
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Mon Sep 10, 2012 6:35 am

So far, so good! I noticed that somewhere along the line, I picked up an OBSE plugin called obse_jail_fix.dll. Does the new jail fix eliminate the need for that?
User avatar
Kelvin
 
Posts: 3405
Joined: Sat Nov 17, 2007 10:22 am

Post » Mon Sep 10, 2012 5:16 am

Update to Visual Studios 2010 - nice! WIll make plugin creation quite a bit easier.

Question-oni: I vaguely remember that you have to be careful with if/endif when using loops (Label/Goto). I have a script that needs to work for both vanilla and OBSE players, so I have it "looping" by running once a frame in vanilla and uses Label/Goto for OBSE. Here's the script so far (I've marked the specific lines with ;**)
scn cobSmithSmeltCalcFAS;--Calculator for ingot qualitybegin onActivate    ;--Variable Setup--------------------------------------------    ....    ;----------------------------------------------------------------    set Working to 1endbegin GameMode    if Working        set Working to 1 ;--Heart-beat to keep the script running        ;--Calculate impurities        if sumOre            if (cobSmelt.Variation == 0) ;--Level determined by additives, so no need to calculate impurities           	 ...            else                ;If OBSE then loop and figure it all out, otherwise keep it beating                SetStage cobSigSE 0;**       	 if cobSigSE.Version                    Label                endif                if (sumOre <= 100)                    set tempOre to sumOre                    set sumOre to 0                else                    set tempOre to 100                    set sumOre to (sumOre - 100)                endif                if cobSigSE.Version                    set tempImpurity to Rand(minImpurity, minImpurity + rangeImpurity + 1) ;Add 1 to have chance to get that last number                else                    set tempImpurity to (minImpurity + (GetRandomPercent * (rangeImpurity + 1) / 100)) ;Add 1 to have chance to get that last number                endif                set sumImpurity to (sumImpurity + tempImpurity)                set sumMetal to (sumMetal + (OreBase - tempImpurity));**       	 if (sumOre && cobSigSE.Version)                    Goto                endif                if (sumOre <= 0) ;--Calculate cleaners                ;    also, how many reducers should be used                endif            endif            if (sumMetal % 100)            ;  and handle number of filings here            endif        endif        ;--Calculate ingot qualities, sumOre check so it can run in a single pass        if (numIngots && (sumOre == 0));**   	 if cobSigSE.Version                Label 2            endif            ... lots more complex stuff here                if cobSigSE.Version                    Label 3                endif                ... and more things                if cobSigSE.Version                    Goto 3                endif            if cobSigSE.Version                Goto 2            endif;**    endif        ;--If done, turn off heart-beat        if ((numIngots == 0) && (sumOre == 0))            set Working to 0        endif    endifend
User avatar
Charlotte Lloyd-Jones
 
Posts: 3345
Joined: Fri Jun 30, 2006 4:53 pm

Post » Sun Sep 09, 2012 8:03 pm

So far, so good! I noticed that somewhere along the line, I picked up an OBSE plugin called obse_jail_fix.dll. Does the new jail fix eliminate the need for that?
No, that plugin is needed to fix another bug:
Normally, when you serve the sentence, you should have the chance to decrease a random skill and/or increase sneak/security.
But a bug cause your sneak/security skills to never raise.
Also not all skills can be decreased.
This dll fixes these bugs.
User avatar
Silencio
 
Posts: 3442
Joined: Sun Mar 18, 2007 11:30 pm

Post » Sun Sep 09, 2012 6:04 pm

Thanks, forli!
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am

Post » Mon Sep 10, 2012 1:36 am

Hello, ShadeMe, and thanks for the update.

However, I'm having a problem with the new obse_loader.exe. When I try to run the CS (with CSE installed) I'm getting the following error:
If I click "Continue" CS crashes.
The current version of the CSE (v5.1) doesn't officially support the beta. You'll need to modify your editor shortcut and add the following switch to it: -oldinject .


IsInDungeon, Like IsInInterior, but returns if the player character is currently in a dungeon
IsInSE, returns if the player character is in Shivering Isles
You can use GetCellMusicType in conjunction with IsInInterior to detect if the player's in a dungeon. You can use http://cs.elderscrolls.com/index.php/GetPlayerInSEWorld for the latter. Added the rest to the scroll.


Question-oni: I vaguely remember that you have to be careful with if/endif when using loops (Label/Goto). I have a script that needs to work for both vanilla and OBSE players, so I have it "looping" by running once a frame in vanilla and uses Label/Goto for OBSE. Here's the script so far (I've marked the specific lines with ;**)
As long as the Label sites are executed at least once before being referred to by a Goto command, you should be fine. That being said, why not refactor the code to use UDFs instead? They are a lot cleaner.
User avatar
Robyn Howlett
 
Posts: 3332
Joined: Wed Aug 23, 2006 9:01 pm

Post » Sun Sep 09, 2012 7:50 pm

As long as the Label sites are executed at least once before being referred to by a Goto command, you should be fine. That being said, why not refactor the code to use UDFs instead? They are a lot cleaner.
True, but I'd like to keep the code all in one place. And the long term goal for Cobl is to split the OBSE parts into an OBSE plugin - so I'll refactor the code to C++ objects :biggrin: (The reasoning behind the split, by the way - mod communication is simply too hard and constraining using vanilla, or even OBSE, text methods. Even when Cobl was more popular and we had a dozen people commenting and commiting, only a handful of modders actually used the communication parts like Hunger and the Recipe Updater Engine. Hopefully with an OBSE plugin I can hack the CS and have windows to set all this up. Also, should be easier to port to Skyrim, another long term goal.)


Oh, jumping the gun on this question, but is there a way to assign a value to an item? I know each item has ExtraData, so has the OBSE been able to hack it and add in new fields? In the end, each ingot created should have a value from 0-200. 200 items is out of the question. A script variable could work, but I've found that any script on an item slows down the game (which is why we went hog-wild removing them from OOO items) when there are 50-100 of them. Also, the timing would be difficult - above script/activator sets the global and creates the new ingot, it grabs the value a frame or two later and signals that the calculator can continue, etc.
User avatar
Georgia Fullalove
 
Posts: 3390
Joined: Mon Nov 06, 2006 11:48 pm


Return to IV - Oblivion