[REL] Oblivion Script Extender (OBSE) 0021

Post » Tue Sep 06, 2016 7:52 am

http://www.gamesas.com/topic/1530052-rel-oblivion-script-extender-obse-0021/

OBSE - The Oblivion Script Extender
OBSE 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_0021.zip - current stable version, recommended for general use
http://obse.silverlock.org/
http://obse.silverlock.org/obse_command_doc.html - link is for v20 documentation. v21 documentation is included in the download.
https://github.com/llde/Oblivion-Script-Extender/issues - use this page to report bugs and suggestions.
https://github.com/llde/Oblivion-Script-Extender - need to be compiled
What's new:

Spoiler




Readme (abbreviated):

Spoiler



User avatar
Jeff Tingler
 
Posts: 3609
Joined: Sat Oct 13, 2007 7:55 pm

Post » Tue Sep 06, 2016 3:22 pm

One function that would be really useful would be one which allows the copying of facegen data from one npc to another npc/the player. Lots of cool things could be done with that (copyrace already allows race morphing).

User avatar
Tamika Jett
 
Posts: 3301
Joined: Wed Jun 06, 2007 3:44 am

Post » Tue Sep 06, 2016 10:52 pm

Heyaa !



as usual :)



I have something to report



this code is not working, just because the symbol ' & ' made the code think that is something else



if IsModLoaded "Dungeon&ExteriorActorsHaveTorchesCT.esp"

and this one works, the ' & ' symbol separated from another word/character (has space)


is there a way to escape that character ??



if IsModLoaded "Dungeon & ExteriorActorsHaveTorchesCT.esp"

thanks Llde for your hardwork !


:D

User avatar
no_excuse
 
Posts: 3380
Joined: Sun Jul 16, 2006 3:56 am

Post » Tue Sep 06, 2016 9:10 am

re: GetAVSkillMasteryLevel/C uses base actor value for the skill


Can you confirm this is correct? Last I checked it wasn't going off of the base AV, so I created my own function in the sdr.dll.



Also, if there are any functions in sdr.dll that you think would be helpful in OBSE, feel free to use/take 'em. There's a few that people wanted to use without having to install SDR, but I didn't want to create a separate .dll just for the one or two people that made the request. So I figured maybe it would be better if I just donated them to the core OBSE, assuming that they fall within what you want OBSE to do.

User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Tue Sep 06, 2016 3:05 pm

Llde

I have interesting report


assumed rf1 is reference (not base object)

IsQuestItem rf1

and

rf1.IsQuestItem

both of them works on reference and return correct value

I call this 'double sheath syntax'


this means,

there is syntax that can still identify reference even if we put the reference in base object parameter deliberately

strange right ? BUT proven very useful to me ! lol

I need the function to be like that, because sometimes I use that on base object too... it is intentional

I don't know how many functions that have double sheath for reference like that,

it is USEFUL and much more convenient in some cases

I hope next OBSE 22 is still like that ... double sheath command, for reference. if not ... it will be trouble for me


EDIT : another double sheath syntax that I found is GetObjectType, please let it be like that in next OBSE

I need to report this because ... talented modder called Jroush have some obse dll plugin mod that correct this behavior

this frustrate me long time ago ...

IIRC Jroush correct syntax GetBookSkillTaught ... originally GetBookSkillTaught is double sheath syntax,

but after installing mod called AddActorValue by Jroush

the GetBookSkillTaught command become strict and messing with several of my scripts


thanks for your hardwork Llde

best of luck !
User avatar
Gavin boyce
 
Posts: 3436
Joined: Sat Jul 28, 2007 11:19 pm

Post » Tue Sep 06, 2016 7:36 am

From the OBSE documentation:



This means those commands only want the base object (either the passed object or the base object of the calling reference).


You can't assume all commands still work if you pass a reference as "object" parameter, so it's better if you always pass them a base object.



If base object is what they want, then give them a base object!


You can extract the base object yourself and ensure you can use those commands no matter what they do.



If IsReference refVar
Let refVarBase := refVar.GetBaseObject
Else
Let refVarBase := refVar ;already a base object. No convertion.
EndIf
;... now refVarBase is surely a base object and you can pass it as Object parameter to any double-sheath command.
User avatar
Chantel Hopkin
 
Posts: 3533
Joined: Sun Dec 03, 2006 9:41 am

Post » Tue Sep 06, 2016 11:22 am

@saebel
These functions internally call GetSkillMasteryLevel(actor->GetBaseActorValue(skillCode)) both of them are call into the original gameocde.
So I actually don't know. Never checked these function functionality.
Thanks for the offer. Will check.

@lubrons
Some functions internally first check explicity for a passed ThisObj (the object passsed with reference syntax) and only then get the object with ExtractArgs.
The issue you were experiencing with OBME and Add Actor Values is that Jroush replaced the OBSE functions with its own implementation of the functions modifying the commandtable.
However he forgot(or maybe he didn't this purposefully) to account for the reference passing syntax.
I have not the intention to remove this possibility however.


Fun fact: I just stumble upon the Obse Whishlit on cs.elderscrolls.com. One of the feature requested was the ability to do pointer arithmetics on references.
The unsafety is strong in this one.
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Tue Sep 06, 2016 7:46 am

@Forli

quote : " If base object is what they want, then give them a base object! "

>>> yeah Master, I know ;)

I will make sure and only use this trick on double sheath syntax


@Llde

quote : " I have not the intention to remove this possibility however. "

>>> That's good to hear :)

so I don't have to overhaul my mods if someday OBSE 22 come out


quote : " Some functions internally first check explicity for a passed ThisObj "

>>> oh !! so it is intended to be like that since beginning :o

but you said 'some functions'

where can I see the list ?

I am curious, I need to know every functions that support double sheath

well ... sadly it seems Jroush will not upgrade his AddActorValue mod,

I don't know how many functions that affected by that obse plugin

so far I just found GetBookSkillTaught become strict,

no longer support double sheath ... must abide to parameter rule,

must place base object and reference correctly


quote : " feature requested was the ability to do pointer arithmetics on references. The unsafety is strong in this one. "

>>> lol

that person must be in your caliber

people that meddling with math usually is a smart one


and Llde ... how about this



if IsModLoaded "Dungeon&ExteriorActorsHaveTorchesCT.esp"


there is some mods that have troubled name like that

somehow if symbol ' & ' placed before any character it become something else...

I don't even know why is that happening within the string

how can I escape that thing ??

so I can validate it correctly

you know ... some mod have name like that, and need to be checked
User avatar
Angus Poole
 
Posts: 3594
Joined: Fri Aug 03, 2007 9:04 pm

Post » Tue Sep 06, 2016 3:04 pm

Wait...



But the OBSE documentation says:


User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Tue Sep 06, 2016 7:26 pm

@forli yes it's true, I remebered wrongly.

@lubrons There isn't any list for this kind of function. This is an information that should be in the docs. The only way to check if a function support the dual syntax is checking in the sourcecode.

Not many plugins replace OBSE functions, becouse it require to iterate manually in the command list. Dangerous thing that require pointer aarithmetics.
I'm thinking about exporting a Replace function in the PluginAPI becouse there exist valid and legit reasons to do so.

I'm actually not very familiar on how the string is passed on these functions.
I need more information about the bug. If you try to console print the mod name what give to you? And with a messagebox?
User avatar
Niisha
 
Posts: 3393
Joined: Fri Sep 15, 2006 2:54 am

Post » Tue Sep 06, 2016 7:46 am

report !


sorry, man !


the script is working as intended !!


hmm ... strange


yesterday I'm pretty sure that ' & ' symbol gave me some trouble


I will let you know if I can replicate the errors

User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Tue Sep 06, 2016 7:42 am

Isn't replace already in ? I'm almost sure I copied it into NVSE.

User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Tue Sep 06, 2016 9:46 am

@hlp The function exist in OBSE native code, (so I can change a native script function with my own implementation directly from OBSE sourcecode,a s I did for GetDisease) but it isn't exported into the PluginAPI.
Changing the commandlist is still possible but it require iterating with pointer arithmetics from the start.
Exporting is Replace will make this easier and less error prone.
An example:
OblivionReloaded change sleeping for the player, so it introduce a slight incompatibility with mod that use IsPCSleeping functions that return true even with a simple wait.
To fix the incompatibility Alenet should write a new function in his plugin and replace the original one with his own.
User avatar
Del Arte
 
Posts: 3543
Joined: Tue Aug 01, 2006 8:40 pm

Post » Tue Sep 06, 2016 5:31 pm

A Replace function would be very welcome|


In EMC2 I need to patch the StreamMusic command with _asm code to make it work with the EMC2 music system.


If I could directly replace the "execute" function of StreamMusic command (while keeping the same parameters and return type) it would be much better.

User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Tue Sep 06, 2016 1:36 pm

JRousch did replace the functionality of some of the commands to work with his AddActorValues OBSE plugin, rather than create new commands (although he added a few of those as well). He documented the changes, so it may be worth looking at.

User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Tue Sep 06, 2016 7:55 pm

You're right, there are only get functions in NVSECommandInterface. Though this is enough to replace the content of a CommandInfo. :)

User avatar
Oceavision
 
Posts: 3414
Joined: Thu May 03, 2007 10:52 am


Return to IV - Oblivion