Open Scripting Discussion [Morrowind, Oblivion, and Skyrim]

If you need help for projects, mods, or development, post it here. No adult content, please.

Open Scripting Discussion [Morrowind, Oblivion, and Skyrim]

Postby DARoot » Sun Feb 05, 2012 4:49 pm

Well, now ... In a (somewhat) departure from my usual silliness ...
I decided to start this thread because of an interesting discussion that arose on the Wolflore MW "Help Wanted" thread, that I wanted to contunue. [Jac/Elaura -- Feel free to move this, if you think it belongs elsewhere].

A Member asked for scripting help, to accomplish a specific function in Morrowind that he/she didn't feel confident enough to do themselves. Several other Wolflore Members responded.
The discussion proceeded, and [as many of us Wolflore Members are wont to do], soon "branched off" on tangents of general scripting issues and philosophy, and other things, that [may have] so confused the OP that [to date] he/she hasn't yet come back with an "I, yes, or no" response to our "help" attempts.
So, in an attempt to not further "derail" that Member's original thread, and because --
- We don't really have a dedicated "Construction Set" thread/discussion area here on Wolflore [Neildarkstar started a "Morrowind Confusion Set" thread a while back, but that was mainly dedicated to "rants" regarding it's peculiarities...It's still there, for anyone who wishes to add to it ...];
- Since most Wolflore Members are already experienced modders (privately, or for the Public), it may be that this discussion is of no interest, since they already know all there is about it (or, think they do...);
- FYI the "Construction Set" area on the Official Bethsoft Forums was always one of my favorite haunts, when I was still participating over there ...;
- Scripting is, in itself, a complex, fairly esoteric, and yet oddly compelling and interesting aspect of modding these Bethesda [and other] games [if they have them];
- There is always something new to learn, every day ...

So ...
Here, for background, is the discussion that has gone before, for anyone who hasn't seen it already --
Neildarkstar -- "Hmm.. this is likely more complicated than you might think. To make the plant grow is not hard, but changing the ingredient is difficult. You can use a timer and setscale to alter the size, but you have to change the container (plant) entirely to change the ingredient as far as I know.
First a scripter would need to know how/when you plan to start the script, so then over a period of time you could change the scale, but to change the ingredients you would have to disable the original plant and place a new one with a different ingredient. Perhaps it's possible to change an ingredient using MGE or MWSE, but I'm not familiar with them. Then it could "grow" for a time and then you could do it again.
Anyway, more info is needed to make a script that would actually work the way you want."

DARoot -- "As a suggestion, you might want to consider a variation on one of the various "NPC Scheduling" scripts that numerous modders use to move NPCs around, or have them show up in different areas, at different times of the day (or days of the week). For your purposes, however, you would have your plant(s) show up at the SAME coordinates, at whatever interval you decide on, but each time it "grows" you place a DIFFERENT plant object (bigger, with more ingredients) which you would have to create in the CS, and assign a unique Object ID to, ahead of time, and just use your script to enable/disable them at whatever interval. Not too hard to do, if you have a working "NPC Scheduling" script you can simply edit... [I'd also suggest starting with a single plant in a pot, for testing purposes, and once that is working well, THEN you try to make a whole field of the things.]
Best of luck!"

Neildarkstar -- "That's kind of what I was thinking, except... the NPC sceduler would have to be changed so much that it would probably be easier to just make a new script. Among other things the scehduler is based on moving the object, and does so by checking Gamehour, which is probably way too fast for what's wanted here. Also, the means of starting the script would be important. Is he trying to havethe PC plant a seed? Are plants supposed to start growing when the PC enters a particular area? If the script is global, you would likely find the entire thing has run its course before you ever get to the area. Is the process open-ended, or does it stop at a particular size? There is a lot more info needed to make a working script that will fit all of those possibilities, eh?"

DARoot -- "An additional suggestion --
The scripting from Princess_Stomper's "The Holiday Mod" (which is a pretty nifty mod, in it's own right, if you don't already have it) might serve you quite well as a "template" for what you are trying to do, since it is ALREADY set up to enable/disable unique objects [e.g., vendor stalls with holiday-specific stuff; decorations in the Vvardenfell towns; etc.] on a monthly or yearly basis. Might be easier for you to edit, once you've analyzed how it works.

Neildarkstar -- "I don't think our OP is coming back, he probably got someone to write a script for hem on some other site. However, you bring up an interesting point. The notion of K.I.S.S. as it pertains to scripting. Using a script that is similar but intended for a different purpose can be quite tempting, and often is a shorter method of arriving at the same point. However...
That "simplicity" can have pitfalls, much like a shortcut. As an example of the pitfalls of shortcuts, I will point out a nice Japanese couple, touring my state (Oregon), when their GPS indicated a shortcut crossing our coastal mountain range. Their bodies were found and removed a few weeks later.
It seems like a simple proposition to take an existing script and just plug in new variables and object IDs, and sometimes it is just as simple as that. Other times though, things can become a bit weird. Like if local variables are too close to globals, or if comments describing functions no longer make sense after you're done.
There is also the danger of missing an object or variable that should be changed, and because often vital global variables are changed in dialogue or from a supportive script it might be omitted entirely. A lot of scripters don't comment very well, and globals used are often not given in the script. Then there is the issue of whether or not somebody is going to recognize their script and get your mod pulled as a result. Scripts by Mad Max come to mind, eh?
To use a script as a basic guide to see how certain functions work with if blocks and that sort of thing is not a bad compromise, but often the newbie scripter will not see the pitfalls built into copying a script and changing out the variables.
On a last note, if you use someone else's script without understanding the scripting process, you aren't going to learn very much, and if you understand the process, then it's really not so difficult to write your own script unless you have complicated algorithms or calculations (like Mad Max's riding scripts for instance).
Just my opinion, eh? ...but if a person doesn't like the type of help I may offer, they are free to do it any way they want."

Symon -- "Ah comments are vital.
For that matter, globals are grossly over-used. When I do use them, I like to make a point in my scripts of 'declaring' globals with all the variables you must declare, with something like:
;global varname
Shouldn't miss them then I hope. Been programming professionally since 1980, so I've seen ALL the bad habits, especially in TES scripts."

Food for thought?
Got your creative/commenting juices flowing yet? Bring 'em on!
And, now my own 2 cents in addition, just to get you goin' further, maybe...

I am not a "scripter," per se.**
I have composed many scripts (for my own, personal use), but never "from scratch" ...
- I have added additional "Fast Travel" destinations to MadMaxx's "Ultimate Galleon" mod script [which is HUGE -- so, I eventually ran into the "Script Lines/Size" limitation -- which I overcame (to a certain extent) by eliminating the "Shoot the Birds" and "Practice Cannon Firing" [and a couple other sections, which may have been fun in the beginning, but ... really, who cares? in the long run ...];
- I adapted the "Cannon Firing" scripts from the "Booty Island" mod to a trebuchet [from, I think, the "Bob's Armory" mod] to actually fire iron balls, rocks, and fireballs, and inflict real damage [if you manage to achieve a "hit"] on NPCs, creatures, and static ships, buildings, and walls [well, the target "sections" had to be changed to "activators," since they had to have their own scripts attached , to "disappear" when they took sufficient damage ..];
- I adapted the "NPC Riding" scripts from (another of MadMaxx's) "Pegas Horse Ranch" mod (NPC with some flaky ID, like "Seronryip"?) to provide mounted NPC knights/warriors on horseback, for some of my personal mods.
Great Fun! If you want to do it, you probably CAN do it, in MW, if you try hard enough...

In short -- I simply do not have the correct "brainpower" to write scripts "from scratch."
[Do you know the difference between a "Process-Oriented" mindset and a "Results-Oriented" mindset?]
Me, I ONLY care about getting from "Point A" to "Point B" in the shortest possible time, with the minimum of fuss ...
[Typical "Results-Oriented" personality...]
So, I prefer to take existing scripts, that I KNOW work (from testing, or experience) and "Edit" them to do whatever I want to accomplish at the time (with unique nomenclature, and all that -- can't be stressed too much, to avoid obvious conflicts).
Your mileage may vary, and whatever is "fun" for you is what you (probably) should pursue... This method just "works for me," so that's generally what I advise other people ...

Honestly, I simply cannot keep track of all the fussy, namby-pamby "rules" that are so critical in scripts about use of parentheses, quotes, commas, etc. -- even improper use of "empty spaces" in scripts can screw it up to the extent that it won't work! [Scripts are just SO fussy -- I really don't have time to deal with that cr#p anymore..] And a lot of time, I cannot even SEE those "errors" -- And, I absolutely HATE spending a hour or so on a script, then testing and seeing it won't work, and then having to go back and critically analyze EVERY line to try to find the error, whatever it was. "Too much monkey business, for me t' be involved in!"
Which brings us back to "K.I.S.S."

For me [again, your mileage may vary}, it is just simply much simpler to "adapt/edit" an EXISTING script, that you know ALREADY "works" in-game, by [very carefully] editing it to do whatever it is YOU want it to do. Thankfully, I have acquired a LOT of 3rd-Party Mods over the years, and often have a choice of already-existing scripts to consider, when trying to create anything new ...
And (I cannot stress this enough, in answer to some of the previous comments shown here) -- You MUST understand how the existing script you choose to "adapt" actually works "in situ" [including "Global" variables, "Local" variables, and variables that may need to be set through Dialogue, etc.] to make your "adaptation" work for you.. and if you must also "Declare" them in your edited script ...
[Example -- For something you intend to "release to the Public," you MUST either secure permission, or at least acknowledge, the Original Author in your ReadMe [although, there are some on Wolflore, who will tell you that "words are not copyrighted" -- so use your own discretion...]
For your own use, who cares?

You should (if you haven't already) get a copy of GhanBuriGhan's most recent "Scripting for Dummies" tutorial -- MUCH more useful information than the "HELP" files in the CS ...
If you are still unsure (or, you've spent about 4 hours trying to achieve something, and it still doesn't work as you wish) -- ASK!
We all know what it's like, and there is no embarrassment inherent in asking more experienced modders (here, or elsewhere) what might be the problem!
We at Wolflore are more than happy to help you ....

Got your attention yet? Can't wait to post your own thoughts?
Well, Go for It!
The floor is now yours!
:bouncy: :biggrin: :bouncy:
[** Heh! Heh! More Latin ...] :biggrin:

[H#ll -- I wanna ride!...]

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby neildarkstar » Sun Feb 05, 2012 6:30 pm

Wuhlll That'sa lot ta comment on, pilgrim. 'Specially on Superbowl Sunday, wah-ha-ha-ha. :)

First, I cannot agree enough that anybody doing anything with scripting should have "Scripting For Dummies" handy. Because the TES CS does not use a normal scripting language, even people who are familiar with of the more normal languages will find that things often don't work as anticipated. I personally am familiar with Visual Basic (6.0 and previous), Visual Basic .Net, and Java. That just made my life harder when I first started modding Morrowind.

Okay, let's consider our OP's request in that other thread for some examples of things you might not think of or that will screw things around a bit.

The manner in which scripts are applied and started is very important. If the script is global itmust be started in some fashion, whether in dialogue or in a startup script, or by some action scripted elsewhere.

The stated that he wanted the plants to grow 5 - 10 times, gaining more ingredients at each stage. Fine, but if the script is global and started in a startup script, it will begin when the PC gets off the boat, and will have long completed it's cycle by the time he gets to wherever the target plants are. As a nightmare thought, if he's trying to make this happen globally with all of the plants in the game, the conflicts generated are immense beyond belief. We'll have to assume he's not doing that, eh?

If the script starts somehow when he enters the area of his "garden spot" then basically all of the plants will be growing and changing while he's there, but that would cease while he's gone doing whatever in other areas. So, he's gone for six months on the main quest or something, and he returns to plants that are just as he left them. Maybe that's acceptable, maybe not.

Perhaps the script is attached to the plant, and only runs when the PC is in the area. You might think that is easier, but there are still hidden issues to consider.

First, I had the impression he was not talking about just one plant in a pot. So, consider this... Even if a plant is disabled, any script attached to it continues to run. So, if you have ten different plants with ten different stages and only one enabled at a given time, you will still have a hundred scripts running simultaneously in that area. I'm not saying that would screw with FPS or anything, but I'll bet it wouldn't help.

Then there is the issue of collision. You can place numerous things on top of each other if all but one are disabled, but it doesn't please the game engine. Did you ever disable a table or something ingame, and discover that you still can't walk through the place where it was? That's because although the table is disabled, the collision remains until the cell is reloaded.

The solution is of course to set delete, but there are two things to consider there. First is that you have to have setdelete some 10 (opinions vary, but all modders I know agree that 5 seconds is about the mininum) seconds after the object is disabled, or a CTD is the result. You can put the setdelete in a second script attached to the plant that is being placed, but it might not work. Then if this growing cycle is supposed to repeat, after a set delete, you can't enable that previous object.

I don't know how "The Holiday Mod" gets around various issues I've never looked at the script. Somehow, I doubt that it would work without extensive modification.

Even with very careful modification though, I have seen a lot of scripts screwed up by inept modification, especially on the officials where i used to frequently help people fix the things they had "fixed" or "adapted".

In the end though, I don't think a request for information from our OP buudy was unreasonable if he really wanted help. Besides, the most usual result of such a request is that the asker wantst he askee to just write the script.

Moving on to your modifications of existing scripts... For personal use is one thing, released mods is something else. Mad Maxx's scripts are all copyrighted, and the trig and manner of its use is a dead giveaway as to who they belong to. I personally have never managed to get a response as to permission from him and I ceased trying years ago.

You got around the "Script Lines/Size limitation" by eliminating lines of code and certain results of the script. This really isn't necessary, because all you actually have to do is start a secondary script that runs and then ends with a stopscript. You apparently got what you wanted, but that might not have been the result that was optimal.

An example of such is the "Macap" companion script you tested for me (thanks again!). That mod used a very highly modified version of Grumpy's companion script, and I think four other scripts that were started from within that main script.

As to the visible results of such scripts, consider this. After testing, you stated in your report somewhere that you finally got to see Madcap's fur armor, and you thought it looked odd on that type of character. I didn't say anything, but that told me that however you tested the mod, you didn't travel with madcap for long. If so you'd likely have noticed that he has about five complete sets of armor and a cold-weather robe. The armor is randomly selected each day, and is used as a mix-n-match on a piece-by piece basis. Meaning that the second day you might have noticed his fur cuirass had become Dark Brotherhood, while his pauldroon might have been bonemold, and his greaves netch leather. the next day, it would all have probably changed to a new mix-match with armor you hadn't yet seen. If you tried to use those scripts without knowing a few things, you would probably get a surprise. :D
"If you want to make God laugh, tell Him your plans." - Movie "Flypaper"
User avatar
Jac's Hero of the Day
Jac's Hero of the Day
Posts: 2839
Joined: Mon Jul 25, 2011 7:57 pm

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby DARoot » Thu Feb 16, 2012 5:46 pm

Howdy, All ...
[Since Neildarkstar is the only "Regular Member" who has seen fit to post anything on this thread, to date (and, I assumed from the beginning, that most other "Regular Members" were already well-versed in this area), I'll just post this, for other "Casual Readers," who may happen upon it, and perhaps gain something from it -- It ain't nothin' like a "Mini-Tutorial," just "Comments" -- And, I urge all other "Regular Members" to contribute, should they choose to do so...]

This is just a little, simple, "SetScale" script --
Code: Select all
Begin MySetScale_Script

If ( GetScale != 0.25 )
   setscale 0.25

"Scripting for Dummies" recommends some additional lines/commands, to make the in-game "check" occur only at intervals, so as to keep the "script overhead" processor-time to a minimum, which looks like this:
Code: Select all
Begin MySetScale2_Script

short counter

If ( Menumode == 1 )

set counter to ( counter + 1 )

If ( counter >= 10 )
   set counter to 0
   If ( GetScale != 0.25 )
      setscale 0.25


Specifically, "Scripting for Dummies" says -- "You shouldn't call "setscale" in every frame, at least not in exteriors or other FPS critical situations. The scale will be reset to a value within the 0.5 - 2.0 frame when you reload. So don't use a done-flag to call it only once. Either call it regularly (about all 10 frames) or test for "getscale" and reset the scale when it doesn't fit."

Either/both of the above script code snippets are VERY simple, and can accomplish the same result in-game.

Well, WHY would you want to know about this? All it does is change the in-game size of the selected object --
1) Yes, you can change the scale/size of objects very easily in the Morrowind Construction Set... BUT ...
- You are limited to a range of 0.5 (half-size) to 2.0 (2X-size);
- For some Objects, you can ONLY change the scale/size of the Reference (e.g., the Object when placed in-game), and will LOSE the resizing if the Object is removed and subsequently replaced (such as, if you "pick up," and subsequently "drop" a weapon, and then pick it up again).

2) If you are new to Scripting, but want to learn, this is one of the EASIEST ways to "get your feet wet" with it, through practice!

OK, then ...
- The PRIMARY reason for attaching a script to something (in this case) would be to change the size of the object to something OUTSIDE the range that the MW CS lets you do;
- The OTHER PRIMARY (???) reason for attaching a script to something would be to avoid "losing" the size/scale change when the object is manipulated in-game...
- Lastly, if you (like ME) know absolutely NOTHING about Blender, 3DXMax, or mesh-editing in general, this may be the ONLY way you can change the size of existing in-game Objects... [Make a "Nordic Silver Claymore" into an "Aedrun Silver Shortsword"? -- Child's play!]

So, now we get to some "technical" issues --
- You can attach a script to almost EVERYTHING in MW, but NOT STATICS!
- So, if you create a gigantic (>2x) "Door" [which WILL allow a script], you may have to "create" an "Activator" (preferred over "Misc," or other options, since it cannot be picked up -- and you won't need to add an Icon), using the appropriate Door Arch/Doorway "Static" mesh, to match up ["Statics" cannot have scripts..."Activators" (even if they do nothing) can... or, just create and add a "Door Arch" of the appropriate size, through scripting, to your "Door" script ...]
- For something like a "Weapon," that you can equip, draw, sheath, unsheath, and drop ... you will probably need a script to make it stay the same size in every instance.
- If the "Weapon" (or anything else) ALREADY has a script attached [e.g., for "sheathing/unsheathing"], it is REAL easy to simply add the "SetScale" Code Lines, referenced above, to it's existing script...
You ALSO need to be aware, that there are some "Special" considerations, that you may need to take into account, when dealing with "Containers" and "Book/Scroll" Objects --
These (although they WILL accept user-made scripts) have their own internal, game-engine, "script-like" functions (e.g., "Take/Read," etc.), and "Scripting for Dummies" describes them in detail, and suggests a few additional "script lines" that you should use to prevent problems --

I urge you to obtain a copy of "Scripting for Dummies," by GhanBuriGhan (and others), before proceeding further...
I have been involved in "Beta-Testing" a few mods, by various (otherwise talented and gifted authors), where horrible CTDs occurred, whenever the Player entered a cell where there was a "Door" or "Container" [which contained a "scripted book/scroll"] , where the Mod Author did NOT follow those guidelines...
[You DO realize, I hope, that in-game, whenever the Player crosses an Exterior Cell Boundary, the Game Engine loads the 9 adjacent Exterior Cells - and everything in them? Makes "chasing down" the "Error Message Glitch" all the more difficult -- but, that's a subject for a different thread ....]
I do hope that SOMETHING in this, seemingly rambling, post might be helpful to SOMEBODY, and that more (perhaps better-educated?) Member Scripters will contribute further, in future ...

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby neildarkstar » Sat Feb 18, 2012 5:30 am

A comment or two and a query, if you don't mind.

First,setscale is indeed relatively easy to implement, but it doesn't always work out as you envision it. I createed a true halfling (actually long before the released versions you're probably familiar with) but... You would not believe how hard it was to give him the ability to walk up a flight of stairs.

I can't remember the details,but it seems that when a character is too small, the colision hangs and won't let th character move through a doorway and up stairs. I came up with a workaround, and if I ever release the toatal conversion that he is part of I presume there will be no more issues.

By the same token, I made a fairy race that is roughly 2 inches tall. the setscale was again not a problem, but there were many other issues to address... for one thing, losing a character on the floor in a floor rug because the character sinks to the waist on a floor with no rug then goes all the way under if the rug is not exactly at floor level. Also movement was an issue, so I ended up with the fairy using a constant levitate at very high speed because otherwise she was just too slow, but then she looked really dumb weith her little legs pumping along like an Ethiopian on crystal meth...

Anyway, if you use setscale, be careful what you shrink, and don't be surprised if things get weird. GhanBuriGhan apparently hadn't discovered the collision issues.

Which brings me to my question. I wanted a REALLY big cavern. I tried a variety of things, like making the cavern an actvator and attaching a script, but... it was very hard to work with for several reasons, so I did some research and successfully altered the scale in nifskope, but...

It was perfect until I arrived at the point of testing it. Once the character goes inside, you discover that the collision did not grow with the mesh.

If you check to see where you can freely walk through the walls one way, but not return through apparently open space, you discover that the collision is approximately the size it would be if scale were set to 2.0. Does anyone know how to change the size of the collision box? I've thought of using placed collision walls as a work around, but it'd be plain old clunky...
"If you want to make God laugh, tell Him your plans." - Movie "Flypaper"
User avatar
Jac's Hero of the Day
Jac's Hero of the Day
Posts: 2839
Joined: Mon Jul 25, 2011 7:57 pm

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby DARoot » Sat Feb 18, 2012 12:10 pm

The Rolling Stones, "You Can't Always Get What You Want" ... re=related
"You can't always get what you want...
But if you try sometimes, you just might find
You get what you need

You bring up some good points, Neildarkstar.
I, like you, have run into issues with Actors (NPCs and Creatures) and certain Statics, dealing with collision.
[Plus, with Actors, who have Animations, sometimes you have to play around with the Animation files [Not just with NifScope -- if you have to "tweak" the .kf file, you'll probably need a Hexeditor also...]

- I once "shrunk" a 9-foot tall dinosaur to a 2-foot tall lizard -- but, the "Bounding Box" wasn't affected [meaning, you could aim your sword-thrust about 3 feet above the critter's head, and it would still take damage -- and it wouldn't fit through doorways/cave entrances]. I ended up having to "edit" the Bounding Box in NifScope to at least APPEAR to act reasonably in-game. [But, ONLY the Bounding Box...]

- I'll counter that (and Neildarkstar's) tale(s) of woe with an example of a SetScale Success Story --
I was involved some time ago helping someone who was creating a "City of Atlantis" Underwater mod [all "Interior-as-Exterior" Cells, using the Mournhold buildings/ground meshes]. Since it was "underwater," we hit on the expedient of using one of the existing "water" meshes in Vivec [which ALREADY had an inherent "flowing water/wave action movement" animation], and simply turning it upside-down, scaling it to "fit" above the (Mournhold) cityscapes, and lowering it to JUST touch the tops of the walls. We then added "Invisiwall" collision blockers (also SetScaled) behind it to prevent movement through (the Original Mod Author did not want to "Disable Levitation" in this mod). Clunky? Maybe. But, we were both THRILLED with how it turned out in-game! Looking up, the Player sees "moving water" instead of "sky."
[I have a screenshot, but, since it doesn't move, you cannot observe the true effect].
Incidentally, to the best of my knowledge, that mod was ONLY released on the Original Mod Author's personal website, and I no longer have a link. So, if anyone is interested, send me a PM, and I'll try to tell you what I can remember about where it is.

Now then, we get to two things ---
(a) I'm gonna echo/repeat Neildarkstar's question, for the rest of the Members, but first I need to say --
Remember, this is one of MY threads, so NOTHING is "off-topic," and ALL comments are welcome!
"Collision Issues" is a perfectly fine discussion topic here, if anyone feels so inclined...

(b) "Does anyone know how to change the size of the collision box? I've thought of using placed collision walls as a work around, but it'd be plain old clunky..."

Please comment, if you wish.

[Note: I myself, being a simple soul, use placed collision walls with abandon, since I can.
And, I am more interested in getting from "Point A" to "Point B" as quickly as possible, rather than the "elegance" of my modding efforts...]

Hope to hear more from the "Modding Gurus" here ....

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby Kiteflyer61 » Sat Feb 18, 2012 12:40 pm

I'm not an expert by any stretch of the imagination, but I've been known to tinker from time to time. :D

That being said, I have to ask if you made sure hidden things were being shown in nifskope? Collision boxes and such are usually hidden, but you can see them (and thus scale them) if you turn on "hidden" in the render menu. Some pieces in vanilla MW have hidden collision boxes and some don't. I don't know why. :D

That being said, I wouldn't go any larger than 2x when scaling them up due to texture stretching. Scaling pieces up to 2x in nifscope will allow the piece to actually be scaled to 4x in the CS, which should make for a very large cavern indeed. :D Also, you might want to note that the small to large transition pieces in the cave sets fit exactly when scaled to 2x, meaning that the small end of the transition, scaled to 2x, matches perfectly to the large end of the unscaled version of the same piece. Makes for a very smooth and seamless transition to your huge cavern. :D

If after all that, you find it still doesn't want to work right, I might just be willing to do the scaling in blender and release the set for everyone to use. It might be some time before I can get to it, but it shouldn't be all that hard to pull off. :D

"It is better to remain silent and be thought a fool than to speak and remove all doubt."
User avatar
Posts: 736
Joined: Fri Feb 25, 2011 1:48 pm
Location: Ocean Grove, NJ
Title: Hired Gun

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby DARoot » Sat Feb 18, 2012 2:30 pm

Thanks kindly for the info, Kiteflyer61!
Very helpful!

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby Symon » Sat Feb 18, 2012 5:47 pm

I've always just made a new collision box in NifSkope.

For example, In morrowind, ages ago I noticed that a certain tree had collision far beyond its trunk. I just copied the real trunk into the RootCollisionNode (IIRC the correct name of the node) and removed the grossly oversized box that had been granted to the tree. Made sure the new 'box/trunk' had the correct properties for collision and perfect collision.
"You fertility deities are worse than Marxists," he said. "You think that's all that goes on between people."

Roger Zelazny, Lord of Light. 1971.
Posts: 168
Joined: Fri Feb 18, 2011 6:42 am
Location: UK
Title: Wirrn

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby neildarkstar » Sat Feb 18, 2012 7:15 pm

Symon wrote:I've always just made a new collision box in NifSkope.

For example, In morrowind, ages ago I noticed that a certain tree had collision far beyond its trunk. I just copied the real trunk into the RootCollisionNode (IIRC the correct name of the node) and removed the grossly oversized box that had been granted to the tree. Made sure the new 'box/trunk' had the correct properties for collision and perfect collision.

That is precisely what I want to do, and I can think of many things that have poor collision that might be fixed.

In any case, it would be cool if it doesn't have to be done in Blender. I have real problems being able to see different parts of Blender's interface.

Anyway, having a cave that size could give a lot of latitude to modding efforts. As Kiteflyer61 suggested sharing it, I personally think it would make a terrific modder's resource. If done in nifskope and the CS, it would do away with scripting for it in a setscale type of situation. I'll give this a try and see what happens.

Thanks all.
"If you want to make God laugh, tell Him your plans." - Movie "Flypaper"
User avatar
Jac's Hero of the Day
Jac's Hero of the Day
Posts: 2839
Joined: Mon Jul 25, 2011 7:57 pm

Re: Open Scripting Discussion [Morrowind, Oblivion, and Skyr

Postby abot » Sun Mar 18, 2012 6:01 am

Interesting thread... :hubba:, I'll add my 2 septims for Morrowind scripting

GetScale, SetScale
Additional reasons scale may change...
object scale may be reset to original scale set in the construction set window (0.5 <= scale <= 2.0) on game reloading/on 72hours engine garbage collection resetting properties (can't remember well if both or one of these cases).
But GetScale from a local script just reads a stored in memory value, so it is as fast as it can be.
Slow things are usually those that actually can/do visually change things in-game (e.g redrawing, AI actions...)
Only Setscale (may) change things visually in game here, so you should avoid executing setscale each frame
But Getscale each frame is no problem.
So, no real need for timers/delays or such, IMO the one improvement (to reduce possible problem with comparing floats for equality) could be:
If your object target scale is < 1, game engine may reset it to something >= 0.5, so in that case we can use > comparison operator
Code: Select all
If ( GetScale > 0.49 )  ; getscale executed each frame, no problem
   setscale 0.25  ; setscale executed only when needed

If your object target scale is > 1, game engine may reset it to something <= 2, so in that case we can use < comparison operator
Code: Select all
If ( GetScale < 2.1 )
   setscale 3
Posts: 5
Joined: Sat Mar 19, 2011 6:48 pm


Return to Help Wanted

Who is online

Users browsing this forum: No registered users and 1 guest

  • Advertisement