Forum rules - please read before posting.

Removing Steamworks stuff for a WebGL itch.io build

Hello! I have a Steam build that has the Steamworks package installed.

The question I'd like to know is please - what's the easiest/best way to removing Steamworks to make an itch.io build?

One way to do it (I suppose) is duplicating the entire project, removing the Steamworks package and Steam Achievements custom AC action stuff, but to avoid duplication, I wondered if there were a way to use an AC Global Variable like 'Steam?' and if it's switched off, then it disables Steamworks and bypasses all of it.

I have the SteamManager script attached to AC's PersistentEngine Prefab, and with Steamworks installed, the game won't start if Steam's not open, even in the Unity Editor Play Mode. I obviously don't want that for an itch.io web build - Unity won't even make a WebGL build, I've tried.

Or, if anyone has experience, maybe the best way is just removing the entire package from the project?

Thank you.

Comments

  • You can wrap platform-specific code with #if/#endif blocks, i.e.:

    #if STEAMWORKS
        // Steamworks code
    #endif
    

    The code within will then only run if you have "STEAMWORKS" listed in the Scripting Define Symbols box in Unity's Player settings.

  • edited September 17

    Thanks Chris.
    When I switch to the Web Build Profile, I see the Player Settings automatically removed the STEAMWORKS Scripting Define Symbol.

    I tried adding DISABLESTEAMWORKS as a Scripting Define Symbol, but the problem I was running into was with the Steam Achievements custom script.

    I added in the code you suggested to the custom script ActionUnlockAchievement.cs, but the project still wasn't building, but when I commented out the 'using Steamworks;' bit at the beginning, that seemed to allow it to build properly.

    using UnityEngine;
    using System;
    //using Steamworks;

    Still fiddling around but I think it's working, thank you.
    Saving and Loading doesn't seem to be working in the WebGL build like it used to work before, and the action to overwrite auto-saves with a new auto-save leads to a cutscene softlock for some reason, but that may be related to something else.

  • if blocks can go in a script's "using" section as well, so you can have something like this:

    using UnityEngine;
    using System;
    #if STEAMWORKS
    using Steamworks;
    #endif
    

    Saving and Loading doesn't seem to be working in the WebGL build like it used to work before, and the action to overwrite auto-saves with a new auto-save leads to a cutscene softlock for some reason, but that may be related to something else.

    Likely a separate issue. Best start with a new thread and full details.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.