#TF2 Extension
1 messages · Page 1 of 1 (latest)
Somewhere in your code, you're passing a function where you should be passing a string.
It's your deserialize load order function @weary bloom
On L125 and L113 you've passed different arguments to those required by the function on L199
Line 113 - You're passing the context objectt
deserializeLoadOrder: async () => await DeserializeLoadOrder(context),
Line 125 - You're passing just the API object.
currentLO = await deserializeLoadOrder(context.api);
Line 199 - The actual function you've written requires two arguments,
async function DeserializeLoadOrder(discovery, api) {}
This why I like Typescript 😛 It tells you if you're passing the wrong objects into functions.
Thank you, how do I use typescript, I have visual studio installed
Do I just rename the .js to .ts?
It would require setting up the extension from scratch so probably not worth it at this stage
Well there's not that much code
Couldn't be that hard
I mean how different can typescript be to javascript
Plus I barely know javascript anyway
Typescript include a "compile" step that basically converts it back to pure JS.
ohhh okay
https://github.com/Nexus-Mods/game-masseffectlegendaryedition
You could use this as a base (strip out the Mass Effect specific stuff and start over)
thanks ill try that
why is the index a .tsx? and not .ts?
Btw do you any extensions that have a load order system where they sort by writing to a text file?
TSX files include react components for the UI usually
cool
Baldurs Gate 3 is a recent but complex example
Okay cool, I only need to write the filepath to the mod.vpk
Shouldn't be hard to change that
(last words before insanity)
Okay so I noticed like all of the code is sperated into seperate .tsx. How do I use them? Well open them/merge them into so don't just have lists of redlines?
You probably should use VSCode with the Typescript support built in. You'd also need to run npm install to set up the libraries to stop the red lines