Author Topic: Brick Health  (Read 710 times)

I saw someone once with VCE made a tree that displays how many hits with a weapon left until it disappears. Can anyone give me the events? :D

Code: [Select]
0: onActivate | Self | VCE_modVariable | healthv | Set | 25
1: onProjectileHit | Self | VCE_modVariable | healthv | Subtract | 1
2: onProjectileHit | Self | VCE_ifVariable | healthv | <= | 0 | 3 8 |
3: onVariableTrue | Self | fakeKillBrick | 0 | 0 | 0 | 15
4: onVariableTrue | Client | VCE_modVariable | scorev | Add | 1
5: onVariableTrue | Client | centerPrint | <color:ffffff>Health: <color:ff0000>0
6: onVariableFalse | Client | centerPrint | <color:ffffff>Health: <color:ff0000><var:br:healthv>
7: onVariableTrue | Client | chatMessage | <color:00ffff>Score: <color:ffffff><var:cl:scorev>
8: onVariableTrue | Self | VCE_modVariable | healthv | Set | 25

I think that will work.

noedit: Make sure you activate the brick you're shooting at first.

noedit: Make sure you activate the brick you're shooting at first.

Anyway to make it not need to be activated?

Anyway to make it not need to be activated?
Code: [Select]
0: onActivate | Self | VCE_modVariable | healthv | Set | 25
1: onProjectileHit | Self | VCE_modVariable | healthv | Subtract | 1
2: onProjectileHit | Self | VCE_ifVariable | healthv | <= | 0 | 3 8 |
3: onVariableTrue | Self | fakeKillBrick | 0 | 0 | 0 | 15
4: onVariableTrue | Client | VCE_modVariable | scorev | Add | 1
5: onVariableTrue | Client | centerPrint | <color:ffffff>Health: <color:ff0000>0
6: onVariableFalse | Client | centerPrint | <color:ffffff>Health: <color:ff0000><var:br:healthv>
7: onVariableTrue | Client | chatMessage | <color:00ffff>Score: <color:ffffff><var:cl:scorev>
8: onVariableTrue | Self | VCE_modVariable | healthv | Set | 25

I think taking off event 0 would work, it's just that when you first shoot at it, it would act like it had no health. It would work fine after that.

So it would be:
Code: [Select]
0: onProjectileHit | Self | VCE_modVariable | healthv | Subtract | 1
1: onProjectileHit | Self | VCE_ifVariable | healthv | <= | 0 | 2 7 |
2: onVariableTrue | Self | fakeKillBrick | 0 | 0 | 0 | 15
3: onVariableTrue | Client | VCE_modVariable | scorev | Add | 1
4: onVariableTrue | Client | centerPrint | <color:ffffff>Health: <color:ff0000>0
5: onVariableFalse | Client | centerPrint | <color:ffffff>Health: <color:ff0000><var:br:healthv>
6: onVariableTrue | Client | chatMessage | <color:00ffff>Score: <color:ffffff><var:cl:scorev>
7: onVariableTrue | Self | VCE_modVariable | healthv | Set | 25