"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
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

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
234
S
27
G
13
Posts: 1,784
Reputation: 18,274

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
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

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
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

Post » Wed Jun 26, 2013 3:08 am

@Whiteclaws It doesn't work

B
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

Post » Wed Jun 26, 2013 3:24 am

Oops , forgot the trigger once :P
B
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

Post » Wed Jun 26, 2013 3:25 am

@Whiteclaws It does not work again...
B
91
S
31
G
29
Posts: 3,129
Reputation: 27,789

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
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

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
91
S
31
G
29
Posts: 3,129
Reputation: 27,789


Return to How do I....?

Who is online

Users browsing this forum: Congrats2u, jhjconstruct, tarek2, TheGreatAdam12 and 8 guests