Closed abadonna closed 4 years ago
I haven't been able to get the GameOverlay functionality to work. There are some requirements mentioned in the official docs:
"Your game does not need to do anything special for the overlay to work, it automatically hooks into any game launched from Steam! While in development and running your game in a debugger, the overlay is loaded when you call SteamAPI_Init. As such you'll need to make sure to call SteamAPI_Init prior to initializing the OpenGL/D3D device, otherwise it won't be able to hook the device creation."
And even if I call SteamAPI_init as early as I can from the extension I'm unable to get the overlay to show.
Excluded API functions can be seen in the generator script: https://github.com/britzl/steamworks-defold/blob/master/generate.py#L18
Could this be tested by engine team or something somehow? I think this is needed for doing IAP DLC too.
I created a branch where we can do some experiments: https://github.com/britzl/steamworks-defold/tree/overlay
I'd appreciate if you could help me test this. In the branch all of the overlay functions are active. I'd like to see if the overlay will open if the game is launched from Steam.
I also added a steamworks.restart() function which maps to https://partner.steamgames.com/doc/api/steam_api#SteamAPI_RestartAppIfNecessary
YES! Activating the overlay is working, you just can't do it on main init. Launching from Steam is not necessary.
local status, error = pcall(steamworks.init)
if not status then print("Error: " .. error) return end
steamworks.set_listener(function(self, e, t)
print("listener event", e)
pprint(t)
if e == "SteamInventoryRequestPricesResult_t" then
if t.m_result == steamworks.RESULT_OK then
msg.post("#", "refresh_items")
else
print("not ok")
end
end
end)
print("Is Steam overlay open?", steamworks.utils_is_overlay_enabled())
--print(steamworks.friends_activate_game_overlay_to_web_page("google.com"))
steamworks.friends_activate_game_overlay_to_store(348910, 1) -- both of these work (didn't test others)
print("Is Steam overlay open?", steamworks.utils_is_overlay_enabled())
function init(self)
local status, error = pcall(steamworks.init)
if not status then print("Error: " .. error) return end
steamworks.set_listener(function(self, e, t)
print(e)
pprint(t)
end)
steamworks.utils_set_overlay_notification_position(2)
end
Is also working to set the notification position to the bottom left so that is useful at least! 💎
0 top left 1 top right 2 bottom left 3 bottom right
Ah, this is great news! I wonder if the new global struct with early init was what made the difference?
The notification positions should be these constants I believe:
Merged to master but haven't done a release yet. Also generated a .script_api so that you get autocomplete for the extension.
Let me know when you've tested some more and I'll make a new release!
Tested now. All seems well!
Hi! Is ActivateGameOverlayToStore missing? Can be a useful to redirect players from demo to purchase full version.
-regards,