A bit of clarification, since there seems to be quite a lot of confusion.
Files made by this program mean nothing to you if you are not a modder doing plugins for Skyrim Platform. These files don't replace Papyrus compiled scripts. So you should leave all files as they are.
In fact, if you are an user you will NEVER have to care about this program existence. No mod will ever ask you to use these files, nor downloading it for anything.
Unfortunately, it's impossible (at least for me) to create a program that automagically transforms Papyrus compiled files to Typescript so you can benefit right away from Skyrim Platform.
What this program and Typescript files do is helping your favorite mod creators to transition their mods more easily to Skyrim Platform.
Sorry about the confusion. Programmers often assume everyone knows whatever they know and skip these kind of TOTALLY NEEDED clarifications.
BUT if you are a mod user and want to contribute to the cause of making Skyrim Platform widespread, please tell your favorite mod authors Skyrim Platform exists and tell them this program will make them to use SKSE libraries the same way they would be using them in Papyrus.
Each one of us can do something. For example, I don't know if I'm at the programming level required for helping developing Skyrim Platform, but I can totally make these kind of tools and teach other programers how to transition, and that's what I'm doing :)
Skyrim Anniversary Edition will break skse and all skse libraries, I hope this disaster can be an opportunity for creators to start adopting skyrim platform.
Imagine if someone could convert Frostfall and Campfire to TypeScript. It would explode the modding community. Unfortunately, I'm not a coder, so I can't help with the matter. But hope still lives.
For someone who doesn't know typescript, how much work would be involved in converting the iEquip scripts? I need an eli5 here. Also, how does this work where I currently have scripts attached objects in the CK? And iEquip relies on SKSE functions from several plugins in addition to iEquipUtil.dll - these calls all still work in the converted code and don't require any revision to the C++ in the plugins?
This will convert your *.psc files filed with function headers pointing towards SKSE functions straight to Typescript, so you can use them in SP the same way you would use them in Papyrus. Skyrim Platform lets you call SKSE functions from any dll. This program aids you in making easier to do so by converting your already made *.psc files.
I haven't seen your source code for iEquip *.psc files, but let's suppose you have something like this: Scriptname iEquip_SKSE
Form Function GetPlayerWeapon(Actor player, int hand = 0) Global Native
Let's suppose you would use this for getting the right hand weapon in Papyrus: Form w = iEquip_SKSE.GetPlayerWeapon(playerRef)
Since SP doesn't know about Papyrus scripts, but can access SKSE functions, without files from this program you would need to do this in Typescript: import * as sp from "skyrimPlatform"
const w = (sp as any).iEquip_SKSE.GetPlayerWeapon(playerRef, 0)
Notice how you must supply all parameters; there are no optional parameters by default. And any single call to your functions would be preceded by the (sp as any) cruft.
But if you convert iEquip_SKSE.psc using this program, all those things would be hidden from you and it would convert all optional parameters to Typescript as well. Then you would do something like this: import * as iEquip_SKSE from "iEquip/iEquip_SKSE"
const w = iEquip_SKSE.GetPlayerWeapon(playerRef) The first line (import) assumes you put the converted iEquip_SKSE.ts file in a folder called iEquip and you put that folder inside x:\Steam\bla bla bla\Data\Platform\Modules\ or wherever you have skyrimPlatform.ts.
And yeah, you are right. This (happily) won't require recompiling or revisiting C++ code.
Let me talk about your other questions in a new message. I don't want to take the risk of losing everything I've written so far.
SP is more like C++ in the sense that it won't attach scripts to objects but it can react to game events and such, so iEquip would need to be rewritten for taking that into account. Right now the Discord channel for SP is quite active and we modders are devising and learning ways to interact with Papyrus. But as far as I've seen, SP makes it possible to bypass Papyurs completely if you know how to do it.
The only things I've been having problems with is to get parameters from Skyrim events (SP has created some events for things not available in Papyrus and they work fine), but I think I can open a Github issue on that once I gathered enough info one of the project leaders has already opened an issue on that.
Want my honest opinion? I think translating all your Papyrus algorithms to SP may be quite a lot of work (depending on how much code they account to), but it's totally worth it.
I don't know at all about the internals of iEquip, but I remember you saying iEquip won't react instantaneously, so we must not mash buttons. If that slow processing time is due to Papyrus slowness, SP will get rid of it forever.
I followed all the instructions but I'm lost after putting the converted .ts files into a folder under Modules. Do I need to do another step?
Also, how will I know if these are working in-game? I'm new to Skyrim Platform but I believe this is something big once a lot of modders get wind of this.
Explaining you how you can know if they work in game saying other thing that "just test your functions" would need a reeeeeally long winded explanation. What I did to learn how to use SP whas taking their example plugin and went from there.
I'm thinking on doing an step by step tutorial on how to setup your mod, but meanwhile I hope the building steps for this help you.
I'll show you the code for a plugin I made and it's actually working.
Anyway, I can easily help you here with paths and such.
Thanks for the quick response. My questions may be dumb but here goes:
So I converted a bunch of my mod setup .psc files using your Typescript.exe. Then I moved them to a folder named "converted" and put that folder under Modules where SkyrimPlatform.ts is located. Now I'm lost at "Once folders are where they are supposed to be, import modules from Typescript as usual." step.
Also I tried both installing Skyrim Platform using MO2 and manually in the Data folder and I always get "'npm' is not recognized as an internal or external command, operable program or batch file". So that means Skyrim Platform is not active on my game?
Ok. It's good to hear those kind of things because I know what to write in my tutorial.
I don't know about your programming experience, but in Papyrus there's no thing as importing modules. Well it is actually, but a bit hidden to coders to free them from that burden.
When you use Game.GetPlayer() you are actually importing a module called Game, then using a function named GetPlayer that resides in that module. In Typescript you must be more explicit.
At the start of a file, you need to add a line saying import something before you can use it that file. In this case, you need to add a line saying:
import * as somefile from "converted/somefile"
somefile.someFunction()
Where somefile is one of the files generated by this program.
BTW, unlike Papyrus, Typescript is case sensitive. This means somefile is not the same as SomeFile.
"'npm' is not recognized as an internal or external command
Yeah... I knew this was bound to be one of the biggest problems for people who wanted to start to make mods using Skyrim Platform.
You need to download node.js for that command to be available. Once you install it, you can actually run npm i from the command line.
I know you will come with more questions because I'm purposely holding some info so you can go step by step. Don't hesitate to ask me when you are ready to continue.
Thanks for the help and tutorial. I am digesting it and hopefully I can mod my own.
That aside, this is a revolution in Skyrim Modding and opens up a lot of new possibilities. I just wish I am a programmer myself so I can contribute. Your works are well recognized and appreciated.
Yeah. Don't worry. Adapting to new things always takes time and it's always daunting, but sooner than later you get the hang of it and it becomes easier and easier.
Thank you for your kind words. To be honest, I always thought I could never do something to help the cause, but here I am somehow xD I did this tool for myself, actually. I didn't expect for people to care about this, but I'm glad it's helping.
So... don't sell yourself short. I'm quite sure you can do help the cause with other things than making programs :)
I'm not a programmer but as soon as saw Skyrim Platform I knew it was a game changer.
If I could build it I would rework the entire UI so that you never had to go into menu system during gameplay. Like the putting functions into the wait menu for things like camping or praying or building out a Radial menu system that was intuitive for changing weapons and magic. https://image.slidesharecdn.com/leopolycell-130621092910-phpapp02/95/leopoly-the-radial-menu-13-638.jpg
I really hope creators of big mods start to look at the direction or Skyrim platform.
After seeing by myself the blazing speed of SP, my first thought was to change the algorithm Legacy of the Dragonborn uses for displaying museum items xD Instead of taking several minutes to take a dozen items, it would take a fraction of a second to take hundreds of items from your inventory. Literally.
does it means that a regular mod user can convert existing mods by just draggin .psc to the executable? I am just asking if then any extra work require or it will already utilize TS if I just randomly drop say vanilla scripts micro opts?
Sorry if I misunderstood something - I just starve for any performance/stability improvements possible for my game currently, thus I am asking. Or should I better wait for "official" conversions of popular mods?
oh and on a side note.. super lazy idea/question but.. what if we can use this through MO2 to go through the whole modlist to convert all found .psc files blindly lmao like SPID formatter does for example
I know I know this sound lazy and lame but I am indeed a lazy and lame person so.. hehe
oh, and when I use your test JContainers file, do I hide original scripts from JC or do I keep them? Like what would be the proper installation procedure, if it exists?
No. It won't automatically convert mods to Skyrim Platform (I wish that was possible xD). There are some... "structural" incompatibilities on how Papyrus and Skyrim Platform work that no machine can solve by itself (at least, not a machine made by me).
What this actually does is helping modders to move their code from Papyrus to Skyrim Platform, so this will help on the process of starting doing (un)official conversions.
I sincerely hope the day when most things are done in Skyrim Platform comes, but the adoption process for modders will be a bit slow for a few months while we learn how to effectively use SP and its Giga Chad team adds more functionality for us to use.
The future is quite bright, trust me. But it will take some time before you notice it.
EDIT: No. You just leave everything as is.
If you are a mod user, you will never need to concern about this program. But if you ever want to do a mod for SP, you will surely want to use this :)
I think that offloading scripts to Skyrim Platform (SP) will allow a better stability too.
I've been looking the mods that contain scripts in my load order: still 163 of them. (In MO2, filters Active and Contains Scripts (papyrus).) I had removed lots of them (creatures, massive NPCs like civil war mods, ...) to make my game more stable and quick.
Maybe by converting those mods and the most heavy mods to SP will we be able to improve speed and stability
USSEP? Vanilla Script (micro)optimization? NFF? XP32 Maximum Skeleton Special Extended - Fixed Scripts? Dynamic Things Alternative? Destructible Skyrim - Breakable Objects SE (Beta)?
Just thinking about the prospect of moving the micro optimizations to SP makes me gasp in awe
Many mods will be possible at last. For example, I'm working on one that despite my best ideas for optimizations and whatnot, still felt a little clunky. Now, with SP will be as if it was always part of vanilla Skyrim.
But I think it's a double edged sword, too. By the way SP works (executing code each frame) badly programmed mods may get even worse xD
I'll make my mission to teach people how not to make bad mods that waste resources :P I'm actually good at that.
39 comments
Files made by this program mean nothing to you if you are not a modder doing plugins for Skyrim Platform.
These files don't replace Papyrus compiled scripts. So you should leave all files as they are.
In fact, if you are an user you will NEVER have to care about this program existence. No mod will ever ask you to use these files, nor downloading it for anything.
Unfortunately, it's impossible (at least for me) to create a program that automagically transforms Papyrus compiled files to Typescript so you can benefit right away from Skyrim Platform.
What this program and Typescript files do is helping your favorite mod creators to transition their mods more easily to Skyrim Platform.
Sorry about the confusion.
Programmers often assume everyone knows whatever they know and skip these kind of TOTALLY NEEDED clarifications.
BUT if you are a mod user and want to contribute to the cause of making Skyrim Platform widespread, please tell your favorite mod authors Skyrim Platform exists and tell them this program will make them to use SKSE libraries the same way they would be using them in Papyrus.
Each one of us can do something.
For example, I don't know if I'm at the programming level required for helping developing Skyrim Platform, but I can totally make these kind of tools and teach other programers how to transition, and that's what I'm doing :)
If that sentence above is cryptic to you, then those files won't do anything for you.
Skyrim Platform lets you call SKSE functions from any dll. This program aids you in making easier to do so by converting your already made *.psc files.
I haven't seen your source code for iEquip *.psc files, but let's suppose you have something like this:
Scriptname iEquip_SKSE
Form Function GetPlayerWeapon(Actor player, int hand = 0) Global Native
Let's suppose you would use this for getting the right hand weapon in Papyrus:
Form w = iEquip_SKSE.GetPlayerWeapon(playerRef)
Since SP doesn't know about Papyrus scripts, but can access SKSE functions, without files from this program you would need to do this in Typescript:
import * as sp from "skyrimPlatform"
const w = (sp as any).iEquip_SKSE.GetPlayerWeapon(playerRef, 0)
Notice how you must supply all parameters; there are no optional parameters by default.
And any single call to your functions would be preceded by the (sp as any) cruft.
But if you convert iEquip_SKSE.psc using this program, all those things would be hidden from you and it would convert all optional parameters to Typescript as well. Then you would do something like this:
import * as iEquip_SKSE from "iEquip/iEquip_SKSE"
const w = iEquip_SKSE.GetPlayerWeapon(playerRef)
The first line (import) assumes you put the converted iEquip_SKSE.ts file in a folder called iEquip and you put that folder inside x:\Steam\bla bla bla\Data\Platform\Modules\ or wherever you have skyrimPlatform.ts.
And yeah, you are right.
This (happily) won't require recompiling or revisiting C++ code.
Let me talk about your other questions in a new message.
I don't want to take the risk of losing everything I've written so far.
SP is more like C++ in the sense that it won't attach scripts to objects but it can react to game events and such, so iEquip would need to be rewritten for taking that into account.
Right now the Discord channel for SP is quite active and we modders are devising and learning ways to interact with Papyrus. But as far as I've seen, SP makes it possible to bypass Papyurs completely if you know how to do it.
The only things I've been having problems with is to get parameters from Skyrim events (SP has created some events for things not available in Papyrus and they work fine), but
I think I can open a Github issue on that once I gathered enough infoone of the project leaders has already opened an issue on that.Want my honest opinion?
I think translating all your Papyrus algorithms to SP may be quite a lot of work (depending on how much code they account to), but it's totally worth it.
I don't know at all about the internals of iEquip, but I remember you saying iEquip won't react instantaneously, so we must not mash buttons.
If that slow processing time is due to Papyrus slowness, SP will get rid of it forever.
Also, how will I know if these are working in-game? I'm new to Skyrim Platform but I believe this is something big once a lot of modders get wind of this.
Explaining you how you can know if they work in game saying other thing that "just test your functions" would need a reeeeeally long winded explanation.
What I did to learn how to use SP whas taking their example plugin and went from there.
I'm thinking on doing an step by step tutorial on how to setup your mod, but meanwhile I hope the building steps for this help you.
I'll show you the code for a plugin I made and it's actually working.
Anyway, I can easily help you here with paths and such.
So I converted a bunch of my mod setup .psc files using your Typescript.exe. Then I moved them to a folder named "converted" and put that folder under Modules where SkyrimPlatform.ts is located. Now I'm lost at "Once folders are where they are supposed to be, import modules from Typescript as usual." step.
Also I tried both installing Skyrim Platform using MO2 and manually in the Data folder and I always get "'npm' is not recognized as an internal or external command, operable program or batch file". So that means Skyrim Platform is not active on my game?
I don't know about your programming experience, but in Papyrus there's no thing as importing modules.
Well it is actually, but a bit hidden to coders to free them from that burden.
When you use Game.GetPlayer() you are actually importing a module called Game, then using a function named GetPlayer that resides in that module.
In Typescript you must be more explicit.
At the start of a file, you need to add a line saying import something before you can use it that file.
In this case, you need to add a line saying:
import * as somefile from "converted/somefile"
somefile.someFunction()
Where somefile is one of the files generated by this program.
BTW, unlike Papyrus, Typescript is case sensitive.
This means somefile is not the same as SomeFile.
Yeah... I knew this was bound to be one of the biggest problems for people who wanted to start to make mods using Skyrim Platform.
You need to download node.js for that command to be available.
Once you install it, you can actually run npm i from the command line.
I know you will come with more questions because I'm purposely holding some info so you can go step by step.
Don't hesitate to ask me when you are ready to continue.
I finished the first steps tutorial.
I'll write the module inclusion one for other day.
Right now I'm tired xD
WARNING.
Foul language and bad jokes at the expense of EVERYONE (me included :P) abound.
I'm mexican, after all :v
That aside, this is a revolution in Skyrim Modding and opens up a lot of new possibilities. I just wish I am a programmer myself so I can contribute. Your works are well recognized and appreciated.
Adapting to new things always takes time and it's always daunting, but sooner than later you get the hang of it and it becomes easier and easier.
Thank you for your kind words.
To be honest, I always thought I could never do something to help the cause, but here I am somehow xD
I did this tool for myself, actually. I didn't expect for people to care about this, but I'm glad it's helping.
So... don't sell yourself short.
I'm quite sure you can do help the cause with other things than making programs :)
Having Typescript definitions means programmers can access JContainers from Typescript.
These files don't replace anything at all.
https://www.nexusmods.com/skyrimspecialedition/mods/27008
I'm one step closer to my dream of modern UI interface for Skyrim
Just imagine ALL the possibilities we have at our hands.
I just fell in love with Skyrim Platform.
It's one of the best things that have ever happened to Skyrim modding.
If I could build it I would rework the entire UI so that you never had to go into menu system during gameplay. Like the putting functions into the wait menu for things like camping or praying or building out a Radial menu system that was intuitive for changing weapons and magic.
https://image.slidesharecdn.com/leopolycell-130621092910-phpapp02/95/leopoly-the-radial-menu-13-638.jpg
After seeing by myself the blazing speed of SP, my first thought was to change the algorithm Legacy of the Dragonborn uses for displaying museum items xD
Instead of taking several minutes to take a dozen items, it would take a fraction of a second to take hundreds of items from your inventory. Literally.
I am just asking if then any extra work require or it will already utilize TS if I just randomly drop say vanilla scripts micro opts?
Sorry if I misunderstood something - I just starve for any performance/stability improvements possible for my game currently, thus I am asking.
Or should I better wait for "official" conversions of popular mods?
super lazy idea/question but.. what if we can use this through MO2 to go through the whole modlist to convert all found .psc files blindly lmao
like SPID formatter does for example
I know I know
this sound lazy and lame
but I am indeed a lazy and lame person so.. hehe
There are some... "structural" incompatibilities on how Papyrus and Skyrim Platform work that no machine can solve by itself (at least, not a machine made by me).
What this actually does is helping modders to move their code from Papyrus to Skyrim Platform, so this will help on the process of starting doing (un)official conversions.
I sincerely hope the day when most things are done in Skyrim Platform comes, but the adoption process for modders will be a bit slow for a few months while we learn how to effectively use SP and its Giga Chad team adds more functionality for us to use.
The future is quite bright, trust me. But it will take some time before you notice it.
EDIT:
No. You just leave everything as is.
If you are a mod user, you will never need to concern about this program.
But if you ever want to do a mod for SP, you will surely want to use this :)
Can't wait to see the first seeds (although they already starting to grow) :)
In a few moths we will see ton of mods that weren't possible before!
I'm quite excited for the future!
I added it in my Free FPS guide
I've been looking the mods that contain scripts in my load order: still 163 of them. (In MO2, filters Active and Contains Scripts (papyrus).)
I had removed lots of them (creatures, massive NPCs like civil war mods, ...) to make my game more stable and quick.
Maybe by converting those mods and the most heavy mods to SP will we be able to improve speed and stability
USSEP?
Vanilla Script (micro)optimization?
NFF?
XP32 Maximum Skeleton Special Extended - Fixed Scripts?
Dynamic Things Alternative?
Destructible Skyrim - Breakable Objects SE (Beta)?
Just thinking about the prospect of moving the micro optimizations to SP makes me gasp in awe
Many mods will be possible at last. For example, I'm working on one that despite my best ideas for optimizations and whatnot, still felt a little clunky.
Now, with SP will be as if it was always part of vanilla Skyrim.
But I think it's a double edged sword, too.
By the way SP works (executing code each frame) badly programmed mods may get even worse xD
I'll make my mission to teach people how not to make bad mods that waste resources :P
I'm actually good at that.