How do I make a weapon deal dmg over time

Get help using Construct 2

Post » Sun Jun 04, 2017 2:11 am

Message: nazguloum can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi , i'm looking for help. I'm making a shoot'em up and i want to make a weapon laser like that deal dmg every x sec to ennemies it collides. I tried this http://imgur.com/a/ybwgb . But it only does that every 1 sec a large amount of dmg is done. Some help pls ?
B
1
Posts: 2
Reputation: 129

Post » Sun Jun 04, 2017 11:22 am

Make something like this. Add a global variable called DOT set it to 0 on start, when you hit the enemy with the laser set the DOT to 1, then add an event that says system.DOT == 1, as action add your DOT damage with a wait system condition, example substract 1 from health wait 1 sec, then repeat as long as you want it to last, and at the end add system.DOT = 0.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Thu Jun 08, 2017 2:41 am

Message: nazguloum can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thx for your help , I tried something but it still doesn't work : http://imgur.com/a/nJlli . Need help pls
B
1
Posts: 2
Reputation: 129

Post » Thu Jun 08, 2017 11:40 am

Give me the Capx file, I can make it for you.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Thu Jun 08, 2017 1:16 pm

Scenario 1:
Laser can only have 1 instance and, is 2 seconds on screen, and not fired for the next 10 seconds.

First second ...
Laser is present.
Overlap is happening.
Dot is true
Subtraction happens.

Second second ....
Laser is present.
Overlap is happening.
Dot is true
Subtraction happens.

Third second ....
Laser is NOT present.
Overlap is NOT happening.
Dot is STILL true
Subtraction happens. BUT there is no laser. So the instance variable dmg for laser does not exist. Zero gets subtracted.

And so on ....

Scenario 2:
Laser is fired at a dragon for less then a second.
Laser is gone b4 every second (1) can run.

Scenario3:
Laser is fired in 2 bursts at the same dragon.
System is reset at the second burst. The first damage cycle is never completed.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 08, 2017 3:06 pm

So, lets see if i can do this myself.

Given those rules (not necessarily your rules)

There are different amounts of damage (since you use an instance variable on the laser, that is safe to assume)
The dragons suffer damage every second during a hit with a laser.
The dragons suffer damage for a duration 10 seconds and that with intervals of 1 second after the hit. (delayed damage)
Previous delayed damages keep counting on, and adding up to the total damage done.

https://www.dropbox.com/s/07q5lc55sqfnv ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: fearfulelephants and 17 guests