Author Topic: [not sure where this goes] how do i..  (Read 895 times)

use events to make a force field door? AKA

has something to simulate health after a # of shots it dissapers for a set time

i have tryed all i can think of

if there's not a mod already made for this, i would try to use vce events for this but i totally forgot how to use vce events since it's been forever

i think this is how it would go, but don't quote me on it

there would be a starting value and with an onprojectilehit the value would go down until it reaches zero and then it would set raycasting to 0, and over time with relay events it would go up over time until it reaches a certain time and then raycasting is set to 1 and all events are cancelled

i think it would be easier and more reliable to have an add-on for it

you could use the prop tool and propify wand to convert bricks in your build to be destructible. not the best solution but it's better than nothing

use events to make a force field door? AKA

has something to simulate health after a # of shots it dissapers for a set time

i have tryed all i can think of
onProjectileHit > self > vce_modVariable > brick | health | subtract | 1
onProjectileHit > self > vce_ifValue > <var:br:health> | < | 1 | 2 2
onVariableTrue > self > setRaycasting > [unchecked]
onVariableTrue > self > setRendering > [unchecked]
onVariableTrue > self > setColliding > [unchecked]
onVariableTrue > self > vce_modVariable > brick | hp | set | [number of total HP]
[delay of 30000 ms] onVariableTrue > self > setRaycasting > [checked]
[delay of 30000 ms] onVariableTrue > self > setRendering > [checked]
[delay of 30000 ms] onVariableTrue > self > setColliding > [checked]

onProjectileHit > self > vce_modVariable > brick | health | subtract | 1
onProjectileHit > self > vce_ifValue > <var:br:health> | < | 1 | 2 2
onVariableTrue > self > setRaycasting > [unchecked]
onVariableTrue > self > setRendering > [unchecked]
onVariableTrue > self > setColliding > [unchecked]
onVariableTrue > self > vce_modVariable > brick | hp | set | [number of total HP]
[delay of 30000 ms] onVariableTrue > self > setRaycasting > [checked]
[delay of 30000 ms] onVariableTrue > self > setRendering > [checked]
[delay of 30000 ms] onVariableTrue > self > setColliding > [checked]
this is along the lines of what i was thinking of, thank you

You could do this with default events, but it will be a bit more event lines

0 onProjectileHit > self > setEventEnabled 0 1 ☐
1 onProjectileHit > self > setEventEnabled 2 3 ☒
2 onProjectileHit > self > setEventEnabled 2 3 ☐
3 onProjectileHit > self > setEventEnabled 4 5 ☒
4 onProjectileHit > self > setEventEnabled 4 5 ☐
5 onProjectileHit > self > setEventEnabled 6 7 8 9 ☒
6 onProjectileHit > self > setRaycasting ☐
7 onProjectileHit > self > setColliding ☐
8 [3000] onProjectileHit > self > setRaycasting ☒
9 [3000] onProjectileHit > self > setColliding ☒

To regain strength after 10 seconds add:
10 [100] onProjectileHit > self > CancelEvents
11 [10000] onProjectileHit > self > setEventEnabled 0 1 ☒
12 [10000] onProjectileHit > self > setEventEnabled 2 3 4 5 6 7 8 9 ☐

You could do this with default events, but it will be a bit more event lines

0 onProjectileHit > self > setEventEnabled 0 1 ☐
1 onProjectileHit > self > setEventEnabled 2 3 ☒
2 onProjectileHit > self > setEventEnabled 2 3 ☐
3 onProjectileHit > self > setEventEnabled 4 5 ☒
4 onProjectileHit > self > setEventEnabled 4 5 ☐
5 onProjectileHit > self > setEventEnabled 6 7 8 9 ☒
6 onProjectileHit > self > setRaycasting ☐
7 onProjectileHit > self > setColliding ☐
8 [3000] onProjectileHit > self > setRaycasting ☒
9 [3000] onProjectileHit > self > setColliding ☒

To regain strength after 10 seconds add:
10 [100] onProjectileHit > self > CancelEvents
11 [10000] onProjectileHit > self > setEventEnabled 0 1 ☒
12 [10000] onProjectileHit > self > setEventEnabled 2 3 4 5 6 7 8 9 ☐

thanks! i want default commands because i want to try to make a base with a shield door

is the 3000 the HP?

3000 is the delay before it respawns.

None of these will give you actual HP, instead, just a number of hits.

thanks! i want default commands because i want to try to make a base with a shield door

is the 3000 the HP?
No, the amount of time the shield is disabled = 3000ms = 3 seconds


The amount of HP are the amount of events the brick has to cycle through:
0 onProjectileHit > self > setEventEnabled 0 1 ☐
1 onProjectileHit > self > setEventEnabled 2 3 ☒

In my example it needs 4 shots to get disabled
1:
Code: [Select]
0 onProjectileHit > self > setEventEnabled 0 1 ☐
1 onProjectileHit > self > setEventEnabled 2 3 ☒
2:
Code: [Select]
2 onProjectileHit > self > setEventEnabled 2 3 ☐
3 onProjectileHit > self > setEventEnabled 4 5 ☒
3:
Code: [Select]
4 onProjectileHit > self > setEventEnabled 4 5 ☐
5 onProjectileHit > self > setEventEnabled 6 7 8 9 ☒
4:
Code: [Select]
6 onProjectileHit > self > setRaycasting ☐
7 onProjectileHit > self > setColliding ☐
8 [3000] onProjectileHit > self > setRaycasting ☒
9 [3000] onProjectileHit > self > setColliding ☒