Jump to content

1 Screenshot

About This File

K1SE is a script extender for KOTOR 1, in the same tradition as SKSE, OBSE, and NWNX. It is a DLL that loads with the game and gives NWScript functions BioWare never exposed. You write ordinary scripts, compile them with your normal compiler, and add one include line.

This is a tool for mod authors. It does not change anything in the game by itself. On its own it is invisible.


BEFORE YOU DOWNLOAD: Steam only, and only some Steam builds

Every address K1SE uses was derived from one game executable on one machine. At launch it checks your game against eleven fingerprints, and if they do not match it refuses to install and does nothing at all. GOG, retail disc, localized builds, and anything patched have never been tested. Not broken, just never looked at.

That refusal is deliberate. K1SE will not run against offsets it cannot confirm, so it cannot quietly corrupt a save on a build it does not recognize. But it does mean the honest supported list right now is a single build. docs/SCOPE.md in the archive lays out exactly what the evidence base is.


WHAT IT ADDS

Bitwise and integer math. AND, OR, XOR, NOT, three shift variants, popcount, plus min, max, clamp, sign, Euclidean modulo, integer power, and integer square root. NWScript has no bitwise operators at all, so if you have been faking bit flags with arithmetic, that is over.

A key-value store. Set and get strings or integers by string key, test existence, delete. In memory only, cleared when the game restarts, 256 entries. Useful for passing state between scripts inside a session. It is not a save system.

Feats, skills, and saving throws. Grant or remove a feat, adjust skill ranks, adjust Fortitude, Reflex, and Will base saves. These write into the character and survive save and reload.

Utility. A version check, a build id string, an error code you can read after a refused operation, and a logging call so you can drop your own markers into K1SE's log alongside what K1SE did.

Full signatures and notes for every function are in docs/API.md.


READ THIS IF YOU USE THE FEAT FUNCTIONS

A granted feat is permanent. It is written into the creature's feat array and it survives saving and reloading. KOTOR has no engine path that removes an array feat, so K1SE's remover is the only one that exists, and it persists too.

Treat every grant as one-way until you have tested removal inside your own mod. Test on a save you do not care about. The same applies to skills and saving throws.


INSTALLATION

1. Open your KOTOR folder, the one with swkotor.exe in it. On Steam: right click the game, Manage, Browse local files.
2. Rename the existing binkw32.dll to binkw32_real.dll.
3. Copy K1SE's binkw32.dll into that folder.
4. Copy kse.nss to wherever your script compiler looks for includes.
5. Launch the game. K1SE writes a log to %LOCALAPPDATA%\KSE\kse.log and the top of it tells you whether it loaded.

K1SE forwards every call to the real library, so the game behaves normally whether or not K1SE installs itself.


UNINSTALLATION

Delete K1SE's binkw32.dll and rename binkw32_real.dll back to binkw32.dll. That is the whole uninstall. The only other thing K1SE leaves is its log folder, which you can delete.


THE THING THAT WILL CATCH YOU OUT

If K1SE is not loaded, K1SE calls do not throw an error. They silently return zero. That is indistinguishable from your mod being broken.

Guard every script that uses K1SE:

    if (KSE_GetVersion() <= 0) return;

Use <= 0 and not == 0. An older K1SE returns a negative number rather than zero, and == 0 would let it through.

If a K1SE script appears to do nothing, read kse.log. It is the only place that records whether K1SE loaded and, if it refused, which fingerprint failed.


COMPATIBILITY

Requires the binkw32.dll slot. If you already run another mod that replaces binkw32.dll, the two will conflict and you will have to pick one.

KOTOR 2 is not supported and has not been tested.

Stability: K1SE ran for 7 hours 10 minutes under sustained script load without crashing or degrading. That is a run length result, not a leak measurement. No leak measurement has been made.


WHAT WOULD HELP MOST

One read-only check on a non-Steam install. GOG, retail disc, anything that is not the build this was developed against. More testing on my own machine cannot widen the supported list, because it is the same single witness re-attesting itself. One run on a different copy of the game is the contribution that actually changes what this project covers. Come to the Discord if you are willing.


PERMISSIONS

MIT licensed. Use it, modify it, redistribute it, bundle it inside your own mod, commercial or not. Keep the copyright notice and license text with it. No permission request needed.


SUPPORT

Discord: https://discord.gg/EqR7uqQy3f

Bug reports, questions, and "it will not work on my copy" all welcome. Attach your kse.log. It answers the did-it-load question in about two seconds.

Edited by TheMMN


User Feedback

You may only provide a review once you have downloaded the file.

There are no reviews to display.

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines.