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
26
S
11
Posts: 221
Reputation: 2,497

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
27
S
16
G
154
Posts: 887
Reputation: 80,202

Post » Thu Aug 20, 2015 11:09 pm

Well the problem is they're both the same object type
B
26
S
11
Posts: 221
Reputation: 2,497

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,940

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,519
Reputation: 11,084

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
26
S
11
Posts: 221
Reputation: 2,497

Post » Fri Aug 21, 2015 5:45 pm

B
67
S
24
G
7
Posts: 1,519
Reputation: 11,084


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 49 guests