Damage Display [SOLVED>PROBLEM WITH AZU]

This forum is currently in read-only mode.
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.
  • It seems that negative value (-5 for example) or float value (0.3 for example) will make strange things...

    Well, the example is geared towards whole numbers, which is what you would normally want (and I guess you don't want it to actually have 0.6 or negative damage displayed).

    This means you need to clamp the result of your calculation so it can't go below 0 and also round it in order to get whole numbers. Or floor/ceil it, depending on how you want it to behave. Check out the math expressions in the wiki.

  • Floor, Ceil, and I think you can use int, which will convert and float value to a integer.

  • Thanks to both of you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Don't mean to raise the topic again. But, I have a question. I don't if anyone here has played disgaea. In disgaea, damage over 99,999 is display in 3 digits, with a K at the end of the number.

    K=1000. 123,145 / 1000 = 123k. Like that. Over 100millionm is displayed by a "M". 100M = 100,000,000. So basically, I want to do something like that.

  • [quote:2ll78eyg]Left(string, N)

    Returns a string with the left N characters of string, eg. Left("Hello", 2) gives "He"

    That with a few subevents should work.

    -if damage is greater than 1000 set text to left(variable "damage",3)&" k"

    --if damage is greater than 1000000 set text to left(variable "damage",9)&" m"

  • Would that only worked with text-base numbers instead of sprite-based ones?

  • The text object is pretty good about doing the conversion, but you can always use str(), or int(), if need be.

  • What using sprite-based ones? Like in the example in this thread.

  • That would be the variable, like:

    If round(((Hero.Value('Power')*1.2)-Enemy.Value('Resist')+random(15))*global('Factor'))+1 is greater than 1000000

    Set your sprites to

    left(str(round(((Hero.Value('Power')*1.2)-Enemy.Value('Resist')+random(15))*global('Factor'))+1),9))&" M"

    Or what ever your using for m.

  • Must be doing something wrong.

    I'm not understanding much. I'm not using text in any fashion.

    Look in stats for the damage stuff.

    Baddies and Bosses for the damage dealing

    http://dl.dropbox.com/u/32409323/engine2a.cap

  • Sorry I cant seem to open your cap. Its pretty odd It says the cap uses "Colored Outline. Fx", and cant be located, but I clearly have the fx, and it's working for me.

    I guess either you version is different, or mine is corrupt somehow.

    Either way I mean use the value you use to set the frames. Strings are usually converted.

    I was just using the text object as an example.

  • Oh, I just renamed "Colour" to "Color". You must have the one with the original name.

    <--American.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)