Value Issues

This forum is currently in read-only mode.
From the Asset Store
Check preview, download and add value to your games.
  • I'm trying to represent values using sprites, but it's not working.

    http://www.mediafire.com/?zyqwmyzj3gxtriy

    There's the cap. I have a value of 50, but numbers doesn't come out at 50.

  • Could it be because frames are one based?

  • What newt said and the formula used with sprite2 didn't need the "/10".

    It sould look like this:

    -> Sprite: Set animation frame to (Sprite4.Value('DamageValue')%100)/10+1
    -> Sprite2: Set animation frame to (Sprite4.Value('DamageValue')%10)+1[/code:pudjgm3v]
  • Okay, I got. However, I have a new issue. I'm trying to generate random damage pops like in RPGs, but all the created numbers keep being the same.

    http://i61.photobucket.com/albums/h53/Sodisna/pci01.png

    <img src="http://i61.photobucket.com/albums/h53/Sodisna/pci02.png">

    Here's the update cap.

    http://www.mediafire.com/?5mwenymoimyemdn

    I tired setting it to the private value every time it creates, but it just return a 0.

  • You could just use Lucid's sprite font plug.

  • Doesn't work with any movement. I can't add any type of behavior, nor can I modify it's X/Y Position.

  • Hi. Simple fix.

    The way that you ordered the events, you were trying to set the frame on the digit sprites before actually creating them, so it changed all of the sprites each time. You have to pick instances of objects somehow if you don't want the actions to apply to all of the instances.

    In this case, Construct will automatically pick the 3 new sprites upon their creation, if you put the actions after that, like so:

    + System: Every 5 ticks
    -> Sprite4: Set 'DamageValue' to 1+random(150)
    -> System: Create object Sprite on layer 1 at (-16, -13) from ene_Baddie 's pivot point
    -> System: Create object Sprite2 on layer 1 at (0, -13) from ene_Baddie 's pivot point
    -> System: Create object Sprite3 on layer 1 at (16, -13) from ene_Baddie 's pivot point
    -> Sprite: Set animation frame to (Sprite4.Value('DamageValue')%1000)/100+1
    -> Sprite2: Set animation frame to (Sprite4.Value('DamageValue')%100)/10+1
    -> Sprite3: Set animation frame to (Sprite4.Value('DamageValue')%10)/1+1
    [/code:1u6u1rcd]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Worked Perfectly.

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