SC2Mapster Forums

Development > Triggers

Custom Progress Bar

  • 8 posts
    #1 Nov 26, 2012 at 21:37 UTC - 0 likes

    Hi there, i need help to come up with a formula for my xp bar made from dialogs. Not the standard one but a custom one using images. The maximum width of it is 385. I've been twisting and turning just to come to the conclusion i suck at math. Please help!

    #2 Nov 26, 2012 at 21:46 UTC - 0 likes

    All you have to do is set the width of the bar to a ratio based on the maximum width of the bar and the current/maximum exp of the player...

    So say your exp is 100/1000. set percent = 100/1000

    that comes out to .1

    so then set the dialog size to (385*.1,height)

    This will make the bar be 10% of its full width, therefore representing you have 10% of the required XP.

    Hopefully this helped, kind of short on time so I simpled it up pretty amazingly. Lol.

    #3 Nov 26, 2012 at 21:52 UTC - 0 likes

    I have done this b 4 give me a minute to write a response as well.

    Edit: I need to open the editor again lol... I am currently doing some triggering I will post the map when I am done should take a few more mins

    Last edited Nov 26, 2012 by joecab
    #4 Nov 26, 2012 at 21:57 UTC - 0 likes
    Quote from Stealthsam: Go

    All you have to do is set the width of the bar to a ratio based on the maximum width of the bar and the current/maximum exp of the player...

    So say your exp is 100/1000. set percent = 100/1000

    that comes out to .1

    so then set the dialog size to (385*.1,height)

    This will make the bar be 10% of its full width, therefore representing you have 10% of the required XP.

    Hopefully this helped, kind of short on time so I simpled it up pretty amazingly. Lol.

    Using this, the xp bar begins at half when gaining a level.

    Let's say at level 1 you need 100 exp to gain a level. At level 2 you need 200 exp to the next level, and have 100 exp from level one. I need 100exp to be 0% of the bar width so it starts over.

    #5 Nov 26, 2012 at 22:56 UTC - 0 likes

    Just working the kinks out now, will post the map when i get the dialog items to show up and respond.

    Edit: having more difficulty than I anticipated sorry for the wait :(

    Last edited Nov 26, 2012 by joecab
    #6 Nov 26, 2012 at 22:57 UTC - 0 likes

    Thanks for the asssist :D

    #7 Nov 27, 2012 at 00:03 UTC - 0 likes

    alright after having a showdown with the editor I finally got a rough experience bar working. The older editor did not have order of operations, it took me a bit of time to realize what was going on.

    so i gave the thor a data exp bar for comparison, and disabled anything that I had done wrong in the triggers but did not delete for maximum DO NOT DO, Hope this helps :D

    One quick not so obvious feature is that when you mouse over the bar it shows the current exp, tho i forgot to put in out of so and so maximum experience, but that was just for show.

    Last edited Nov 27, 2012 by joecab
    Name Size MD5
    Custom_Experience_Bar_useing_Dialog_Scaleing.SC2Map 43.0 KiB 7114172a2665...
    #8 Nov 27, 2012 at 01:47 UTC - 0 likes

    @Skoite: Go

    I have a leveling bar in my leveling library as well, if you'd like to use it. It's not custom though just boss bars.

    See down in my sig.

  • 8 posts

You must login to post a comment. Don't have an account? Register to get one!