How Percentage work at expressions?

0 favourites
  • 11 posts
From the Asset Store
Add this awesome sound effects to make your visual novel come to life!
  • Hello

    I want to know how to make percentage work at the expressions interface..

    Example:

    200 - 20% of it = 160

    but don't know how to express it in Construct, so I had to make a longer expression to obtain the same result:

    200-(200/(100/20)) = 160

    but would be better just to use percentage to obtain the same value..

  • 200-(0.2*200)

  • 200 * 0.80 = 160

    this is the simplest method..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 200 * 0.80 = 160

    this is the simplest method..

    and how did u obtain 0.80?

    I don't want to obtain the result 160, it was just an example.

    I want a value that is substracted by x% of it.

  • Just remember that a percent is always based on 100.

    Nice refresher from khanacademy.org.

  • 200-(0.2*200)

    with this method first I would need to transform 20 to 0.2(20/100), so at the end would be like my method..

  • Well you can always multiply by 0.01 to get the hundredths position.

    So n-(0.01*p*n)

  • Just remember that a percent is always based on 100.

    Nice refresher from khanacademy.org.

    Ahm.. I know that lol

    if hasn't I wouldn't obtained the same result, again, my question is how to use the '%' at the expression.

    just to make it clear

    there is 3 variables:

    life-100

    attack-20

    defense-10

    you hit by 20(atk) - 10(def)% of it = 18

    then life reduces to 182.

  • Well you can always multiply by 0.01 to get the hundredths position.

    So n-(0.01*p*n)

    50/100 and 50*0.01 is the same.

  • There is no % used in expressions, only as plain text.

    The percentage sign "%" otherwise is taken as modulo, the remainder from division.

    Correction

    % when used in expressions gives you the remainder from division, so yes it is used in expressions, just not for doing percentages.

  • There is no % used in expressions, only as plain text.

    The percentage sign "%" otherwise is taken as modulo, the remainder from division.

    Correction

    % when used in expressions gives you the remainder from division, so yes it is used in expressions, just not for doing percentages.

    Hmm.. that was what I was trying to understand.. so we need to create our own expressions for percentages then..

    thanks for your time ;)

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