How do I compare a variable twice

Get help using Construct 2

Post » Thu Aug 20, 2015 9:22 pm

Ok so if I want characters to have the variable anger and when two characters collide and have anger higher than say 50 they would get into a fight. How could I check that both of them are angry so they won't just attack random people
B
22
S
8
Posts: 203
Reputation: 2,059

Post » Thu Aug 20, 2015 9:28 pm

on collision object1 with object2
(sub)system compare object1.angry>50
AND system compare object2.angry>50
----> action
Image Image
B
25
S
14
G
142
Posts: 881
Reputation: 74,020

Post » Thu Aug 20, 2015 11:09 pm

Well the problem is they're both the same object type
B
22
S
8
Posts: 203
Reputation: 2,059

Post » Fri Aug 21, 2015 1:32 am

you can put the object(s) in a family, then pick the first one by the object and the second one by the family.
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Fri Aug 21, 2015 9:01 am

on collision object1 with object1
...Pick object1 where object1.anger>50
.......object1.PicketCount=2.----------------------------------------> action
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Aug 21, 2015 5:30 pm

hmmm the family would involve more work because then I'd need to code for getting and losing anger for the object and the family and I'm not sure how to do the abject.PickedCount thing.
B
22
S
8
Posts: 203
Reputation: 2,059

Post » Fri Aug 21, 2015 5:45 pm

B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072


Return to How do I....?

Who is online

Users browsing this forum: irina and 6 guests