0 of 0

File information

Last updated

Original upload

Created by

Carlos Leyva

Uploaded by

Papitas

Virus scan

Safe to use

About this mod

Transforms *.psc header files to *.ts files that can be used in Skyrim Platform.

Requirements
Permissions and credits
Changelogs
Warning
This program and libraries aren't meant to be used by mod users, but modders only.
Please read the pinned comment for more info on that.

About
This program is meant to be used to transform SKSE definition libraries to Typescript for using them in Skyrim Platform, so you can use in Typescript all your SKSE libraries the same way you would be using them in Papyrus (here's a real life usage example of using JContainers conversion for an actually working plugin
).

This program's aim is not to automate whole language features translation, but only function headers.
If the *.psc file contains actual code (think PapyrusUtil.psc) the function header will be converted, but the rest will be output verbatim, waiting for a human to come and fix it.

Usage
Drag and drop all your *.psc files to the executable.
It will generate *.ts files in the same folder as its input.

Using converted files
Put all your converted files inside some folder, then add that folder inside the folder where skyrimPlatform.ts is located.



Folders in this image look like shortcuts because they are actually symlinks (the same technology Vortex uses to manage your mods).
You don't need to use symlinks. You can just drop your folders there.

Once folders are where they are supposed to be, import modules from Typescript as usual.

import { on } from "skyrimPlatform"
import * as JArray from "JContainers/JArray"

// Lines irrelevant to our illustration purposes were ommited.

on('update', () => {
  const a = JArray.object()
  JArray.addInt(a, 5)
  const t: number = JArray.getInt(a, 0)

  // This outputs `5`, indeed.
  printConsole(`Array value: ${t}`)
})

I've added to my github project some converted files for libraries I use myself.
Grab them at the conversions folder.

BEWARE: Not all functions have been tested.

Remarks
This program has no way to know the intention of the humans that made the scripts, so it's always advisable to manually check all generated files to make sure everything is declared as it should.

Take note the program assumes generated scripts will be put in some subfolder to the folder where skyrimPlatform.ts is found, otherwise you'll get "Cannot find module..." type of errors when coding your plugin.

If you want to have your scripts in some other place, you can always just change the relative path of each importfor each *.ts file, of course.

Github project page
Source code here
  翻译: