skip to content
usubeni fantasy logo Usubeni Fantasy

TyranoScript Tutorial Part 5: Steamworks Integration

/ 3 min read

This Post is Available In: CN EN

So, how does one integrate Steam with TyranoScript? I’m sure you’re all familiar with TyranoScript, but integrating it with Steam may seem like a mystery. Let me take you through it. Integrating TyranoScript with Steam is essentially done using greenworks. You may be surprised that TyranoScript can be integrated with Steam, and, to be honest, so was I. And that’s the story of integrating TyranoScript with Steam. What are your thoughts on this? Feel free to share in the comments and let’s discuss!

Yeah, the above was generated using a gibberish generator (doge).

As we all know, Steam is probably the best sales channel for game development. Unfortunately, there’s no official JavaScript SDK for it. So, if you’re developing games with Tyrano and want to integrate them with Steam, it becomes quite a challenge.

Initially, I was puzzled about how to handle this underlying integration. Did I really have to delve into node and C++ to make it work? I was at a loss. However, I later discovered greenworks, and I’m truly grateful to the experts who allow us to leverage their work. With greenworks, NW.js and Electron-based web games can be integrated with Steamworks.

Let’s talk about how to use greenworks to seamlessly integrate TyranoScript with Steamworks.

Since we have agreed to keep it simple, let’s connect using the easiest method available, which means no need to build; we’ll just use what’s already available. Additionally, the following example is based on a 64-bit Windows system and an Electron shell (for information on replacing NW.js with Electron, refer here).

  1. Clone the greenworks code
Terminal window
npm install --save --ignore-scripts git+https://github.com/greenheartgames/greenworks.git
  1. Choose the appropriate pre-built *.node file from here (consider the system and Electron version), download it, and prepare to use the files inside.

  2. Place lib/greenworks-win64.node into node_modules/greenworks/lib.

  3. Download the Steamworks SDK from here (I used v1.41), extract the files, and prepare to use them.

  4. Place redistributable_bin/win64/steam_api64.dll into node_modules/greenworks/lib.

  5. Place public/steam/lib/win64/sdkencryptedappticket64.dll into node_modules/greenworks/lib.

That’s it!

greenworks

After completing the above steps, I encountered version errors. However, the error messages are user-friendly and directly inform you of the current version; just replace the *.node file and you’re good to go! Even the clumsiest person can learn this! A real game-changer!

As for usage, it’s the same old method:

var greenworks = require("greenworks");
tyrano.plugin.kag.tag.greenworks_init = {
start: function () {
greenworks.init();
this.kag.ftag.nextOrder();
},
};
tyrano.plugin.kag.tag.activate_achievement = {
pm: {
name: "",
},
start: function (pm) {
greenworks.activateAchievement(
pm.name,
function () {
console.log("Activating achievement successfully");
},
function (err) {
console.log(err);
},
);
this.kag.ftag.nextOrder();
},
};

Once the tags are added, you’re good to go!

评论组件加载中……