add all variables to one variable

Get help using Construct 2

Post » Sat Jun 09, 2012 12:20 pm



like in image.
When stats show armor points system must check all stats
and this all values add up to one value 'Armor defense' how do this ?
if i set for example this values
delgado2012-06-09 14:18:02
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Jun 09, 2012 1:24 pm

Armor Defense = Helmet Def + Armor Def + Pants def + Boots def

It's adding the values of several variables (possibly instance variables ?) and setting the result as the value for another (instance) variable.

Either your question is too vague, either badly formulated.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sat Jun 09, 2012 2:29 pm

Hi Kyatric, I want to get such a mechanism which will automatically counted the change throughout the game play statistics and summarized them in the meter called 'Armor Defense'

For example, current statistics suggest as many as in the image, such as a helmet when I change for the better by 3 in the 'Armor defense' should indicate only 13 not 10 By analogy with other statistics. For if the character will receive the damage will depend on the amount of 'Armor Defense'delgado2012-06-09 14:30:07
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Jun 09, 2012 2:46 pm

If you set the armor defense variable like Kyatric suggested, that variable should keep updating when you change the others.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sat Jun 09, 2012 3:18 pm

ok i will trydelgado2012-06-09 15:20:49
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Jun 09, 2012 9:03 pm

@Kyatric this works!:) Let me ask one more question (do not want to open a new topic) How do you type the name of the player on the main screen, the player's name will display in different layouts?
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Jun 09, 2012 10:00 pm

Make a Text global variable "PlayerName".
Assign the content of a textbox object (textbox.text) to "PlayerName".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793


Return to How do I....?

Who is online

Users browsing this forum: onzephyr and 1 guest