[BETA/WIPz] NifScript

Post » Tue May 17, 2011 7:29 am

I was not sure if it was compressed, I thought the BSA format was compressed in itself. I am guessing you are having a hard time finding away around the problem.
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Tue May 17, 2011 2:59 am

Could this be used to make a more reliable http://www.tesnexus.com/downloads/file.php?id=19939?
User avatar
Nicole Elocin
 
Posts: 3390
Joined: Sun Apr 15, 2007 9:12 am

Post » Tue May 17, 2011 10:26 am

I was not sure if it was compressed, I thought the BSA format was compressed in itself. I am guessing you are having a hard time finding away around the problem.

Heh, you were right.

This is a very stupid problem. Dealing with libraries, linking either statically or dynamically, are pretty basic C++ things, but almost all of the C++ I know I've picked up as I've gone along, so this is exactly the kind of thing I'm useless with. Speedo gave some helpful tips, which have helped but not (yet) completely eliminated the issue. I appear to now be statically linking zlib, but the dependency on zlib1.dll remains, despite the static link to the library file. So now I have the worst of both worlds, heh... zlib added about 4 MB to the filesize of NifScript.dll, but it still requires zlib1.dll...

Could this be used to make a more reliable http://www.tesnexus.com/downloads/file.php?id=19939?

I... don't think so. Not sure. That's way beyond my ken; I don't know how the camera or the skeleton works. If Loup Sombre has some requests, that would improve that (or any other) mod, he should definitely let me know, however - I don't know what, if anything, he needs to make that better that I can offer, but if he lets me know I'd be happy to try to do it.
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Tue May 17, 2011 12:39 pm

I can't believe it. :o

You do know you just served the basis to eliminate the equipment slot limitation once and for all, don't you?
NifTools functionality called from ingame via scripts... dreams come true! :drool:

Great work and I can't wait for further expansions. :woot:

This will definitely come to great use once more functionality gets added! :celebration:

(I remember having talked about things only possible if we had this possibility quite often... can't remember though what they were and how they were related to my projects... now we have this possibility!... guess it's time to read-up again about those "things" I mentioned... :embarrass: )
User avatar
CHARLODDE
 
Posts: 3408
Joined: Mon Apr 23, 2007 5:33 pm

Post » Tue May 17, 2011 12:46 am

I have to figure out what's going on with my code, first... argh. I'm getting frustrated with this library business, just completely outside my experience and various searches are turning up... less than helpful information.
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Tue May 17, 2011 7:36 am

If you hover over the Rotation entry in the NiTriStrips, a box will appear with a 3x3 matrix. I'll need that to apply the rotation; internally it does not use the PXYZ coordinates. You could also do the same to give me the 3x1 matrix (vector) for translation, if you like (though I'm pretty sure it will just match the XYZ in the screenshot).


A: 194.0
X: 0.99996
Y: -0.00107
Z: 0.00873

Is it safe to apply the same translation/rotation to every shield? That would be fairly crucial to doing this simply.


Alternatively, I could just create functions to apply translation and rotation yourself, so you can fiddle with the numbers yourself. I'd need to come up with some scheme for how modders will refer to each of the NiTriStrips (probably something like NifSetNthAVObjTranslation, NifSetNthAVObjRotation, etc)...


They all use the same on their original "Slot" (Bip01 L ForearmTwist for NiStringExtraData) and that's the way I do it with my self-made Meshes so there wouldn't be any difference.
But I'd prefer to specify the value myself with a function using a float as a parameter. So Vote for the NthFunctions.
Just in case a special shield doesn't fit.

Does anyone use compressed BSAs? I can just remove zlib entirely if I drop support for compressed BSAs. The default BSAs, I'm fairly sure, are not compressed...

EDIT: Nevermind, that doesn't work anyway.


Even if it doesn't matter, I do use compressed BSAs. ;)
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Tue May 17, 2011 7:38 am

get the zlib source, open a vs command prompt and build it with "nmake -f win32/Makefile.msc". now you've got a static lib too. zlib.lib = static, zlib1.lib = dynamic. just link against the static one to get rid of the dynamic dependency.
User avatar
Katie Samuel
 
Posts: 3384
Joined: Tue Oct 10, 2006 5:20 am

Post » Tue May 17, 2011 12:20 am

does that actually work, ill have to try it when i by a new pc.
User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm

Post » Tue May 17, 2011 10:12 am

A: 194.0
X: 0.99996
Y: -0.00107
Z: 0.00873

Yeah, this is the coordinate system I was trying to say that NifLib doesn't use (heh); both of the representations that you can choose in NifSkope (Axis and Euler) are for people; the computer sees both as the same 3x3 matrix. You can see that matrix by hovering over the coordinates, it'll pop up a box with a 3x3 grid of numbers - that's the one I need.

They all use the same on their original "Slot" (Bip01 L ForearmTwist for NiStringExtraData) and that's the way I do it with my self-made Meshes so there wouldn't be any difference.

Yes, shields use Prn = "Bip01 L ForearmTwist" and two-handed weapons use "BackWeapon" and one-handed weapons use "SideWeapon". Manipulating that node has been most of the work I've done so far, actually.

But I'd prefer to specify the value myself with a function using a float as a parameter. So Vote for the NthFunctions.
Just in case a special shield doesn't fit.

Well, the ideal would be to call the same code on every shield, and there would be no way to check if it looks right (unfortunately). That's why hopefully there is a one-size-fits-all answer here.

You may notice with some mods that the off-hand weapon does not look so great, for this very reason.

Even if it doesn't matter, I do use compressed BSAs. ;)

Heh, good to know.

get the zlib source, open a vs command prompt and build it with "nmake -f win32/Makefile.msc". now you've got a static lib too. zlib.lib = static, zlib1.lib = dynamic. just link against the static one to get rid of the dynamic dependency.

I will give that a shot; currently it seems to work without zlib1.dll (took a lot of work to get to this point!), but now it's failing to work with Oblivion - Meshes.bsa, though, so that's not helpful. I have to look into it more...
User avatar
Latino HeaT
 
Posts: 3402
Joined: Thu Nov 08, 2007 6:21 pm

Post » Tue May 17, 2011 3:21 am

Yeah, this is the coordinate system I was trying to say that NifLib doesn't use (heh); both of the representations that you can choose in NifSkope (Axis and Euler) are for people; the computer sees both as the same 3x3 matrix. You can see that matrix by hovering over the coordinates, it'll pop up a box with a 3x3 grid of numbers - that's the one I need.


I don't bring up any other way, so maybe you can try for yourself: http://www.4shared.com/file/75096656/b1e5b4a4/FurShieldBack.html (One of my BackShield-Meshes)

Well, the ideal would be to call the same code on every shield, and there would be no way to check if it looks right (unfortunately). That's why hopefully there is a one-size-fits-all answer here.

You may notice with some mods that the off-hand weapon does not look so great, for this very reason.


Well, I already said I prefer the other way. ;)
Another difficulty with the BackShields would be that I use another way than tyc_ho does. He uses the Quiver-"Slot" (and sth. around 0 for all coordinates IIRC) which I didn't use anymore, because this way the shields doesn't show up while riding. And there's also a Version which uses Quiver2 as the Slot, so a unified Version could be a little tricky; at least if another one than just me decides to use NifScript for that purpose. ;)
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Tue May 17, 2011 4:18 am

Interesting, I'm going to play around with this the next few weeks. :)
User avatar
sexy zara
 
Posts: 3268
Joined: Wed Nov 01, 2006 7:53 am

Post » Tue May 17, 2011 12:30 pm

I don't bring up any other way, so maybe you can try for yourself: http://www.4shared.com/file/75096656/b1e5b4a4/FurShieldBack.html (One of my BackShield-Meshes)

Mm, yeah, I've got it. For the record, http://img.photobucket.com/albums/v238/DragoonWraith/Oblivion/NifScript/NifSkopeRotationMatrix.png is what I meant.

Well, I already said I prefer the other way. ;)
Another difficulty with the BackShields would be that I use another way than tyc_ho does. He uses the Quiver-"Slot" (and sth. around 0 for all coordinates IIRC) which I didn't use anymore, because this way the shields doesn't show up while riding. And there's also a Version which uses Quiver2 as the Slot, so a unified Version could be a little tricky; at least if another one than just me decides to use NifScript for that purpose. ;)

Well, yes, I understand that - and he'd probably want a different amount of translation and rotation since it's attached to a different node - but you still have the problem, if you want to apply the scripting to "whatever shield the player has equipped right now", that you don't know very much about that shield (unless you hard-code it to check the nif's name and give different amounts of translation and rotation for those). I was thinking more for a dynamic, global shield-on-back mod, ya know?
User avatar
Sharra Llenos
 
Posts: 3399
Joined: Wed Jan 17, 2007 1:09 pm

Post » Tue May 17, 2011 2:26 am

ok, question. I tried this with a mod before but wasn't able to get it to work. Basically I let the PC put a single item in a Container. then I moved an activator from under the floor to above a pedestal in the same room. I believe I used CopyGroundPath (or get and set, I'd have to look through the commands again) to change the activator into a copy of the item the PC placed in the container. And then I had a script on it to make it rotate. It all worked fine until I realized that the mesh's collision was turned on. Basically the PC could drag it around the room and throw it around and stuff--not pick it up, but stop it from rotating and make it simple clamor to the floor.

Could this fix that, or could something be implemented so that this could fix it? Or is it simply beyond the scope of what this does.
User avatar
Emma Pennington
 
Posts: 3346
Joined: Tue Oct 17, 2006 8:41 am

Post » Tue May 17, 2011 6:56 am

Yes, it could be made to do that. Not there yet, however.

A very good idea, nonetheless, I'll keep that in mind!
User avatar
Gen Daley
 
Posts: 3315
Joined: Sat Jul 08, 2006 3:36 pm

Post » Tue May 17, 2011 12:27 am

An update before I go to bed - I fixed the link issue... but now the BSA reader doesn't work anyway. Very frustrating. Will work on that, but probably not tomorrow - have class tomorrow and I'm going out after with my girlfriend. Wednesday night is probably the next opportunity I'll get.
User avatar
christelle047
 
Posts: 3407
Joined: Mon Apr 09, 2007 12:50 pm

Post » Tue May 17, 2011 3:49 pm

Yes, it could be made to do that. Not there yet, however.

A very good idea, nonetheless, I'll keep that in mind!

that would be amazing 'cause I lost interest in polishing off the mod when I found out I couldn't have the visuals the way I wanted. I requested it in the OBSE thread (and though I hoped they would but didn't expect it) but it never came to fruition. But that would be pretty amazing, if you could do that.
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Tue May 17, 2011 10:50 am

Mm, yeah, I've got it. For the record, http://img.photobucket.com/albums/v238/DragoonWraith/Oblivion/NifScript/NifSkopeRotationMatrix.png is what I meant.


Well, yes, I understand that - and he'd probably want a different amount of translation and rotation since it's attached to a different node - but you still have the problem, if you want to apply the scripting to "whatever shield the player has equipped right now", that you don't know very much about that shield (unless you hard-code it to check the nif's name and give different amounts of translation and rotation for those). I was thinking more for a dynamic, global shield-on-back mod, ya know?


If I'd use a Global command which does this for me, where's the difference? :mellow:
Another advantage of the Nth-Functions would be that it's possible to change those Records without requesting a single command for every one of them.
Just in case someone wants to change the same things to other values to accomplish sth. I can't think of now. ;)
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Tue May 17, 2011 1:39 am

DragoonWraith:
All the shields should be the same, Vanilla shields and Mod shields if not then the mods need to be fixed. You need so set a standard for all mods. I do not understand why a modder should deviate from the Vanilla shield setup in the first place.
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Tue May 17, 2011 12:45 pm

If I'd use a Global command which does this for me, where's the difference? :mellow:

It's not, it's just easier for me to code.

I do intend to eventually expose things directly (i.e. the Nth versions), but I still need to figure out how best to do that.

Another advantage of the Nth-Functions would be that it's possible to change those Records without requesting a single command for every one of them.
Just in case someone wants to change the same things to other values to accomplish sth. I can't think of now. ;)

Right, which is why, eventually, I do intend to expose them. More work needs to be done on the back-end for that to happen, though.

DragoonWraith:
All the shields should be the same, Vanilla shields and Mod shields if not then the mods need to be fixed. You need so set a standard for all mods. I do not understand why a modder should deviate from the Vanilla shield setup in the first place.

Uh... no. Well, for the Prn node, yes, but not for the translation/rotation - whether or not that works depends on the placement of the shield on the arm - if a particular shield is, for example, further up on the arm, the same translation/rotation will put it on the wrong place on the back, or something. There is a general 'standard' used by Bethesda, but there's no good reason modders should be restricted to that. It's not "wrong" to have the shield be placed a little differently. That's all aesthetic.
User avatar
Rachel Hall
 
Posts: 3396
Joined: Thu Jun 22, 2006 3:41 pm

Post » Tue May 17, 2011 10:16 am

It's not, it's just easier for me to code.

I do intend to eventually expose things directly (i.e. the Nth versions), but I still need to figure out how best to do that.


Right, which is why, eventually, I do intend to expose them. More work needs to be done on the back-end for that to happen, though.


Uh... no. Well, for the Prn node, yes, but not for the translation/rotation - whether or not that works depends on the placement of the shield on the arm - if a particular shield is, for example, further up on the arm, the same translation/rotation will put it on the wrong place on the back, or something. There is a general 'standard' used by Bethesda, but there's no good reason modders should be restricted to that. It's not "wrong" to have the shield be placed a little differently. That's all aesthetic.


OK, didn't know that.
Just thought it would be easier for you to just make one single command then making many different versions of the same command.

Oh, a request if you accomplish it to implement the Nth-Commands: Please also add a Get-Version of them. ;)
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Tue May 17, 2011 2:02 am

As long as we're doing Q&A! :)

Is it possible to isolate different elements of a mesh through a script? For instance, on most Vanilla armors, how a pauldron is a separate object (sorry, don't know mesh lingo) from the body armor... Would it be possible to somehow pinpoint those elements, separate them, and recombine them for new armor combinations?
User avatar
Harry Hearing
 
Posts: 3366
Joined: Sun Jul 22, 2007 6:19 am

Post » Tue May 17, 2011 4:11 am

OK, didn't know that.
Just thought it would be easier for you to just make one single command then making many different versions of the same command.

Eventually, yes, it will not be tenable to continue making specific functions. While I'm still figuring that out, however, it's easier to just make the pre-made versions.

Oh, a request if you accomplish it to implement the Nth-Commands: Please also add a Get-Version of them. ;)

But of course!

Actually, that will pose something of a problem - translation and rotation values are vectors and matrices, not single values. Oblivion does not support those kinds of things.

So the Get versions may have to wait til v0017 for arrays.

As long as we're doing Q&A! :)

Is it possible to isolate different elements of a mesh through a script? For instance, on most Vanilla armors, how a pauldron is a separate object (sorry, don't know mesh lingo) from the body armor... Would it be possible to somehow pinpoint those elements, separate them, and recombine them for new armor combinations?

Yes. Look at meshes in NifSkope - separate NiTriStrips can be removed and copied and placed at will, essentially (well, with a fair amount of work on my part, but that's besides the point), so yes, that should be possible. I'm pretty sure Pauldrons have to be a separate object for the sake of animation, but I have a lot to learn about that stuff first.

EDIT: By the way, I should mention that opaj is doing some excellent work on a better version of the test mod. Just letting people know so people don't re-invent the wheel.
User avatar
Monika Fiolek
 
Posts: 3472
Joined: Tue Jun 20, 2006 6:57 pm

Post » Tue May 17, 2011 7:51 am

Does anyone happen to know what this would mean in C++?
fileInfo[file_number].size & (1<<30)


fileInfo is an array of struct's, and size is an unsigned int (corresponding to the size of a Nif within a BSA). I'm not familiar with the (1<<30) bit or the binary & operator...

Also: Updated readme and OP, apparently the BSA reading thing does not work as well as my testing had indicated. Still looking into that.
User avatar
Kieren Thomson
 
Posts: 3454
Joined: Sat Jul 21, 2007 3:28 am

Post » Tue May 17, 2011 12:32 pm

checks if the file in the .bsa is http://www.uesp.net/wiki/Tes4Mod:BSA_File_Format#File_Record
User avatar
Maya Maya
 
Posts: 3511
Joined: Wed Jul 05, 2006 7:35 pm

Post » Tue May 17, 2011 9:23 am

Does anyone happen to know what this would mean in C++?
fileInfo[file_number].size & (1<<30)


fileInfo is an array of struct's, and size is an unsigned int (corresponding to the size of a Nif within a BSA). I'm not familiar with the (1<<30) bit or the binary & operator...

Also: Updated readme and OP, apparently the BSA reading thing does not work as well as my testing had indicated. Still looking into that.

If I recall correctly this is a "shift-left" operation together with a binary "and".

Let's say I have an integer variable "x" with a value of "4". Its binary representation is "...000100". Now I make a call "y = x << 1". This leads me to "y" having the binary representation "...001000" which is the decimal value "8".

"1<<30" now should be the "1" at the 31st position in the binary stream, which means 2^30 in value (if I'm calculating right).
An Integer should have 32bits to represent its value. "size" will be something like "????...??"(32 digits). Using this binary operator "&" with the "1<<30" would result in something like:

"????...??" &
"0100...00" =
"0?00...00"

If "size" actually is only the size, I don't know what this should give you. But because they use it I'd guess they encode some more information in "size" than only the size. And with this operation they're quite interested in the 31st bit. If this operation results in "2^30", then it's set, otherwise this operation will lead to "0".

edit: Oh, missed the post above me. Now we know "why" they do it. :embarrass:
...sorry for the math and computer sciences lesson.
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

PreviousNext

Return to IV - Oblivion