Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by FIVESIGN · May 01, 2016 at 05:30 AM · scoreleaderboardhighscorespoints

Highscore with Dreamlo

Hello dear Unity Community

I'm new to coding and Unity and in need of your expertise.

I'm trying to get a highscore leaderboard for my "fall & catch" game. Right now I have a working game, that shows the score in a GUI. The Score is visible throughout all of the scenes and also in the game over view.

I've found Dreamlo (http://dreamlo.com/) but I don't have any idea, how I can implement my score/points to this script. Like I said, I'm an absolute newbie and I've tried to get it with this tutorial (https://vk.com/video-27035376_171145280) but the lack of knowledge drives me crazy.

I'm using this script to receive the player score:

 #pragma strict
 
 var points:int = 0;
 var anzeige:UnityEngine.UI.Text;
 
 function Update () {
     anzeige.text = points + '';
 
 }

... but how can I implement the points (score) to Dreamlo? Well that's the big question.

I'm already thank you for your time and appreciate your help!

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ali-hatem · May 01, 2016 at 11:54 AM 1
Share
 anzeige.text = "score : " + points;
avatar image FIVESIGN Ali-hatem · May 01, 2016 at 04:14 PM 0
Share

Thank you Ali for your answer. Probably I'm to dumb to get it work or you misunderstood my question. The code you wrote is a simple String and all I get is a GUI that shows "score: and the points".

What I'm trying to achieve is to implement the scores in to a $$anonymous$$erboard. For that I've found the Dreamlo Database: http://dreamlo.com/.

But I don't know how to get a $$anonymous$$erboard Screen, that shows the scores of the people who played my game.

Thank you for your help! Appreciate it!

avatar image Ali-hatem FIVESIGN · May 01, 2016 at 04:22 PM 1
Share

sorry i will convert it to comment i thought it's just about text .

Show more comments
Show more comments
avatar image Ali-hatem Ali-hatem · May 01, 2016 at 04:42 PM 1
Share

ok i have cheeked this guy web site it seems he made his own server to host developers leader boards so i will try to cheek the tutorials & as i told you i have never worked with that but i wll try.

avatar image FIVESIGN Ali-hatem · May 01, 2016 at 04:59 PM 0
Share

Thank you so much for your time! I've been watching several tutorials but I haven't figured it out how it works with my score system. I will try around - should you get it, I would appreciate to hear from you. But for sure I say already thank you for your time!!!

Show more comments
avatar image FIVESIGN · May 01, 2016 at 05:54 PM 0
Share

If I do the tutorial I get it to upload the score ... my main problem is that I don't know how to combine my existing score script with dreamlo ... in fact, all that i want is that the score that I get from my script, that this one gets uploaded and the player needs to put his name in.

The Tutorial works fine ... but I really don't have a clue how to combine the two together ...

... I've a lot to learn! :D

I appreciate your help sooooooo much!!!!

avatar image Ali-hatem FIVESIGN · May 01, 2016 at 06:10 PM 0
Share

in this case all you need wen calling this function

 AddNewHighscore(string generated from input field, points); 
avatar image FIVESIGN Ali-hatem · May 01, 2016 at 06:32 PM 0
Share

Thanks for that Ali! But you know what ... I don't have any Idea where to put it ... I'm really really really sorry for taking your time! I've started 1 month ago a with a further education to Unity ... but my knowledge is really really bad.

Right now I've my simple score unityscript and it works:

 #pragma strict
  
  var points:int = 0;
  var anzeige:UnityEngine.UI.Text;
  
  function Update () {
      anzeige.text = points + '';
  
  }

... but how i unterstand it so far, the dreamlo script would use a different kind of score system ... and now I really don't know where to put it.

If you know how, I will be soooo happy ... If not, no problem. I don't want to s$$anonymous$$l your time!

Appreciate your help a lot!

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Ali-hatem · May 01, 2016 at 08:10 PM

so i have edited minor things to you & you don't need to look @ the whole script just look @ my 5 comments inside the script & sorry it's in c# :

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;

 public class Dreamlo : MonoBehaviour {
 int points = 85;//add this value to AddNewHighscore function
 string user = "FIVESIGN";//& this you can replace it with string from input field

 public Text anzeige;

 const string privateCode = "8emSDmwcGkS8-Jtzi27sCQQLT30aNynE-PUTK1w2B-0g";
 const string publicCode = "572658d06e51b60644e2625c";
 const string webURL = "http://dreamlo.com/lb/";

 public Highscore[] highscoresList;

 void Awake (){
     //call this function to upload & put your variables inside braces 
     AddNewHighscore (user,points);
     DownloadHighscores();// & this to download
 }


 public void AddNewHighscore(string username, int score) {
     StartCoroutine(UploadNewHighscore(username,score));
 }
 IEnumerator UploadNewHighscore(string username, int score) {
     WWW www = new WWW (webURL + privateCode + "/add/" + WWW.EscapeURL (username) + "/" + score);
     yield return www;

     if (string.IsNullOrEmpty (www.error))
         print ("Upload Successful");
     else {
         print ("Error uploading: " + www.error);
     }
 }
      
 public void DownloadHighscores() {
     StartCoroutine("DownloadHighscoresFromDatabase");
 }

 IEnumerator DownloadHighscoresFromDatabase() {
     WWW www = new WWW(webURL + publicCode + "/pipe/");
     yield return www;

     if (string.IsNullOrEmpty (www.error)) {
         FormatHighscores(www.text);

     }
     else {
         print ("Error Downloading: " + www.error);
     }
 }

 void FormatHighscores(string textStream) {
     string[] entries = textStream.Split(new char[] {'\n'}, System.StringSplitOptions.RemoveEmptyEntries);
     highscoresList = new Highscore[entries.Length];

     for (int i = 0; i <entries.Length; i ++) {
         string[] entryInfo = entries[i].Split(new char[] {'|'});
         string username = entryInfo[0];
         int score = int.Parse(entryInfo[1]);
         highscoresList[i] = new Highscore(username,score);
         print (highscoresList[i].username + ": " + highscoresList[i].score);

         //this line will change the ui text 
         anzeige.text = (highscoresList [i].username + ": " + highscoresList [i].score);
     }
 }

 }

 public struct Highscore {
 public string username;
 public int score;

 public Highscore(string _username, int _score) {
     username = _username;
     score = _score;
 }
 }
Comment
Add comment · Show 12 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ali-hatem · May 01, 2016 at 08:30 PM 0
Share

also replace privateCode & publicCode with yours .

avatar image Andos · May 02, 2018 at 07:33 AM 0
Share

What about replacing a score with a lower one not a higher score for the quickest time for ecample

avatar image Ali-hatem Andos · Aug 03, 2018 at 09:19 AM 0
Share

you need to delete the user and upload it again

avatar image firebro113 Andos · Aug 06, 2018 at 08:12 AM 0
Share

Ins$$anonymous$$d of replacing the score if it is higher than the previous one, replace if it is lower.

avatar image Ali-hatem firebro113 · Aug 06, 2018 at 10:01 AM 0
Share

@firebro113 the dreamlo leaderboard system don't support that its only use the higher score

If the same name is added twice, we use the higher score.

check out the developers page http://dreamlo.com/developer
Show more comments
avatar image UnityRishabh · Jul 31, 2018 at 02:59 PM 0
Share

How to upload username and score by taking user input and to show the input field only first time, after that update score in the existing username.?

avatar image Ali-hatem UnityRishabh · Aug 03, 2018 at 09:05 AM 0
Share

you need to store data in the device (0/1) after taking user input set the stored value to (1) and at start load the data if (0) show input field if (1) don't show

avatar image
0

Answer by AlexStf · Mar 31, 2017 at 12:25 PM

Hi guys, been struggling for days with this dreamlo leaderbord and can't get it to work , can you please take a look at my code ? any kind of help will be awesome ! , thank you in advance!

 using UnityEngine;
 using System.Collections;
 
 public class Highscores : MonoBehaviour {
 
     const string privateCode = "";
     const string publicCode = "";
     const string webURL = "http://dreamlo.com/lb/";
 
     DisplayHighscores highscoreDisplay;
     public Highscore[] highscoresList;
     static Highscores instance;
     int score;
     string username;
 
     void Awake() {
 
         int score = GetComponent<GController> ().highscore;
         string username = GetComponent<InputName>().username;
 
         Highscores.AddNewHighscore (username, score);
 
 
         highscoreDisplay = GetComponent<DisplayHighscores> ();
         instance = this;
     }
 
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ali-hatem · Aug 03, 2018 at 09:14 AM 0
Share
  1. have you added privateCode and publicCode or they are = "" as in your script

  2. i think DisplayHighscores script have a method to display highscore which you are not calling you are just calling the script in this line highscoreDisplay = GetComponent<DisplayHighscores> ();

avatar image
0

Answer by firebro113 · Apr 08, 2018 at 02:38 PM

Sebastian Lague has created tutorial videos on how to implement dreamlo into a Unity game.

https://www.youtube.com/watch?v=KZuqEyxYZCc&list=PLFt_AvWsXl0cgcFnNTo-Qqb9BwikZ

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

58 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Highscore with player prefs help. (JAVASCRIPT) 0 Answers

Adding score in if statement within Update() happens continuously. 2 Answers

Scoring only one or zero in one InputField? 0 Answers

Help With Score C# Error CS0131 1 Answer

Making a league 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges