Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormeh
    • CommentTimeApr 5th 2017
    How do I create a number ceiling? By this I want to create limits especially text. in other words, If I give a text 200 numbers(like an HP or score) and it hits 0 by decreasing it with triggering certain events, How do I make it not go negative ( -1, -2 and so on). Here's what I've done so far

    The only problem is that I need a limitation. and when it does hit 0. It will cause an event like level failed or destroy entity #.
    First of all, can you explain what it is you are trying to do in the level? There is SO much more to it than I thought, and it is highly confusing.

    Global > Number > More > Clamp will set a number to within a certain range (like between 0 and 10 inclusive). If you only want a lower bound, use Global > Number > Usual > Max. (It seems a little counterintuitive, but Max returns the higher of two numbers, so you want the higher of 0 and the value you want to make positive. Think about it and it makes sense.)

    global[0:"Score"] = Max (global[0:"Score"], 0)-----------------
    3.14159265358979323846264338327950288... Nothing Here
    Also, text shapes are nothing special -- they just display the value of some variable. The actual HP or score is in your variables.-----------------
    3.14159265358979323846264338327950288... Nothing Here
      CommentAuthorBioManiac R2 (Moderator)
    • CommentTimeApr 5th 2017
    Looking at your design I can see a whole bunch of different ideas floating around.

    Do you want the number to be the health, that is easy, but if you want the slider on the left to be the health that is a different idea entirely...

    You have the left mouse button down event linked to activate the mouse move event
    You have the mouse move event to make another circle attached to a slider not static
    You have the circle attached to a physics shapes are colliding box and dragging along a block to always set it off
    the colliding box decreases the number by 5
    You only set it static when you release the click, ideally you want to check if the number is > 0 in the decrease event, but I'm not sure how it would work since so many boxes are connected in this chain.... so i put it in the mouse move event and if balls is not greater than 0 it will set the moving circle to static again to stop the collision category box.

    • CommentAuthormeh
    • CommentTimeApr 6th 2017 edited
    I managed to do it on my own. Thanks guys