How to combine 2 or more variables?
|
|
Omegaxis12 | Date: Thursday, 2012-05-17, 3:25 PM | Message # 1 |
Knight
Group: contributor
Messages: 169
Awards: 0
Reputation: 5
Reproofs: 0%
Status: Offline
| Situation:
i have 5 statedefs and their's a varset and varadd for everyone of them the problem is i want their variable combine so when the combined variables set to a specific value, my characters change to a certain state
how to do this
P.S. 1.)varadd is not what i need sirs and ma'ams 2.)i want it as a trigger
Message edited by Omegaxis12 - Thursday, 2012-05-17, 3:33 PM |
|
| |
sgn_15 | Date: Thursday, 2012-05-17, 3:36 PM | Message # 2 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| you want to add values of 2 vars into 1 value? is that what you mean? then use a 3rd variable to contain the total of 2 variables (you want to add)
Quote (Omegaxis12) 2.)i want it as a trigger what trigger?
|
|
| |
Omegaxis12 | Date: Thursday, 2012-05-17, 3:48 PM | Message # 3 |
Knight
Group: contributor
Messages: 169
Awards: 0
Reputation: 5
Reproofs: 0%
Status: Offline
| Quote (sgn_15) you want to add values of 2 vars into 1 value? is that what you mean? then use a 3rd variable to contain the total of 2 variables (you want to add)
can you pls give me an example?
Quote (sgn_15) what trigger? i want the total of the combined variables as the triggers
example: when the total of the combined variables reaches 50 it triggers the state
|
|
| |
sgn_15 | Date: Thursday, 2012-05-17, 4:01 PM | Message # 4 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| for example you want to add the values of var 0 and var 1 into var 2
type = varadd trigger1 = v = 2 value = var(0)
type = varadd trigger1 = v = 2 value = var(1)
AFTER these 2 varadd are executed, the value of var 2 should be the total of var 0 and var 1
you need to reset the value of var 2 (and possibly var 0 and 1) if these vars are like for attacks or whatever that can be done multiple times during a match
Quote (Omegaxis12) example: when the total of the combined variables reaches 50 it triggers the state
type = whatever state controller trigger1 = var(2) >= 50
var 2 based from my example above is at least 50 (remove the > if you want it to trigger only on EXACTLY 50)
|
|
| |
Omegaxis12 | Date: Thursday, 2012-05-17, 4:06 PM | Message # 5 |
Knight
Group: contributor
Messages: 169
Awards: 0
Reputation: 5
Reproofs: 0%
Status: Offline
| Quote (sgn_15) type = varadd trigger1 = v = 2 value = var(0)
type = varadd trigger1 = v = 2 value = var(1) Quote (sgn_15) type = whatever state controller trigger1 = var(2) >= 50
i think i did these 3 correctly... but the problem is what should i put to the v=? of varset of var(2)
oh btw in the trigger of varadd in ur example should i put 1 or time > 0
Message edited by Omegaxis12 - Thursday, 2012-05-17, 4:06 PM |
|
| |
sgn_15 | Date: Thursday, 2012-05-17, 4:10 PM | Message # 6 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| you should use a trigger that is NOT CONTINUOUS
time > 0 will trigger as long as time is greater than 0 so obviously that is continuous
try time = 0. it means it will trigger only on the first tick of the state.
dude, just look at this logic. you have 2 bottles of water both of the same size. you want the content of those 2 bottles to be combined, so what do you do? use a 3rd bottle.
you have vars 0 to 59 to use for your char and another set of vars for the helpers. use whatever vars you have NOT USED YET
|
|
| |
Omegaxis12 | Date: Thursday, 2012-05-17, 4:12 PM | Message # 7 |
Knight
Group: contributor
Messages: 169
Awards: 0
Reputation: 5
Reproofs: 0%
Status: Offline
| but sir, i want it to be continues, is it possible?
and sir, sorry for my stupidity but is this correct?
var(40) = var(35)+var(36)+var(37)+var(38)+var(39)
Message edited by Omegaxis12 - Thursday, 2012-05-17, 4:14 PM |
|
| |
sgn_15 | Date: Thursday, 2012-05-17, 4:16 PM | Message # 8 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| Quote (Omegaxis12) sir but i want it to be continues, it depends on your usage of the variables. vars don't mean anything in general. they are just containers of values, just like in algebra
explain how you use your vars. i will tell you if it should be continuously triggered or not and how
Quote (Omegaxis12) var(40) = var(35)+var(36)+var(37)+var(38)+var(39) varadd only adds 1 value at a time if i remember correctly so use 5 separate varadds (like my example of 2 varadds)
|
|
| |
Omegaxis12 | Date: Thursday, 2012-05-17, 4:19 PM | Message # 9 |
Knight
Group: contributor
Messages: 169
Awards: 0
Reputation: 5
Reproofs: 0%
Status: Offline
| sir can i just pm you in ym so we can talk properly and i will tell you what i want their
and for us to not flood here
|
|
| |
sgn_15 | Date: Thursday, 2012-05-17, 4:22 PM | Message # 10 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| k
but you're doing nothing wrong. this section is for asking for help. it's your choice though
|
|
| |
Mugen_Boy | Date: Friday, 2012-05-18, 3:50 PM | Message # 11 |
God Of Animation
Group: contributor
Messages: 2653
Awards: 6
Reputation: 22
Reproofs: 0%
Status: Offline
| Quote (sgn_15) but you're doing nothing wrong. this section is for asking for help He's right, because anyone else who has similar problem can just come here to get the solution. But I understand if you want to keep it private.
|
|
| |
BladeStorm_X | Date: Friday, 2012-05-18, 3:57 PM | Message # 12 |
The Chosen One
Group: contributor
Messages: 538
Awards: 0
Reputation: 1
Reproofs: 0%
Status: Offline
| Do you want a trigger that checks if the total of all the vars is 50? if so it should be trigger1 = var(1)+var(2)+var(3)+var(4)+var(5) = 50
|
|
| |
sgn_15 | Date: Friday, 2012-05-18, 4:05 PM | Message # 13 |
God
Group: contributor
Messages: 2518
Awards: 4
Reputation: 31
Reproofs: 0%
Status: Offline
| he already got his problem solved. 50 was just an example value. he already explained wth he wanted to do
|
|
| |
BladeStorm_X | Date: Friday, 2012-05-18, 4:10 PM | Message # 14 |
The Chosen One
Group: contributor
Messages: 538
Awards: 0
Reputation: 1
Reproofs: 0%
Status: Offline
| Quote (sgn_15) he already got his problem solved. 50 was just an example value. he already explained wth he wanted to do O......
|
|
| |