"On variable substracted" Trigger Event (Solved)

Get help using Construct 2

Post » Wed Jun 26, 2013 12:43 am

Hello, I'm looking a formula which it can keep executing actions like regular, not once on variable subtracted.

Here is my tricky attempt, it didn't work:





Thanks!Joannesalfa2013-06-26 04:12:52
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Wed Jun 26, 2013 12:51 am

Make a variable called "Prev_HP" or something and compare it to the current HP, if lower then call the function and set it to Creatures.HP.
Image
B
239
S
28
G
13
Posts: 1,787
Reputation: 18,510

Post » Wed Jun 26, 2013 1:13 am

@Tokinsom Can you explain it more further? I'm not sure if you say greater than or less than, then set creatures HP from which one.

It only creates blood sprite, nothing else.
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Wed Jun 26, 2013 2:55 am

Make a variable called prev_HP with your HP variable ;

Then ;

If Prev_HP > HP ; Call Blood
                  Wait 0
                  Set Prev_HP to HP
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Jun 26, 2013 3:08 am

@Whiteclaws It doesn't work

B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Wed Jun 26, 2013 3:24 am

Oops , forgot the trigger once :P
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Jun 26, 2013 3:25 am

@Whiteclaws It does not work again...
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236

Post » Wed Jun 26, 2013 3:33 am

it works for me :/

Could you get us a small capx ?

Edit : Never told us it was as a family ? You should check each of the creatures , try "For Each Creatures"

Edit 2 : O.k , found it out !

System | For each Creatures
System | Creature.HP < Creature.Prev_HP
-- Creature | Set Prev_HP to HP
-- Creature | Spawn BloodWhiteclaws2013-06-26 03:42:16
B
41
S
17
G
17
Posts: 2,247
Reputation: 17,436

Post » Wed Jun 26, 2013 4:12 am

@Whiteclaws I got it working. I was going to make smaller version of .capx, anyway here is https://dl.dropboxusercontent.com/u/76227787/Damage.capx

Thanks! =)Joannesalfa2013-06-26 04:17:19
B
96
S
34
G
29
Posts: 3,139
Reputation: 28,236


Return to How do I....?

Who is online

Users browsing this forum: db3344, grigrizljac, Hex27, istero, Thibaut and 3 guests