Search Unity

[RELEASED] Score Flash: Easy to use GUI for Scores, PowerUps, Achievements, Tutorials

Discussion in 'Assets and Asset Store' started by jashan, Sep 26, 2012.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Alrightee - 3.2 is now available on the Unity Asset Store. You should definitely update as soon as possible as this should give you quite a performance boost :)
     
  2. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hi Jashan, sorry to take a while to get you some feedback. had a lot of other fish to fry...

    OK, i did what you did and created a blank project, imported NGUI, then ScoreFlash, and then unpacked the NGUI example unitypkg. everything worked perfectly then. went back to my my non-working project and troubleshooted it to success (the UILabel prefab needed a specific font specified). i can verify it now works with dynamic fonts in NGUI. so that's great...thanks a bunch for that!

    now i'm at the text freezing portion and using the Freeze on Read on the ScoreFlashFollow3D, but it's not cooperating too well. Should Freeze on Read actually stop the animation of the text? if so i'm not getting that to happen. It spins away and fades out, I am using the Follow3D Component on the same object(the UILabel child of the Prefab ScoreFlashRendererNGUI, and it's calling ScoreFlash (i only have one instance). i call the script with the Push statement but i'm not explictly telling it to Freeze in the code beforehand. should i be doing this before every Push statement or not? any other tips i could try to ensure the freeze option will work?

    thanks in advance -
    scott
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Scott,

    Ah, that sounds all too familiar - no problem, happens to me, too, quite often ;-)

    Awesome :)

    Yes - but this only has an effect when you're using the Push method of the actual object. In other words: Usually, you can use

    Code (csharp):
    1. ScoreFlash.Instance.PushWorld(scoreFlashFollow3D, ...)

    However, when you want ScoreFlashFollow3D to keep track of messages which are frozen on read (and that's necessary for actually freezing them), you have to use

    Code (csharp):
    1. scoreFlashFollow3D.Push(...)

    Of course, "scoreFlashFollow3D" is just a variable name ... in your case, it's probably a different name.

    That way, even when you have FreezeOnRead active on a ScoreFlashFollow3D instance, e.g. to keep a name tag or the current score at that object, you can still push other messages without interfering with the frozen message. It's in the documentation (when you activate "Show Documentation" in the inspector you can read the documentation right with the properties) - but I can see that this is not as obvious as it should be.

    One possibility would be to change this to make freeze on read work in all cases - but then, I'd be losing the possibility to use the same ScoreFlashFollow3D instance to do different things.
     
  4. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    OK, some progress! - i got the text to freeze properly (after realizing the variable was of type ScoreFlashFollow3D not GameObject)...

    but i'm currently having trouble getting the UILabel to consistently float in front of the camera. i have my whole NGUI UI created as child objects of the Main Camera. they work fine if i position them as static NGUI objects, but ScoreFlash3D not cooperating. it seems to want to believe its location is independent of the FPS Controller. i can only occasionally see the messages - sometimes not at all.

    verified - it definitely wants to only see the message in a certain radius. if the Camera turns a certain number of degrees in one direction, the message text position is centered in the opposite direction. if i'm 90 degrees off of what it thinks as its center (with the label in exact center of view), it disappears completely.

    could this be related to the fact that the main ScoreFlash instance is not attached to the NGUI UI under the camera? like it treats ScoreFlash's object as a home vector? basically i want to freeze a message on read at the exact same position relative to the FPS Controller/Main Camera no matter which way i turn.

    thanks,
    scott
     
  5. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    just a little clarification/research. it appears it works the same way with using Test Messages as it does using my messages. i turn Autogenerate Test Messages on for the Follow 3D and it's really obvious that it wants to locate the text in one physical area relative to the FPS controller. turning TestMessages on with the main ScoreFlash gets me absolute positioning, but of course, no freeze.
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Do you have any other cameras in that scene? The issue with messages re-appearing when the camera is off most likely is a result of not having "Renderer of Target" and "Reference Camera" assigned in the ScoreFlashFollow3D component. ScoreFlash does try to fall back with reasonable values but that doesn't work in all cases. IIRC, "Renderer of Target" was introduced with 3.1 because the approach I previously used was very unreliable.

    The ScoreFlash instance itself should be in the top level of the hierarchy ... or you could put it anywhere - that shouldn't make a difference, also, its position in 3D space is not used, so that also shouldn't matter. However, when using NGUI, you have to make sure that the property "Custom Parent for Renderer Instances" in ScoreFlash is properly mapped to an anchor that is TopLeft aligned.

    With that in place, positioning should work properly.

    In case you already did that, or even when you do it, positioning is still off - do you have a way to send me a simple repro-project? Ideally, with just a few cubes but the main structure the way you have it in your project. Alternatively, we could also look it over via Skype (jashanchittesh) or Jitsi (jashan@jit.si or jashanchittesh@jabber.org).
     
  7. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hmm - well i have put the ScoreFlash instance back in the top level and i assigned it to the UI anchor. i do have a 2D camera created under the Main camera. i just now experimented with removing and it screws up the basic UI positional stability, so i put it back in.

    as far as Reference camera i have tried it with both the 2D UI Camera and the Main Camera - it behaves roughly the same in both situations, although when using Main Camera the messages alternate between coming from top and coming from bottom as well as being located roughly straight ahead or behind.

    the Target Renderer i set to be the same object as itself.

    sounds like this might need some skype help. i'll look you up there...

    scott
     
  8. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    hi jashan! thanks for solving my problems earlier... i'm almost there, but i'm having this really annoying issue where i'm getting very narrow display. i remember i didn't want a wide display, so i set it to be narrow someplace. trouble is i can't remember exactly where.

    to refresh your memory, i'm using custom renderer for NGUI and using the prefab of ScoreFlashFollow3D you had me make. it has a child object with a UILabel attached to it. i've set the screen width on UILabel to 1500, but when i run my demo, the Renderer instances narrow the view to less than 1000 pixels - the measurement is not consistent. i can go into the renderer instance and resize it by hand by changing screen width.

    i've tried recreating the prefab from scratch, and still seem to be getting the same behavior. i've set the max width settings on Score Flash to something like 3000 but i know that shouldn't matter, since the rendering is being done by something else.

    any clues what could be interfering in this case?

    thanks...

    scott
     
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Actually the max width of ScoreFlash does matter. ScoreFlash sets the width on the UILabel depending on that value.

    Possibly, the padding left/right is too large. For testing, you could try in ScoreFlash / Main Layout / Padding left/right before wrap the value "0". And in ScoreFlash / Main Layout / Maximum Width of Messages something like 200 or 300. It should definitely not be necessary to have a value like 3000 here - unless you have a huge screen ;-)

    One possibility is also that your whole scaling is off. In that case, a value like 3000 may actually be reasonable but I'd rather try fixing the scaling first then.

    Does that help?
     
  10. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    OK after much trial and error i think i've solved my own problem, at least for the moment. i had a camera object that was scaled to .01, but fixing it was a lot of trouble.

    now what i'd like to do is display a transparent background behind the ScoreFlash text on the screen because it likes to disappear when objects of the same color (or close) are in the world behind the text . since NGUI is handling the rendering it seems you should just be able to add a Sprite to the renderer prefab and you'd be all set - but i've tried a few stabs at it and am not getting very far (adding objects to prefabs seems difficult to do in the Project View). it does need to resize to the text area of the UI Label. how would you go about doing this?

    EDIT: having seen your Acheivements demo, that's exactly what i'm looking for, only i guess i want NGUI to draw the texture instead? just wondering...
     
    Last edited: Jul 28, 2013
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Personally, instead of using a transparent plane behind the text to make it more readable, I prefer using outlines ... but that's obviously depending on the style you want to achieve. In case outlines are an option for you, you could use e.g. GlyphDesigner to design your fonts. But IIRC, you want dynamic fonts, so that may not be an option. On the other hand, I believe NGUI also has it's own built-in outlining.

    Anyways, if you want to go for the transparent plane solution, and you want to the plane to dynamically resize with the text, you'd probably have to write your own custom renderer. You can use the NGUI custom renderer as foundation for that implementation but you'll have to update the size of the plane according to the actual width of the UILabel depending on the text. The method you'd extend is "UpdateMessage(...)"

    The achievements demo might also be a starting point - but there, the size doesn't change depending on the text. Also, the Achievements demo supports multiple different texts inside a single message (a headline and a description text). So I think that would probably be a little misleading for your specific use case.

    It shouldn't be too hard but let me know if you need further assistance!

    Regarding changing the prefab: The way Unity expects you to do that is to put the prefab into the scene, make the changes you need, apply the changes to the prefab and remove the prefab from the scene. It is cumbersome and I hope they'll change that once they introduce nested prefabs ... but seemingly that'll still take a while :-(
     
  12. foosart

    foosart

    Joined:
    Jun 6, 2012
    Posts:
    66
    How can I create a custom font material texture to assign to a scoreflash element? For example, I have an LCD style font that I created using 2D Toolkit that I use in other GUI elements. But this font format doesn't seem to be accepted by scoreflash.
     
  13. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    There's a variety of possibilities - if you have NGUI, EZ GUI or TextBox, you could use those. In those cases, the integration comes with ScoreFlash, so it's very easy (just use what's there). But you'd probably have to create another texture/material and that's probably not what you want.

    I don't have explicit support for 2D Toolkit built-in and don't know how they're handling text / fonts (I'm not using 2D Toolkit so I have zero experience with it). But most likely, it should be fairly easy to create your own 2D Toolkit integration. You can use any of the ScoreFlashRenderer implementations to get you started, see also:



    Also, you should definitely have a look at the custom implementations for NGUI, EZ GUI and TextBox as most likely, an implementation for 2D Toolkit will look similar. These integrations come as packages in ScoreFlash that you can import. Unless you have NGUI, EZ GUI and TextBox you'll be getting compilation errors when you import those into your project. But you can still have a look at the code and use it for reference.

    Does that help get you started?
     
  14. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    Hmmm - OK, what if instead you just filled the screen with a near transparent overlay over which the ScoreFlash text would be displayed? i've just started editing the Scoreflash NGUI prefab (in the kludgey but required way you just outlined) to put a plane mesh object directly below/behind it. not having a lot of luck at the moment. i tried configuring the plane settings and dragging the new setup as a new prefab, but it seems the change did not take. it also doesn't act the same as the text. the text is always visually on top of any object in the game and never gets covered up, while the background is a little weird. but if i were to add a background in front of the the main camera, that would cover up the text. so i'm a little bit stuck at the moment....

    another thought occurred - right now my ScoreFlashRendererNGUI instance is placed quite far from the main camera. when i edit the prefab though, the text is much closer (and gigantic, because i have to scale up the text to something like 128 size to view the instance with the Main Camera) i think the most ideal situation would be to move the Renderer much closer to the camera and stick a plane just behind it like a pair of sunglasses. i know the instance wants to attach to the Anchor but i can't seem to move the Anchor either (maybe i'm not supposed to?). just a little confused here...
     
    Last edited: Aug 6, 2013
  15. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Scott, I've created an example with a transparent background. I still think that if your concern is readability, you'd be better off using an outline with the font. However, if you want bubbles, that's also kind of a nice effect ;-)

    Here's the link: NGUI package with example with transparent background

    This comes with a new prefab ScoreFlashRendererNGUI_Transparent and a new implementation of the custom renderer by the same name (ScoreFlashRendererNGUI_Transparent.cs). It also includes a new example: Example5_NGUITransparent.

    All this does is add a "Sprite" to the UILabel, so you have this structure:

    Code (csharp):
    1. - ScoreFlashRendererNGUI_Transparent
    2.   + Sprite
    3.   + UILabel
    In the method UpdateMessage(...), there's some new code that resizes the background plane according to the text width:
    Code (csharp):
    1. Vector2 textSize = GetSize(msg);
    2. Vector3 newTransparentPlaneSize = nguiSprite.cachedTransform.localScale;
    3. newTransparentPlaneSize.x = textSize.x + 2 * paddingForBackground.x;
    4. newTransparentPlaneSize.y = textSize.y + 2 * paddingForBackground.y;
    5. nguiSprite.transform.localScale = newTransparentPlaneSize;
    There's one thing that's a little nasty: nguiLabel.relativeSize will always return the full width if nguiLabel.lineWidth is set. So I needed to comment out

    Code (csharp):
    1. //nguiLabel.lineWidth = (int)msg.MaxWidth
    in method Initialize(...). Maybe there's a more elegant way to do this - the result is that this renderer will ignore the maximum width that ScoreFlash defines. In other words: You'll never get line breaks.

    This new prefab comes with a inspector property paddingForBackground that lets you define how much space (in pixels) there should be around your text. Note that this will only work with MiddleCenter alignment - if you want to support all possible alignments, things get significantly more complex.


    That should help you get started ... there's a few things you mention in your post that look like trouble, though:

    The way you need to do this in NGUI is using "Depth". You need to make sure that your background sprite has a value less than the label. Don't mess with changing the Z-position. That'll just mess things up.

    You need to make sure that the only camera that renders your NGUI stuff (including the ScoreFlash custom renderer) is a 2D orthographic camera, and your GUI objects should be below that camera in the hierarchy. If the Z-position of the object makes a difference in the visual appearance, you're definitely having a perspective camera rendering the ScoreFlash messages which will cause all kinds of weird results. So that's definitely something you need to look into.
     
  16. foosart

    foosart

    Joined:
    Jun 6, 2012
    Posts:
    66
    thanks jashan, this is helpful.
     
  17. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That's great to hear! Let me know how it works for you - I may actually consider adding 2D Toolkit support to ScoreFlash.
     
  18. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    OK, Jashan i did download your demo (thanks a lot for this BTW :)), but i'm thinking i'd like to try it my way first to see if the results are acceptable. based on your feedback i concluded i probably went too crazy with a lot more Z based configs than i needed so i wiped the NGUI interface and started over, this time adding a 2D camera during the creation of the GUI.

    things are working to the point i can see my sprite in front of the camera, and if I turn on the main ScoreFlash instance automessages, they show up down and center just barely out of my view. this is not true for the Follow3D setup though. i'm not only not seeing anything render in the game camera i can't actually find it with the Scene camera either. i think i've configured everything correctly except for perhaps the Renderer Of Target. i can't set it to my sprite because there's no renderer component there. so i set it to the prefab's Screenlabel object's Mesh Renderer instead. i have set the Anchor and the renderer instance to my prefab ( i did not change these settings from before). all Camera assigning is to the 2D camera.

    anything else i might be missing? i did try to adjust the depth control so that my text is on top of my background, but nothing's drawing.

    thanks,
    scott
     
  19. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Hi Jashan - I have a slight issue I hope you can help with.

    I am working on a FPS and have added Follow3d to an object, so when destroyed it displays the score. It works perfectly except that the movement of the score is very jittery; not smooth at all.

    Is there anything I can do to smooth this out?
     
  20. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Which rendering are you using? Default UnityGUI, NGUI, EZ GUI or TextBox or your own custom rendering? I do remember an issue with NGUI a while back which was caused due to scaling the wrong object. But if you're using a current version of ScoreFlash and the packaged custom renderers, this shouldn't be the case.

    Theoretically, it could also be something about the object you're following - but as you are showing the message and then destroy the object, this also shouldn't be giving you trouble.

    What about the general performance of your game?

    Ah - one more thing I can think of: If your message moves very slowly, the jittering might be a result of ScoreFlash being pixel-perfect. In other words: If you're only moving one pixel every few frames, this also creates a jittering effect.

    So far, I'm not really sure what this is causing this for you - but I'm sure we can find out. Let me know how this goes for!
     
  21. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just a little heads up: I'm on vacation until September 1st, so if there's any questions related to ScoreFlash, I won't be able to answer them until beginning of September.
     
  22. OzDave

    OzDave

    Joined:
    May 19, 2008
    Posts:
    144
    Hi Jashan,

    As per our initial email conversation... and now moving the problem here.
    I want to display a text based message on a score result, similar to your achievements but in UnityScript and with some conditions.

    I use this addon/plugin to display to the player an initial score of the object.
    Inside my collision function and then in a tag for each different object I have the object adding to the score.

    Code (csharp):
    1.  
    2.             if (col.collider.tag == "TaggedObjectName") {
    3.                
    4.                 score += 10;
    5.                 flashScoreAmount = 10;
    6.                 ScoreFlash.Push(flashScoreAmount);
    7.  
    8.                 }  
    9.  
    The above code pushes the score indicators up the screen! :) woo awesome! this works well...


    however onto the issue I have...

    I would like to now make it show a text achievement "string" with an encouragement word only once and not in a rapid fire.
    It fires multiple times or keeps going if the players score is stuck on a condition.
    Code (csharp):
    1.  
    2. if (score == 100 ) { ScoreFlash.Push("great!"); // can be missed and no indicator is shown.
    3. if (score > 100 ) { ScoreFlash.Push("great!"); // keeps firing if after 100.
    4. if (score > 100  score < 101 ) { ScoreFlash.Push("great!"); // would like to reduce the  usage, adding a timer and a one condition fire.
    5.  
    I hazard a guess it is in the incorrect area as I propose that it is checking this every game loop.
    How would I wrap a timer around it that detects this every second or half second to reduce the main loop and only fire once if the condition is met.

    Eventually I wish to add a text achievement for different score levels so at 100, 500, 1000 etc...
    Code (csharp):
    1.  
    2. if (score == 500 ) { ScoreFlash.Push("keep going!"); // etc.
    3. if (score == 1000 ) { ScoreFlash.Push("good work!"); // etc.
    4.  
    Thanks for the help btw.
     
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi David,

    basically, what you need to introduce here is a little state machine. Then, you can check for the state changes and fire "events" (in our case: ScoreFlash messages) whenever the state changes ;-)

    So, basically, what you do is keep a variable with the information which state you are in, e.g. "ScoreBelow100", "ScoreBelow500", "ScoreBelow1000". Then, either in update, or as you suggested every second in a Coroutine, you check the current state against the current score. If the state is "ScoreBelow100" and the score is equal or greater than 100, you change the state to "ScoreBelow500" and trigger the ScoreFlash message. I would actually do it in update because it doesn't really take much time and players prefer immediate feedback, so introducing a delay may not be that great.

    For now, I'd recommend actually hardcoding this - even though there's more elegant ways of doing this (you could create your own "system" where everything can be parametrized). Instead of using states like "ScoreBelow100" you may be better off using something that's closer to your actual achievements. Like "FirstMotivationMessage", "SecondMotivationMessage", "CoolAchievement", "UeberAwesomeAchievement". You could then parametrize the required scores and messages using public variables (so you could change these values in the Unity editor and tweak them until your happy). But I would take this step by step. After having a totally hardcoded solution ("ScoreBelow100") that you fully understand, you can still enhance it by making it more flexible.

    I believe you could also look into a solution like PlayMaker which is supported by ScoreFlash and would probably allow you to set this up visually in a state graph. But that's also a new system you'd have to learn.

    Let me know if you need a code example.

    Sunny regards,
    Jashan
     
  24. OzDave

    OzDave

    Joined:
    May 19, 2008
    Posts:
    144
    Hi Jashan,

    Ignoring the timer element
    Ignoring the co-routine at the moment

    In my Update function I could do this for simplicity to get started.

    if (score <100 ) { ScoreFlash.Push(" ");
    if (score <200 ) { ScoreFlash.Push(" yay! ");
    if (score <300 ) { ScoreFlash.Push(" woo! ");

    However this rapid fires the message, I probably do need a code example to prevent the rapid firing element.

    Some condition layout that only make its appear once.

    I have bought Playmaker but wish to stick to UnityScript until this little game is completed.
    I am not sure how Playmaker affects IOS in load and what it does for performance with mixing or adding that stack to something small.


    Something like
    Code (csharp):
    1.  
    2.  
    3. if (score <200 ) {
    4.  
    5. // Only trigger this condition once in its lifetime even if score is still 200 or less
    6.     ScoreFlash.Push(" woo! ");
    7.   // end condition
    8.  
    9. }
    10.  
    Would a co routine prevent the rapid fire in this requirement?

    Cheers mate.
     
    Last edited: Oct 15, 2013
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi David,

    here's an example. That you could call from Update():

    Code (csharp):
    1. enum ScoreState {
    2.     InitialState,
    3.     FirstMotivationShown,
    4.     SecondMotivationShown,
    5.     AwesomeAchievementShown
    6. }
    7.  
    8. private var currentScoreState = ScoreState.InitialState;
    9.  
    10. function CheckScoreState() {
    11.     switch (currentScoreState) {
    12.         case ScoreState.InitialState:
    13.             if (currentScore > 100) {
    14.                 ScoreFlash.Push("First Message");
    15.                 currentScoreState = ScoreState.FirstMotivationShown;
    16.             }
    17.             break;
    18.         case ScoreState.FirstMotivationShown:
    19.             if (currentScore > 500) {
    20.                 ScoreFlash.Push("Second Message");
    21.                 currentScoreState = ScoreState.SecondMotivationShown;
    22.             }
    23.             break;
    24.         case ScoreState.SecondMotivationShown:
    25.             if (currentScore > 1000) {
    26.                 ScoreFlash.Push("Awesome Achievement Unlocked");
    27.                 currentScoreState = ScoreState.AwesomeAchievementShown;
    28.             }
    29.             break;
    30.     }
    31. }
    32.  
    If you want it a little more flexible, check the following example. This does use a coroutine for simulating the user receiving scores (so in your actual implementation, you don't need that coroutine). Also, this already implements the first level of parametrization (so you can decide which are the threshold scores and the messages in the editor):

    Code (csharp):
    1. #pragma strict
    2.  
    3. var currentScore = 0;
    4.  
    5. var firstMotivationThreshold = 100;
    6. var firstMotivationMessage = "First Motivational Message";
    7.  
    8. var secondMotivationThreshold = 500;
    9. var secondMotivationMessage = "Second Motivational Message";
    10.  
    11. var awesomeAchievementThreshold = 1000;
    12. var awesomeAchievementMessage = "Awesome Achievement Unlocked";
    13.  
    14. private var currentScoreState = ScoreState.InitialState;
    15.  
    16. enum ScoreState {
    17.     InitialState,
    18.     FirstMotivationShown,
    19.     SecondMotivationShown,
    20.     AwesomeAchievementShown
    21. }
    22.  
    23. function Start() {
    24.     // simulate the user receiving score (that's just "test code")
    25.     while (true) {
    26.         currentScore += 30;
    27.         yield WaitForSeconds(1F);
    28.     }
    29. }
    30.  
    31. function Update() {
    32.     CheckScoreState();
    33. }
    34.  
    35. function CheckScoreState() {
    36.     switch (currentScoreState) {
    37.         case ScoreState.InitialState:
    38.             if (currentScore > firstMotivationThreshold) {
    39.                 ScoreFlash.Push(firstMotivationMessage);
    40.                 currentScoreState = ScoreState.FirstMotivationShown;
    41.             }
    42.             break;
    43.         case ScoreState.FirstMotivationShown:
    44.             if (currentScore > secondMotivationThreshold) {
    45.                 ScoreFlash.Push(secondMotivationMessage);
    46.                 currentScoreState = ScoreState.SecondMotivationShown;
    47.             }
    48.             break;
    49.         case ScoreState.SecondMotivationShown:
    50.             if (currentScore > awesomeAchievementThreshold) {
    51.                 ScoreFlash.Push(awesomeAchievementMessage);
    52.                 currentScoreState = ScoreState.AwesomeAchievementShown;
    53.             }
    54.             break;
    55.     }
    56. }
    57.  
    Does that help?
     
  26. OzDave

    OzDave

    Joined:
    May 19, 2008
    Posts:
    144
    Cheers mate, It will be some time from now before I can try and reply.

    Thanks for your valid assistance, I will let you know how I went.
     
  27. OzDave

    OzDave

    Joined:
    May 19, 2008
    Posts:
    144
    Jashan,

    You sir are a master and a scholar!.

    The second script made a lot of sense for my "artfart" brain ;)

    Your plugin in excellent!

    Thank you so much! for that hurdle mate.

    preview

    $Screenshot 2013-10-15 21.13.06.JPG
     
  28. LoonyBen

    LoonyBen

    Joined:
    Jul 21, 2013
    Posts:
    21
    How do you simply Update() the Layout label to the current score.
    Say an enemy is hit and using score++ as the variable
    If you put layout.Push in Update() it spams the screen 10,000 times a second or so.
    ScoreFlashLayout.CurrentMessage has no affect. Neither does ScoreMessage.UpdateMessage
     
  29. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Loony Ben! The Update() method in Unity is called once per frame. So if you simply add ScoreFlash.Push(...) into Update(), you will get one message pushed per frame which is usually not what you want (this will result in 10 to 150 or so messages per second, depending on your current frame rate ;-) ).

    Usually, you'll have some sort of score manager in your game. Whenever the score is increased, that score manager will handle that change. That's where you want to put ScoreFlash.Push(...). If you don't have that, you probably have some collision handler - so then that would be where your put ScoreFlash.Push(...).

    Basically, wherever you do score++, you can also do ScoreFlash.Push(...) - unless you increase the score every frame ;-)

    Does that help?
     
  30. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey,

    Is there going to be a compatibility update for Unity 4.3?
     
  31. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Actually, ScoreFlash is compatible with Unity 4.3. There's only several warnings because LookLikeInspector() and RegisterUndo(…) were made obsolete in that version. I will fix that because I find warnings pretty annoying myself - but I'll probably drop pre-4.3 support with the next version of ScoreFlash because supporting all those different versions of Unity has become quite a nightmare and also bloats the code in ugly ways in some areas.

    I might keep 4.2 support, though, since 4.3 gives some people some troubles - including myself. But currently, I'm still supporting 3.5.7 - and that's quite a stretch ;-)
     
  32. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    jashan, any update on the warnings yet? It's been a while...

    Also, can you look into adding DFGUI support too?
     
  33. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Is anyone using Score Flash for multiplayer in-game chat?
     
  34. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You could certainly use it for notifications when messages arrive. However, for multiplayer chat you also need a textbox to type in your messages. And personally (from the player perspective), I'd prefer having a little window that you can resize and where you can scroll up and down.

    So, while it's certainly possible to use ScoreFlash to display incoming multiplayer in-game chat messages, it's not what I'd personally use it for.

    Btw, the warning in 4.3 are fixed and DFGUI support (and Tk2D support) are almost there. You'll need Unity 4.3.4 for the next version of ScoreFlash, though ... I'm cutting those old versions (4.x has been out long enough ;-) ).
     
  35. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey, any updates on DF-GUI support?
     
  36. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hello, Can I use 3d Text objects in ScoreFlash?
     
  37. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Sorry this took me a little while to reply - I've been on a little Easter vacation. The DF-GUI support got a little delayed - sorry! But the package is now finally on its way to the Asset Store :)

    Not yet but this is a feature that I have planned. The idea is to make ScoreFlash compatible with VR headsets like the Oculus Rift.
     
  38. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    And jashan delivers! :)

    Thanks!
     
  39. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Last edited: Apr 30, 2014
  40. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    If you want to buy Score Flash - today is an awesome day to do it, because it's today's 24 hour deal! At 50% off, it's only €19 instead of €38!

    Grab it right now at:

    Score Flash on the Unity Asset Store

    And btw, the DF GUI support version is already online ;-)
     
  41. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hey thanks to everybody buying ScoreFlash on sale!

    17 hours left!
     
  42. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307

    12 hours left!
     
  43. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ============================================================================================================================================================================

    Only 2 hours left!

    ============================================================================================================================================================================
     
  44. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ... and the sale is over. Thanks again to everyone who purchased ScoreFlash (both in that sale and before, and after :) )!!!
     
    Last edited: May 10, 2014
  45. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little heads up to everyone: I have just submitted an "extended 50% off" sale which is currently pending review. So until that goes live, unless you want to pay $50 (which I totally do appreciate and I feel ScoreFlash is totally worth it), you might want to wait until the price is back to 50% off (which is $25, or €19).

    That 24h sale on Friday really was quite amazing:

    Within just 24 hours, I sold almost as many ScoreFlash licenses as in the whole time since release (that was September 2012, and there was one 33% off x-mas sale included in Dec 2012). The income generated with ScoreFlash compared to the time invested is still not exactly great (currently it's about €13 / hour ... which is a very small fraction of what I charge on customer projects) - but given that this almost doubled within a single day, I'm quite happy and confident that some day, I'll break even. As it stands right now, I could have easily made €18.000 more with customer projects - but obviously, having my own IP has its own advantages, especially from the long-term perspective ;-)

    At this moment, ScoreFlash is #2 in Top Paid and #5 in Top Grossing in the Editor Extensions / GUI subcategory (which has 51 entries altogether, so it's not that many). In the Editor Extensions category (which has 929 entries), it doesn't even appear (in either of those top ten).

    Anyways, welcome to all the new customers and if you have any questions, just let me know ... and I hope you enjoy using ScoreFlash as much as I enjoy creating it!

    Btw, the next version will (finally) drop support for "pre-4.3.4 Unity versions" ... so if that's a problem for you, please let me know. This is mainly a "clean-up release", so it doesn't add new features but does remove much of the mess that supporting Unity versions from 3.5.7 to 4.3.4 generated ... I'll probably keep 4.3.4 support for a little while but support the new Unity GUI system immediately when Unity 4.6 is released to the public (this will be an "extension package" the same way I'm already doing it with NGUI, DF GUI and Text Box; in other words, you can use ScoreFlash with Unity 4.3.4 without compilation errors and to use the 4.6 features, you have to import a package that comes as part of the main package; it's a super smooth process so no worries ;-) ).
     
  46. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    When u drop support, please put the old version in a package. There are some projects that can't be upgraded
     
  47. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thanks, that's a cool idea! I'll do that ... so in the next version, there'll be a ScoreFlash-Unity3.5.7 package included which will be based on ScoreFlash 3.2.2.

    I'll also keep that old version as a separate project so in case there's any severe bugs popping up, I always could backport their fixes.

    You will need a current Unity version to download the package - but if you have that you'll be fine.
     
  48. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
  49. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little heads-up: The 50% off sale ends in a few days. So there's not much time left to get ScoreFlash at 50% off ($25 / €19, plus VAT, if applicable).
     
  50. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just a heads up: I'll be off for a vacation until June 25th. No phone, no Skype, no Jitsi, no email. There's some awesome stuff coming up after that, so stay tuned :)