Josh Posted October 19, 2015 Author Share Posted October 19, 2015 Can that be fixed in the future, if a stat drops.. if a custom string could be saved instead of numeric data, that could be one way around it. I actually can do that, I just figured it would not be needed but I will see what I can do. You don't need to have a "myGame" prefix because it will add your game's ID as a suffix automatically, to keep them separate (only when the app ID is 355500, which is what the game launcher uses.) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2015 Share Posted October 19, 2015 Am I reading it right then that when ran from inside the LE Editor it doesn't put a suffix on and so if we have this leaderboard code in 3 different games they'd all share the same leaderboard (assuming we named them the same and ran it from the editor)? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2015 Author Share Posted October 19, 2015 Because your game had no game ID passed to it in the command line, since it was not being run from the game launcher. In the future it will use the Steam user ID for the suffix if no game ID is found. That will just keep your games separate from others. If you want to name the leaderboard something unique, go ahead. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 19, 2015 Share Posted October 19, 2015 In the future it will use the Steam user ID for the suffix if no game ID is found. That will just keep your games separate from others. This makes it sound like because we aren't passing in the steam user ID in the editor right now that these leaderboard names are global to Steam? That can't be. I mean I can't just find the same name some other game in development is using and mess up their leaderboard today can I? That would seem crazy on Steams part to allow that. Like if you are making a game in Leadwerks and call your leaderboard "leaderboard" and run this code from the editor today and I do the same, we aren't sharing that leaderboard are we? Quote Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2015 Author Share Posted October 19, 2015 When you are developing your game, the default app ID is 480, so you are sharing leaderboards with everyone else using "spacewar". When you run your game directly from Leadwerks Game Engine, it is actually initialized with the Leadwerks Game Engine app ID. This is just something Steam does since your game is a child process of the already-initialized Leadwerks Editor executable. When you publish a game to Leadwerks Game Launcher, all games are sharing that app ID. When you get your own Steam app ID you can use that and not share with anyone. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted October 19, 2015 Share Posted October 19, 2015 Leaderboards still don't work in Rolly when published on the workshop. The beta branch is updated on Windows so that all fonts are always included now. Apparently not, Last night I did a re-upload and still on my end of the game launcher, the font is missing. Tonight I'll reupload it to include all files this time. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Rick Posted October 24, 2015 Share Posted October 24, 2015 When you publish a game to Leadwerks Game Launcher, all games are sharing that app ID. When you get your own Steam app ID you can use that and not share with anyone. Oh, so even when our game is played from the game launcher we'll be sharing the same leaderboard scope space with all other games on the game launcher? Meaning it's kind of an honor system to not screw with each others leaderboards, assuming you can't see what a game used for the name. I just tried from the editor. I made my own leaderboard for my game with a unique name. However when I display it the avatar is pure white, my name wasn't displayed and the score wasn't the score I passed to SetScore(). Quote Link to comment Share on other sites More sharing options...
Rick Posted October 24, 2015 Share Posted October 24, 2015 hmm, now it's working this morning. Of course to get current score it seems like we have to keep getting the leaderboard object in the draw function you made. I had to restart my game to see my updated score. That's kind of a bummer seeing as getting a leaderboard seems like it has a little delay. Quote Link to comment Share on other sites More sharing options...
Josh Posted October 24, 2015 Author Share Posted October 24, 2015 After you set your score, you have to get the leaderboard again so its updated. The script I wrote does this for you. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 24, 2015 Share Posted October 24, 2015 if leaderboard==nil then leaderboard = Steamworks:GetLeaderboard() end if leaderboard==nil then return false end In your function on this post 'leaderboard' is a global variable in the show function so the first time you call this show function it sets it and it'll stay set. So the 2nd time you call this show function it's not nil so it won't get the leaderboard again, and doesn't get the updated score. I mean on my side I just get the leaderboard at the top of the function but your script here doesn't do that. It only does it if leaderboard is null which it won't be after the first time of calling the show function. I noticed this because I have it show when I hold the 'tab' key down so I can see it many times after setting the score and it wasn't showing the updated score. If you gave the leaderboard variable local scope at the top of the function then it would work as desired and get the updated leaderboard each time the show function is called. [edit] I suppose you might be thinking the leaderboard variable inside Set() is the same as inside Show() but they aren't. Those are 2 different variables because the one in Set() is defined as local so it's only visible inside Set() and isn't the same variable used in Show() (just because they have the same name doesn't mean they are the same because of the scope difference). The one is Show() is global and the one is Set() is local and doesn't point to the same memory location. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted October 24, 2015 Author Share Posted October 24, 2015 I suppose you might be thinking the leaderboard variable inside Set() is the same as inside Show() but they aren't. Those are 2 different variables because the one in Set() is defined as local so it's only visible inside Set() and isn't the same variable used in Show() (just because they have the same name doesn't mean they are the same because of the scope difference). The one is Show() is global and the one is Set() is local and doesn't point to the same memory location. DId you seriously just correct my code? That ain't cool bro. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
xtom Posted October 24, 2015 Share Posted October 24, 2015 Ah cool, I noticed it would only update the leaderboard after a restart too but wasn't sure why. For some reason since I updated my game on the launcher it can no longer get the leaderboard, at least when I test it here. It seems to work ok when I test it via editor but no longer in the launcher, no idea why. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
Rick Posted October 24, 2015 Share Posted October 24, 2015 DId you seriously just correct my code? That ain't cool bro. I know, I wasn't sure how to type it. I was trying to be gentle 3 Quote Link to comment Share on other sites More sharing options...
Josh Posted October 24, 2015 Author Share Posted October 24, 2015 Ah cool, I noticed it would only update the leaderboard after a restart too but wasn't sure why. For some reason since I updated my game on the launcher it can no longer get the leaderboard, at least when I test it here. It seems to work ok when I test it via editor but no longer in the launcher, no idea why. When you test from the editor, your app is using the Leadwerks app ID. When you run it from the Game Launcher, your app is using the game launcher app ID, and all the scores entered during testing will not show up. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
xtom Posted October 24, 2015 Share Posted October 24, 2015 Ok I understand but the leaderboard table just isn't showing at all for me in the launcher since I updated the game. On first upload it was showing fine at the start screen but instead now it lags like it's continuously trying to connect to it but fails. So I have since added a retry timer on fail to help eliminate the lag. I might try changing the name I'm using for the leaderboard next time to see if that gets it working again. Quote Check out my games: One More Day / Halloween Pumpkin Run Link to comment Share on other sites More sharing options...
Josh Posted October 27, 2015 Author Share Posted October 27, 2015 Script is updated to reload leaderboard after score is set: http://www.leadwerks.com/werkspace/topic/13413-leaderboards/#entry94304 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted October 27, 2015 Author Share Posted October 27, 2015 My system for making the leaderboard names unique wasn't working right. Just set the name to something someone else is unlikely to use for now. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 14, 2016 Share Posted February 14, 2016 When I want to set a time, I want to store the lowest time, rather than the highest. How can I achieve this? Also the API states the numeric int for ascending/descending but I am not seeing any difference. Are these working? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 15, 2016 Author Share Posted February 15, 2016 I think "best score" is determined by the sort mode the leaderboard was created with. enum ELeaderboardSortMethod { k_ELeaderboardSortMethodNone = 0, k_ELeaderboardSortMethodAscending = 1, // top-score is lowest number k_ELeaderboardSortMethodDescending = 2, // top-score is highest number }; Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 15, 2016 Share Posted February 15, 2016 I'll try that. If everything works, I want to make a tutorial for it. 1 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 15, 2016 Share Posted February 15, 2016 Looking at your example, you get a leaderboard, which is then automatically created I assume. But how do your create a leaderboard using the Create function listed in the API reference? Without some examples in the API reference, I am only guessing as to what I should be using: self.leaderboard = Leaderboard:Create(2) self.leaderboard = Steamworks:Create(2) Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 20, 2016 Share Posted February 20, 2016 Would love to be able to finish the winter tournament with a leaderboard. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 20, 2016 Author Share Posted February 20, 2016 I would just follow the example here: http://www.leadwerks.com/werkspace/topic/13413-leaderboards/#entry94292 The command will keep working in the future, even though it is sort of unofficial. I'll just leave it in. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted February 20, 2016 Share Posted February 20, 2016 Leaderboard* Steamworks::GetLeaderboard(std::string name="Hiscore", const int type = 1) sets time or numeric, but not the sorting order. It is not clear to me where I set this. I tried it is a third argument, but to no avail. So for the code below, I would want the score of 50 to appear on the leaderboard. if self.leaderboard==nil then self.leaderboard = Steamworks:GetLeaderboard("dontstopcounter", 1) end result=self.leaderboard:SetScore(50) result=self.leaderboard:SetScore(80) Quote Link to comment Share on other sites More sharing options...
Josh Posted February 20, 2016 Author Share Posted February 20, 2016 Should work like this: static Leaderboard* GetLeaderboard(std::string name = "Hiscore", const int type = Leaderboard::Numeric, const int sortmode = Leaderboard::Descending);//lua Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.