playMaker

Author Topic: Set Property and fillAmount help  (Read 1574 times)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Set Property and fillAmount help
« on: June 12, 2019, 11:30:34 AM »
Hello,
I have a problem with using the Fill Amount in the sprite UI image.

Basically, I have a ChargingTime filling from 0 to 24, but the fillAmount variable only filling from 0 to 1. How to make it so they are synchronized and I can show the right amount of ChargingTime to my Charge Bar?

Right now, I'm using set property, and as a result, the value is overloaded.

How to make it work correctly?
Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Set Property and fillAmount help
« Reply #1 on: June 13, 2019, 10:07:22 AM »
Hi.
You have an action Ui Image Set Fill Amount i would suggest using that instead.

Now you have to calculate this.

Just do 'current' divide by 'max' with a 'Float Operator'.

so for example 6 divide by 24.

Result should be 0.25 and use that to fill :)

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: Set Property and fillAmount help
« Reply #2 on: June 14, 2019, 01:12:29 AM »
I think I might come across with this type of variable quite often.
So, just do some math operator to match the value every time?

Then, what if both numbers are irregular, how to find the common ground for both?
Ex: Var1: 0 to 351 with Var2: 29 to 49

Cheers.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Set Property and fillAmount help
« Reply #3 on: June 14, 2019, 04:29:45 AM »
Hi.
1st guess would be doing 49-29 then you have 0-29 and when you get a variable to check also do -29 before 'current' divide by 'max'

var 1 will work the same as on previous post

rechronicle

  • Full Member
  • ***
  • Posts: 119
  • Mystvaldia
    • Indie RPG Creator
Re: Set Property and fillAmount help
« Reply #4 on: June 14, 2019, 06:23:57 AM »
Got it.
Gonna need to explore math operator for maximum efficiency.

Thank you!