[Rel] Oblivion Script Extender (OBSE) 0021 Beta 4

Post » Sat Jul 20, 2013 11:56 pm

Continuing from the http://www.gamesas.com/topic/1456224-rel-oblivion-script-extender-obse-0021-beta-3/

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_4.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




Readme (abbreviated):
Spoiler




For mod developers:
http://oblivion.nexusmods.com/mods/36370 - An OBSE plugin that fixes bugs in the CS and adds new features to it

User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am

Post » Sun Jul 21, 2013 1:05 am

I'm finding it kind of impossible to remove resistance AVs from magic effects through SetMagicEffectResistAV|C. It is possible to change it to another AV, but not to pass 256 to remove it it seems. Also, for effects that have no resistance AV, GetMagicEffectResistAV is returning 0, which leads to think of the strength AV according to the AV codes table, shouldn't it be 256?

Then again, it may be one of the OBSE plugins that could mess with such stuff. Will keep testing. No matter, trying to use 256 as the resist AV, GetMEResistAV reports nothing has changed in the effect, and reports 0 for effects with no resist AV

EDIT: seems I was doing it wrong... but still: GetMEResistAV returns 255, not 256, for effects with no resist AV. But even when passing 255 to SetMEResistAV I get no change in a magic effect's resist value, GetMEResistAV still returns whatever was there for it. I can only change it to another value, not get rid of it.

User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm

Post » Sat Jul 20, 2013 8:26 pm

I have some doubts about actor values.

Example given is the Resist Fire actor value. If I read right, the game handles them in three ways:
1) The most basic is their code, which would be 61 in this case, and used by the various AVC functions in OBSE.
2) Then there's the engine string or something like that, which reads literally ResistFire no matter what language version you have. You enter this name in commands like ActorValueToCode, or any of the various actor value commands in vanilla and OBSE.
3) Finally you would have the localized name of the AV in game, which in English would be "Resist Fire", in Spanish "Resistencia al Fuego", etc, and which is returned by ActorValueToString and what you have to enter in commands like StringToActorValue... and I'm not sure if any other commands use it.

My question is how interchangeable are they. For example I know that using the compiler override you can use 1) and 2) in AV commands indistinctly, and the functions will work with both, but will they work with 3) as well?

EDIT: huh that was easy enough for testing... 3) doesn't work with AV commands, and the way I see it doesn't have much use unless you use it in a book's text or something like that.
User avatar
Sheeva
 
Posts: 3353
Joined: Sat Nov 11, 2006 2:46 am

Post » Sat Jul 20, 2013 10:38 pm

Question: I apologize if it's been asked before:

Has anyone ever tried to implement SUCSM (http://geck.gamesas.com/index.php?title=SetUFOCamSpeedMult) for Oblivion's flying camera as a OBSE thing? I'm just curious - it would be awesome to have such an ability in to do machinima with. :P

Considering it's not that much in demand, I'll just add it as a humble request. ;)

User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Sat Jul 20, 2013 11:34 pm

I have 2 question:

I don't fully understand the usage of the commands GetNthEIMagnitude, SetNthEIMagnitude and similar.

I have created a disease with:
Sun Damage 4 pts

Weakness to Fire 25%

When I open the disease in the CSE, they show exactly in this order, but when I call one of those commands, the index of the effect item doesn't match.

A test with GetNthEffectItemName has revealed that using 0 return "Weakness to Fire" and 1 return "Sun Damage"

I'm missing something, or it's a bug?

Also, is it true using the GetNthEIMagnitude on a Frost Damage effect item return a negative value? And this happen for all other damage effects? (And maybe for all spells which decrease something?)

User avatar
danni Marchant
 
Posts: 3420
Joined: Sat Oct 07, 2006 2:32 am

Post » Sat Jul 20, 2013 7:37 pm

My guess is that it even though it may be applying the effects in the order you listed, when grabbing the list of active effects it may be sorting them in form ID order. Maybe? Totally guessing here.
User avatar
kat no x
 
Posts: 3247
Joined: Mon Apr 16, 2007 5:39 pm

Post » Sun Jul 21, 2013 2:04 am

Sun damage has form ID 000018A0 while Weakness to Fire has form ID 000018A7 so Sun damage should come first anyway.

Also, Sun damage has mgefCode 47445553 while Weakness to Fire has mgefCode 49464B57 so, again, Sun Damage should come first.

User avatar
Niisha
 
Posts: 3393
Joined: Fri Sep 15, 2006 2:54 am

Post » Sat Jul 20, 2013 5:01 pm

When you repeat the process only add the effects in reverse, does the same apply?

User avatar
!beef
 
Posts: 3497
Joined: Wed Aug 16, 2006 4:41 pm

Post » Sun Jul 21, 2013 4:42 am

I don't add or remove any effect with OBSE.

I've created the disease and manually added the 2 effects. Then I use the OBSE commands to change their magnitude.

...

Wait :blink:

...
You mean the index used by those commend match the order I put (either manually or by OBSE) the effects in the disease (and not the order they are displayed)?

User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Sat Jul 20, 2013 8:31 pm

No ment creating another disease with the same effects only add them in reverse order. It's very possible that the list is simply stored backwards internally.

User avatar
Ana Torrecilla Cabeza
 
Posts: 3427
Joined: Wed Jun 28, 2006 6:15 pm

Post » Sun Jul 21, 2013 2:13 am

Yes, in general the order of the effects in a magic item matches the order in which you add them. You can even use TES4Edit to move them up and down. But the best practice is to check them in the script that alters them. For example:
int iint effectCode...Let i := GetMIEffectCount myDiseaseWhile i Let i -= 1 Let effectCode := GetNthEICode myDisease i if effectCode == MECodeFromChars "SUDG"  ;effect no i is Sun Damage elseif effectCode == MECodeFromChars "WKFI"  ;effect no i is Weakness to Fire ... endifLoop
I doubt GetNthEIMagnitude returns negative for any effect naturally. You can use SetNthEImagnitude to move them into negatives, and sometimes the effect works as expected (damage effects causing a restore instead, and viceversa).
User avatar
Thomas LEON
 
Posts: 3420
Joined: Mon Nov 26, 2007 8:01 am

Post » Sat Jul 20, 2013 10:48 pm

Yeah, confirmed. Created a new spell and added the effect in zigzag order then I use a loop to print their name. Result is a zigzag print.

Anyway, just tried to open the mod with Tes4Edit and tried to change the order of the effects.

Obviously, the weakness to fire effect was the first so I tried right click on it and click "move down", but an error appeared "Range check error"

User avatar
Amanda Leis
 
Posts: 3518
Joined: Sun Dec 24, 2006 1:57 am

Post » Sat Jul 20, 2013 4:32 pm

Fixed, thanks.

Added.

User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Sun Jul 21, 2013 1:23 am

I was thinking: in the next CSE release, what about an option to change the order of magic effects in a spell?

User avatar
Wayne W
 
Posts: 3482
Joined: Sun Jun 17, 2007 5:49 am

Post » Sat Jul 20, 2013 6:37 pm

I can move them up and down just fine in TES4Edit 3.0.30.

Are you by chance trying to edit magic items created or edited with OBME_CS.dll loaded? If so, try saving your mod again without OBME_CS.dll in the OBSE/Plugins folder.

Regular editor support for that might be useful too. I think after you save the magic item it displays effects alphabetically or the like, instead of by order of addition.

User avatar
Stephanie I
 
Posts: 3357
Joined: Thu Apr 05, 2007 3:28 pm

Post » Sat Jul 20, 2013 8:17 pm

The reason why it stores the effects in the order you add them is becase that needs to be th order in which the effects execute, and it's assumed that it is the intende order. In fact, I assumed that was what you did and thought Oblivion was resorting them in an unexpected way.

For anyone else reading the thread, order is important.

If you have a spell/disease/etc. That does weakeness to fire and then fire damage, the fire damage will do more damage because weakness to it was applie first. If you reverse the order, the fire damage will be calculated first and then the weakness applied. If it's a one trick pony, that makes the weakness part pointless. If the effects last for more than one second, the weakness wouldn't impact damage until the next second's worth of damage.
User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Sat Jul 20, 2013 5:26 pm

Have you tested that? Because if it were true, there's really some sorting to do.

I was under the impression that magic items like say, fire damage + weakness to fire for x seconds only took advantage of the weakness after the first application, while the fire weakness effect is active and applied for the fire damage to get amplified by it. Otherwise I'm quite sure that checking active effects will report the weakness effect active, but IsNthAEApplied will return 0 for that frame and thus not really provide the intended effect.

This is probably easier to test with an OnMagicApply handler. Will add my findings.

EDIT: yeah I'm afraid its as I said, order of effects doesn't help with weaknesses in the magic item at all. IsNthAEApplied returns 0 for all the magic item's effects in the OnMagicApply phase.

User avatar
Mariaa EM.
 
Posts: 3347
Joined: Fri Aug 10, 2007 3:28 am

Post » Sat Jul 20, 2013 7:28 pm

Done.

PS: The issue you saw was probably due to the fact that the editor automatically sorts the effect item list view (by name) as soon as it gets populated. CSE 6.1 will prevent this counter-intuitive behaviour.

User avatar
Andrea Pratt
 
Posts: 3396
Joined: Mon Jul 31, 2006 4:49 am

Post » Sun Jul 21, 2013 4:18 am

Well, actually I'm not using OBME_CS.dll (I was, and Tes4Edit didn't like it, but I'm already get past that problem).
I don't think problem is my Tes4Edit version is 2.5.3*. I've tried the 3.0.30 version and it crash when I tried that!!

*(Didn't even know a 3.0.30 existed until now!)


Don't know about the weakness. Somewhere I read all effect are added in the same frame, and weakness are totally ignored unless they are added in a previous frame.


Great! Thanks a lot!
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm

Post » Sat Jul 20, 2013 1:00 pm

Hmm. I could have sworn it was within the same frame. It's certainly an issue with soul trap. You need to make sure soul trap is added first before the damage is applied. Otherwise you can kill someone before the soul trap kicks in.

I jumped to the conclusion that the weakness feature would function the same.
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Sun Jul 21, 2013 4:24 am

Wow, wasn't expecting that - that is amazeballs! thank you!

User avatar
Steve Bates
 
Posts: 3447
Joined: Sun Aug 26, 2007 2:51 pm

Post » Sat Jul 20, 2013 6:38 pm

Beta 4 released. OP updated. Huge props to kyoma for the swim breath functions and events :thumbsup:

This will be the final beta for v21. The next build will be the final version and I don't expect to be adding any new functions to it at this point - Changes and additions will be limited to bug fixes.

User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Sun Jul 21, 2013 1:31 am

Great!

While I download and try the new functions, I have a doubt:
Functions calls are synchronized?

I mean:
I create a function FunctDoSomething which read a variable, do something and set the variable to a new value.
I place the Call FunctDoSomething line in more scripts running continuously.
What happen if 2 or more scripts call the function at the same time? One of them run the function while the other(s) get queued?
If not, any advice on how to realize a semaphore?
User avatar
Robert
 
Posts: 3394
Joined: Sun Sep 02, 2007 5:58 am

Post » Sat Jul 20, 2013 8:21 pm

Generally speaking, no two scripts can run concurrently. The exception is when the background loading of references is performed. Internally, OBSE does account for this corner-case to an extent but the actual race condition cannot be mitigated in its entirety.

From a scripting perspective, there isn't much that can be done about it except moving the critical code to a quest script - Those are always executed on the main thread.

User avatar
Ash
 
Posts: 3392
Joined: Tue Jun 13, 2006 8:59 am


Return to IV - Oblivion