3
\$\begingroup\$

I've developed a game through Unity and now I'm stuck with making DLC work. I want to distribute additional scenarios for a game as a DLC and from the various comments I've seen the best way seems to be to add the scenarios pack to the game through an update and then activate it only for those players who bought the DLC. I have installed Steamworks.NET. I am distributing through Steam and I found the following in Steamworks:

static bool IsDlcInstalled( AppId appid )

I would assume that the script that would go into a script that manages the various scenarios would look something like this:

 void CheckIfDlcInstalled()
 {
    if (!SteamManager.Initialized)
    { return; }
    if(something something something == true)
       DLCScenarios.SetActive(true);
 }

I though that the following would go into the if-statement, but I get an error message:

  if (SteamApps.BIsDlcInstalled(534270))   error: "cannot convert from int to Steamworks.AppId_t"

Or am I completely on the wrong path here?

I have also looked at asset bundles - but that doesn't really work because the scenarios include scripts and you can't add those to an asset bundle.

\$\endgroup\$
4

1 Answer 1

2
\$\begingroup\$

I think you meant to write:

public Steamworks.AppId_t myDlcId = new Steamworks.AppId_t(534270);
\$\endgroup\$
2
  • \$\begingroup\$ Awesome. All errors gone - big thanks for your help and your patience! \$\endgroup\$ Commented Apr 22, 2021 at 20:52
  • 2
    \$\begingroup\$ This is very basic C# syntax, so if using a constructor is giving you a hard time then you may want to work through some more introductory C# tutorials to brush up on the fundamentals. \$\endgroup\$
    – DMGregory
    Commented Apr 22, 2021 at 20:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .