summation of the three values

0 favourites
From the Asset Store
A slots game template designed to be skin-able for mobile
  • I have three variables Attack1 Attack2 Attack3

    Attack1 is base stat of character but Attack2 & Attack3 is optional stats (when equip second weapon or drink strenght potion)

    Now in text object i want display "Attack" & Attack1 but i want always this three variables in one variable

    How do it?

  • Can you give an example of what the variables represent, and what you expect the outputs to look like?

  • aerger sure i prepare example

  • Do you mean

    "Attack " & Attack1 +Attack2 +Attack3

    or maybe

    "Attack " & Attack1 & ", "& Attack2 & ", "& Attack3

  • This is short example

  • codah Your examples is for Text objects. Text object show one variable but in inspector Main stat of attack doesnt change.

    Attack1 is main optional is rest of variables.

    When i hit oponent i want decrease (if this is possible) just only main attack stat.

  • Maybe now. When Attack1 is 10 and Attack2 is 2 and Attack3 is 8

    Attack1 should be 20

    Right?

  • So every 0.1 seconds in your example, just set text of your text object to: "Attack " & Attack1 + Attack2 + Attack3 and that should do it, right? I think?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • aerger but when i want want decrase from enemy.hp i want decrease from one variable not this three

  • I Starting understand its not possible

  • I think we're getting closer, but I'm still not sure I'm completely understanding what you need.

    I do think we have a bit of a language barrier, but I would not give up and say what you want to do is not possible.

    So you have three attacks, each triggered by its own key press. The total value of all three attacks is displayed.

    What do you want to subtract from the enemy's hit points? The sum of all three values, or do you just want to subtract ONE of the three values from the enemy's hit points?

  • aerger thanks for your initiative, i make this like substract Attack1 + attack2 +attack3 from enemy.hp and this works for me very well.

    Yes previously i want sum all three values to ONE and this ONE sum deals damage to enemy.

  • So possibly just this, then?

    You can then just subtract TotalAttackValue from EnemyHP (and then probably reset TotalAttackValue and your other attack variables back to 0).

  • What is not possible? These are basic maths: Enemyhealth -(Attack1 + Attack2 + Attack3).

    If you must have one variable just have a global variable, say Totalattack and change that only when equipment changes. Then subtract that from enemy health (more efficient too, probably).

  • Somebody yes this is exacly what i use now -(Attack1 + Attack2 + Attack3)

    do youhave expression to:

    "If you must have one variable just have a global variable, say Totalattack and change that only when equipment changes. Then subtract that from enemy health (more efficient too, probably)."

    ??

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