Need help with Steam Greenlight, steamworks integration

Posted By: jumpman

Need help with Steam Greenlight, steamworks integration - 07/29/16 02:14

Hi everyone!

My game recently got greenlit on steam! But I am in a conundrum frown

My game was done in A6 gamestudio, and I dont know if anyone still knows/supports C-script anymore. I need help on trying to get steamworks integrated into my game, but I have absolutely no idea where to start. Do you or anyone else you know, know how to put the steamworks plugin into your game, as well as getting it to work in Cscript?

thank you for taking the time.
Posted By: alibaba

Re: Need help with Steam Greenlight, steamworks integration - 07/29/16 11:30

I think preacherX's project was also in C-Script and on Steam. Maybe PM him.
Posted By: jumpman

Re: Need help with Steam Greenlight, steamworks integration - 08/01/16 15:44

thank you alibaba!
Posted By: alibaba

Re: Need help with Steam Greenlight, steamworks integration - 08/01/16 18:00

No Problem laugh Hope you solved it and notify us when you have your project up!
Posted By: Ch40zzC0d3r

Re: Need help with Steam Greenlight, steamworks integration - 08/01/16 21:24

There are many ways to hook your game, if you need some hints tell me.
I guess it can be compiled to a dll which can be loaded to your game.
Posted By: Kartoffel

Re: Need help with Steam Greenlight, steamworks integration - 08/02/16 08:37

I'd be interested in how steamworks could be implemented aswell. I'm not using cscript, though.
Posted By: Reconnoiter

Re: Need help with Steam Greenlight, steamworks integration - 08/02/16 10:32

Me too, also no cscript. Perhaps we can sticky this thread or a new thread with the solution?
Posted By: Kartoffel

Re: Need help with Steam Greenlight, steamworks integration - 08/02/16 11:21

Yeah. And I'm not asking for a full implementation ( unless there already is one grin )
The problem is that I have no idea how working with (and creating) a .dll file for something like that works.
Posted By: Ch40zzC0d3r

Re: Need help with Steam Greenlight, steamworks integration - 08/02/16 11:38

Using the SDK is pretty simple.
You download it here:

Steamworks SDK download: https://partner.steamgames.com
Login with your steam credentials and grab the newest SDK.

Now you extract it somewhere.
Create a new C++ project (I recommend Visual Studio)
Settings are Win32 Console Application.
Never click finish but click next.
On the next page you check the "Dynamic Linking Library" checkbox and if you want the "Empty" checkbox.
Dont forget to include the engine SDK if needed!

In the new project you have to include the SDK header:
Code:
#include "steamworks_sdk_137\sdk\public\steam\steam_api.h"



The next step is integrating the code from the API into the new DLL:
Code:
#pragma comment (lib, "steam_api.lib")


It is located at "sdk\redistributable_bin"

Now you can access all the functions from the SDK.
To initialize the Steam API you have to put this code into your DLL exported init function:

Code:
if (SteamAPI_RestartAppIfNecessary(k_uAppIdInvalid))
{
	// if Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the 
	// local Steam client and also launches this game again.
	
	// Once you get a public Steam AppID assigned for this game, you need to replace k_uAppIdInvalid with it and
	// removed steam_appid.txt from the game depot.

	return 0;
}

// Init Steam CEG
Steamworks_InitCEGLibrary();

if(!SteamAPI_Init())
{
	MessageBoxA(0, "Steam API Error!", "Failed to initialize the Steam API!", MB_OK);
	return 0;
}

if(!SteamUser()->BLoggedOn())
{
	MessageBoxA(0, "Steam API Error!", "You are not running Steam or you are not logged in!", MB_OK);
	return 0;
}

// do a DRM self check
Steamworks_SelfCheck();

SteamController()->Init();

...

// Shutdown the SteamAPI
SteamAPI_Shutdown();

// Shutdown Steam CEG
Steamworks_TermCEGLibrary();



Look at the example project for more code.
Posted By: Kartoffel

Re: Need help with Steam Greenlight, steamworks integration - 08/02/16 19:34

thanks for the explanation laugh
Posted By: HenWoll

Re: Need help with Steam Greenlight, steamworks integration - 08/03/16 02:18

Is that what I think ? I do not know myself really well with steam , but I need it to my achievements in introducing project ?
Posted By: Kartoffel

Re: Need help with Steam Greenlight, steamworks integration - 08/03/16 10:37

Well afaik pretty much everything is included in the steamworks api...
drm; archievements; steam functions like friendlist, matchmaking, multiplayer stuff, etc.; even steam controller support and probably much more
Posted By: Kartoffel

Re: Need help with Steam Greenlight, steamworks integration - 08/03/16 11:40

@Ch40zz: Sorry but I don't understand it clearly enough, yet.

Originally Posted By: Ch40zzC0d3r
Now you can access all the functions from the SDK.
To initialize the Steam API you have to put this code into your DLL exported init function:
What exatly do you mean by 'DLL exported init function'?

And to access functions of the steamworks api, do I only have to create the function's prototypes in lite-c or do I have to wrap the functions in the c++ dll-project? confused

Sorry but this is all new stuff to me.
Posted By: Superku

Re: Need help with Steam Greenlight, steamworks integration - 08/04/16 16:36

Originally Posted By: jumpman
My game recently got greenlit on steam! But I am in a conundrum


Congrats!!
Some time ago I've seen a game on Greenlight which was exactly like Swordlord but with fancy 3D Unity or Unreal graphics. I had thought you had switched engines and remade the game but apparently... YOU didn't.
Instead someone seems to have seen your game on greenlight (or somewhere else, itchio?) and just copied it, which is a shame. :< Can't find it right now but I will link it here when I do so.



EDIT: @Kartoffel: I was so bummed and stumped when I first had a look at the Steam API, especially because I didn't know any C++ - and I still barely do.
A good start is to read the DLL stuff in the manual and have a look at the content of the "sdk_" folders in your Gamestudio installation folder.
You can already have a look at the Steamworks SDK too, even if your game is not on Steam yet.
Posted By: Anonymous

Re: Need help with Steam Greenlight, steamworks integration - 08/16/16 10:33

There is this one which looks very like a rip-off you swordlord.
http://store.steampowered.com/app/467900/?snr=1_7_7_151_150_8
But I've seen one that's I'd say is even more a theft of your work. I see if I can locate it..
Posted By: Ch40zzC0d3r

Re: Need help with Steam Greenlight, steamworks integration - 08/16/16 11:31

Originally Posted By: Kartoffel
@Ch40zz: Sorry but I don't understand it clearly enough, yet.

What exatly do you mean by 'DLL exported init function'?

And to access functions of the steamworks api, do I only have to create the function's prototypes in lite-c or do I have to wrap the functions in the c++ dll-project? confused

Sorry but this is all new stuff to me.


Sorry for late response, didnt see that someone posted in here frown
What I meant is that you have to wrap all functions which make use of classes, because lite-c does not support C++ classes directly.
There are some "hacks" like using the vftptr and access all the virtual functions by index, but thats too tricky for most people, so wrapping all functions is what you should do.
Posted By: Reconnoiter

Re: Need help with Steam Greenlight, steamworks integration - 08/16/16 13:28

Originally Posted By: Malice
There is this one which looks very like a rip-off you swordlord.
http://store.steampowered.com/app/467900/?snr=1_7_7_151_150_8
But I've seen one that's I'd say is even more a theft of your work. I see if I can locate it..
, I dont think they copied Sworldlord (they seem to be atleast a 1 year or more working on it -> http://steamcommunity.com/app/467900/discussions/0/350532536097807193/) but the other one sounds quite likely.
© 2024 lite-C Forums