[RELz] Oblivion Script Extender (OBSE) 0019b

Post » Wed Sep 01, 2010 10:48 pm

...
I don't think this is available in NifSE yet because I asked PacificMorrowind about GetDimensions, which is in NifLib. He said he hasn't done anything with collision at all yet. I thought the size might be easier since it seems to be in the base CS.

As I said, probably of limited utility, but I think it would be handy in certain circumstances.
Hmm, I'll take a look when I have more time. But IIRC, there was a similar discussion a long time ago and scruggsy had some say in it.
User avatar
Kari Depp
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:19 pm

Post » Wed Sep 01, 2010 4:02 pm

I don't think this is available in NifSE yet because I asked PacificMorrowind about GetDimensions, which is in NifLib. He said he hasn't done anything with collision at all yet. I thought the size might be easier since it seems to be in the base CS.

You asked who? :frog: Anyway, it shouldn't be very hard to add in general, so expect it... probably not the next beta of NifSE, but probably the one after.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Wed Sep 01, 2010 8:01 pm

You asked who? :frog: Anyway, it shouldn't be very hard to add in general, so expect it... probably not the next beta of NifSE, but probably the one after.


As soon as I saw that you responded to this thread, I said "Oh no" :blush: Well, both of you guys have been around forever, so you're interchangeable :lol: Sorry 'bout that.

Would you add it to NifSE though? I ask because this seems to be part of the base CS, not NifLib. I don't think you even need to load a NIF to get it. GetDimensions, yes, but this one, I'm not so sure...
User avatar
Quick Draw
 
Posts: 3423
Joined: Sun Sep 30, 2007 4:56 am

Post » Wed Sep 01, 2010 3:31 pm

Is it possible to download obse0019. with an http://img199.imageshack.us/img199/4754/searchfilepath.png such as \Oblivion\Data\obse\ and files is already in the corrects folders.

Considering there are only 3-4 required files and they all go in the same folder, probably not.
Another question: do strings declared while in menu mode need to be explicitly destroyed? Ob XP currently does, because once again, any strings declared in menu mode are not needed outside of that scope, so they are destroyed before the end of the menu mode block, but I'm curious if you actually have to do so.

No, you don't have to though doing so doesn't really hurt anything.
If you're just reusing the same string_var to hold different strings you basically don't have to worry about destroying it. Menumode vs. gamemode makes no difference. There isn't really a concept of 'variable scope' in the scripting language.
IIRC, there was a similar discussion a long time ago and scruggsy had some say in it.

Yeah, mostly just to say that having a single value to represent 3 dimensions didn't seem hugely useful.

Bounding box dimensions are easily accessible in the editor, not so much at run-time except for actors. I will need this info soon for some planned functionality so there's a good chance it'll show up in 0020. If necessary we can calculate it from the .nif the way the editor does, but it seems reasonable to think that it might be available at run-time e.g. on the havok side.
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Thu Sep 02, 2010 12:55 am

Yeah, mostly just to say that having a single value to represent 3 dimensions didn't seem hugely useful.

Bounding box dimensions are easily accessible in the editor, not so much at run-time except for actors. I will need this info soon for some planned functionality so there's a good chance it'll show up in 0020. If necessary we can calculate it from the .nif the way the editor does, but it seems reasonable to think that it might be available at run-time e.g. on the havok side.


Great, that'd be fabulous. In my case, I'm just looking for something that will allow me to categorize items - sort of like "small", "medium" and "large". Therefore the single value of size works. Others may find it more useful to get the specific dimensions, but I would imagine that this would get quite difficult with complex collision meshes. So once again, that's where the single value helps. Guess it all depends on what you're doing with the data...
User avatar
Angela
 
Posts: 3492
Joined: Mon Mar 05, 2007 8:33 am

Post » Wed Sep 01, 2010 12:16 pm

As soon as I saw that you responded to this thread, I said "Oh no" :blush: Well, both of you guys have been around forever, so you're interchangeable :lol: Sorry 'bout that.

Would you add it to NifSE though? I ask because this seems to be part of the base CS, not NifLib. I don't think you even need to load a NIF to get it. GetDimensions, yes, but this one, I'm not so sure...

I was referring to GetDimensions. I thought these were roughly the same thing?
User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm

Post » Wed Sep 01, 2010 4:39 pm

I was referring to GetDimensions. I thought these were roughly the same thing?


There's a size column in the object window of the CS. I was asking for a function that would retrieve this value. The size seems to be derived from the dimensions in the NIF, but it's a single value.

Here's the example I posted previously:

For example: folio04.nif
Dimensions of bhkBoxShape: x=1.5344, y=2.3025, z=0.4552
Minimum size: 0.4552

Size in CS: 19

I don't know how the CS determines this value, but it seems to be quite reliable if you want to classify objects by size. I used it previously to assign prices to the paintings I added to Imperial Furniture Renovated. I did this manually - not in a script or anything, of course. So for me, having a single size would allow me to classify items. Then I could use GetDimensions from NifSE to do finer manipulation of their position.

Also, size seems to be a reliable value even with complex collision. GetDimensions only works for simple box collision. I'd imagine you'd have to get the values for all the vertices for more complex collision - I haven't looked at what NifLib has for this.
User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Wed Sep 01, 2010 6:48 pm

Niflib can return each vertex's position as a 3-vector, from which you could calculate the volume of the mesh by hand if necessary. Be difficult and time-consuming, though.
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Thu Sep 02, 2010 12:25 am

It appears that the CS pulls the Size attribute from the TESModel base of the bound object. Haven't located where it gets populated yet but it is stored in TESModel::unk0C. TES4Edit identifies the attribute as the mesh's 'Bound radius'.
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Wed Sep 01, 2010 2:15 pm

Niflib can return each vertex's position as a 3-vector, from which you could calculate the volume of the mesh by hand if necessary. Be difficult and time-consuming, though.


Yuck! :) I've actually editted vertices manually in Nifskope (yes, I'm a masochist). Looking forward to these functions being added to OBSE and NifSE :wink_smile:
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Wed Sep 01, 2010 10:42 am

It appears that the CS pulls the Size attribute from the TESModel base of the bound object. Haven't located where it gets populated yet but it is stored in TESModel::unk0C. TES4Edit identifies the attribute as the mesh's 'Bound radius'.


So you're telling me that it's tantalizingly close, but I can't get at it, right? I see what you mean by bound radius though (it's labelled MODB - Bound Radius in TES4Edit). And this is set even for items with simple box collision, like books.
User avatar
I love YOu
 
Posts: 3505
Joined: Wed Aug 09, 2006 12:05 pm

Post » Wed Sep 01, 2010 11:08 am

Quick request (which, knowing my luck, won't be possible because of X reason):

SetWaterInCell (pretty obvious what it does, but...) - essentially ticks off if the cell (interior) has water in it or not. Purge Cell Buffers / etc would likely be necessary to call after.
SetCellAsixterior - turns on the cell behaving as an exterior.
SetCellClimate (also pretty self-explanatory) - changes the climate for the given cell.

My guess is that, knowing Oblivion, these things will be hard-coded into the ESP file itself or something similar...
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Wed Sep 01, 2010 9:19 pm

So you're telling me that it's tantalizingly close, but I can't get at it, right? I see what you mean by bound radius though (it's labelled MODB - Bound Radius in TES4Edit). And this is set even for items with simple box collision, like books.
The attribute now appears to be vestigial - I can't seem to create a bound record of size > 0. The only records that do have a valid size are those found in Oblivion.esm. See if you had any luck creating a non-zero size object on your end.
User avatar
Kay O'Hara
 
Posts: 3366
Joined: Sun Jan 14, 2007 8:04 pm

Post » Wed Sep 01, 2010 9:58 pm

The attribute now appears to be vestigial - I can't seem to create a bound record of size > 0. The only records that do have a valid size are those found in Oblivion.esm. See if you had any luck creating a non-zero size object on your end.


Hmmm. Unfortunately it appears you are right. I have lots of items that I've created that have a size, but I probably created them by taking an existing object and giving it a new form ID. I also see quite a few that don't have a size, so it looks like it isn't reliable. Why do some of them have a size? Other than the fact that they are in Oblivion.esm, I mean. I guess the tools Beth used to create these items populated this value, but the CS doesn't. I guess we're left with GetDimensions from NIfSE after all.
User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Wed Sep 01, 2010 6:47 pm

The bound radius value generally doesn't update when you create an item, however, not having one on certain things will crash the CS unless they're manually added via tes4edit, like base light records. I've never been able to get one to be placeable without manually adjusting that value to something > 0.
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Thu Sep 02, 2010 1:53 am

If I could just squeeze into this discussion on GetDimensions...

I need bounding box data for exterior building meshes for something I'm working on atm. Thankfully QQuix has provided me with a bunch of hardcoded bounding box data which he has allowed me to use, as he's needed it for something similar to what I'm doing, but obviously if there was a way to do this more accurately programmatically that would definitely be better. Particularly when it comes to mod compatibility with mods that don't use vanilla meshes.

So basically what I'm saying is that there would be, at least some, demand for this.
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am

Post » Wed Sep 01, 2010 3:37 pm

The bound radius value generally doesn't update when you create an item, however, not having one on certain things will crash the CS unless they're manually added via tes4edit, like base light records.

If the radius of the bounding sphere is all that's needed, we can get you that.
EDIT: Added GetBoundingRadius. For the objects I tested, this is the same as the 'Size' reported in the editor, except a little more precise (the editor field is a rounded or truncated float).
Quick request (which, knowing my luck, won't be possible because of X reason):

SetWaterInCell (pretty obvious what it does, but...) - essentially ticks off if the cell (interior) has water in it or not. Purge Cell Buffers / etc would likely be necessary to call after.
SetCellAsixterior - turns on the cell behaving as an exterior.
SetCellClimate (also pretty self-explanatory) - changes the climate for the given cell.

My guess is that, knowing Oblivion, these things will be hard-coded into the ESP file itself or something similar...

Done, done, and done. Also added GetCellClimate. A SetCellWaterType will probably be in order.
I need bounding box data for exterior building meshes for something I'm working on atm.

Yeah, me too. QQuix wants to be able to enable/disable edges between path grid points when adding/removing buildings from the gameworld. So we'd like to simplify things to allow him to pass in the building object itself and have OBSE determine which edges intersect the building's bounding box. This would of course work for objects other than buildings.
User avatar
Johanna Van Drunick
 
Posts: 3437
Joined: Tue Jun 20, 2006 11:40 am

Post » Wed Sep 01, 2010 6:44 pm

EDIT: Added GetBoundingRadius. For the objects I tested, this is the same as the 'Size' reported in the editor, except a little more precise (the editor field is a rounded or truncated float).



Is there a testing version available yet? :)
User avatar
Kara Payne
 
Posts: 3415
Joined: Thu Oct 26, 2006 12:47 am

Post » Thu Sep 02, 2010 12:17 am

Is there a testing version available yet? :)

Shortly, I expect.
Do you expect to have a reference to the object you're interested in getting the size of, or do you need to be able to get the size of base objects directly without having a reference?
User avatar
Brian Newman
 
Posts: 3466
Joined: Tue Oct 16, 2007 3:36 pm

Post » Wed Sep 01, 2010 1:01 pm

Shortly, I expect.
Do you expect to have a reference to the object you're interested in getting the size of, or do you need to be able to get the size of base objects directly without having a reference?


Just a reference. I'll be mainly dealing with inventory items.
User avatar
Benito Martinez
 
Posts: 3470
Joined: Thu Aug 30, 2007 6:33 am

Post » Wed Sep 01, 2010 11:58 pm

Just a reference. I'll be mainly dealing with inventory items.

So without a reference you mean? Objects in inventories aren't references (no 3D data associated with them). The 3D data is where we're currently getting the radius from.
EDIT: nvm, turns out the size is also stored on the base model and more reliably matches the editor size anyway. But possibly zero for non-vanilla objects as shademe noted.
EDIT2: Added GetEditorSize.
User avatar
Mark Hepworth
 
Posts: 3490
Joined: Wed Jul 11, 2007 1:51 pm

Post » Wed Sep 01, 2010 9:14 pm

Scruggs -- did JRoush ever get in touch with you about implementing a GetNthEI command, which returns an array fully describing the effect parameters? He proposed it as a solution to something I need from OBME, and we're both hoping it can be added to OBSE-proper and then extended by OBME, rather than being OBME-exclusive.
User avatar
celebrity
 
Posts: 3522
Joined: Mon Jul 02, 2007 12:53 pm

Post » Wed Sep 01, 2010 10:30 am

Scruggs -- did JRoush ever get in touch with you about implementing a GetNthEI command, which returns an array fully describing the effect parameters? He proposed it as a solution to something I need from OBME, and we're both hoping it can be added to OBSE-proper and then extended by OBME, rather than being OBME-exclusive.

Not that I recall. No problem to add it - it would save some linked-list walking over calling multiple GetNthXXX commands for the same index. What is it supposed to provide a solution to?
User avatar
Caroline flitcroft
 
Posts: 3412
Joined: Sat Nov 25, 2006 7:05 am

Post » Wed Sep 01, 2010 10:33 pm

So without a reference you mean? Objects in inventories aren't references (no 3D data associated with them). The 3D data is where we're currently getting the radius from.
EDIT: nvm, turns out the size is also stored on the base model and more reliably matches the editor size anyway. But possibly zero for non-vanilla objects as shademe noted.
EDIT2: Added GetEditorSize.


No, I meant I only need it to work with a reference. I'm using getInventoryObject, which I thought returned a reference...
User avatar
Mr. Ray
 
Posts: 3459
Joined: Sun Jul 29, 2007 8:08 am

Post » Wed Sep 01, 2010 1:04 pm

What is it supposed to provide a solution to?

http://www.gamesas.com/index.php?/topic/1091638-wipz-formulatoresm/ needs fully-descriptive keys for a reliable cloneform database. Since you added the ability to read all the checkboxes on spell records in 0019, I'm set for vanilla effects.

But meanwhile, OBME compatibility is a top priority and http://www.gamesas.com/index.php?/topic/1116501-relz-oblivion-magic-extender-v10/page__view__findpost__p__16633850 for multiple reasons related to the (good for other purposes) design of OBME's relevant commands. This would fix it from top to bottom.

Having a core-OBSE version of the command is not essential for me, but the efficiency issues are definitely worth considering, and on a more petty level it would save me needing two completely different key generation functions. ;)
User avatar
quinnnn
 
Posts: 3503
Joined: Sat Mar 03, 2007 1:11 pm

PreviousNext

Return to IV - Oblivion