Quirks of the Skyrim engine #1

in skyrim •  7 years ago 

About

So I thought I might tell you about some of the problems you can encounter when you begin to mod for Skyrim. And I don't mean general lack of knowledge. I mean behavior of the engine of the engine or the Creation Kit that seem counter-intuitive. Stuff that seems to go against common sense and you just have to know.

Today's episode: A portcullis can't be open

Normal doors in Skyrim are of the type ObjectReference, like many other things as well. A chair is an ObjectReference, a kettle is one, a piece of food on the table, the big treasure chest at the end of the dungeon, the list goes on.

On the scripting side (where you tell the engine what to do), you can access these references through function which they provide. One such function is GetOpenState. As you can see from the documentation, it will tell you whether a door, for instance, is open or not. Might be useful to know on occasion.

Not everything that's an ObjectReference can be opened or closed. How do open or close a roasted goat leg? Or a candle? However, what would you think of a portcullis? Is that something that can be opened or closed? Something that can have a state which is either "open" or "closed"?

Most people would say "yes" to that question. However, in Skyrim, a portcullis is always closed. Even if it's open, a call to GetOpenState() will return 3 (meaning it's closed). Even if you were to consider it an object which can't be open or closed, the documentation says the function then should return 0.

It may have something to do with the fact that a portcullis is an activator-type object and not a door in the internal logic of the Creation Kit. But without any knowledge of the internal workings, who would assume that a portcullis can't be open?

You can't deduce or reasonable guess it. You just have to learn it.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!