Status Effect Duration

Get help using Construct 2

Post » Sat Jan 25, 2014 9:53 am

i have a turret that will spawn 2 types of bullets
1st bullet will make the enemy hit into gaining "Z" status for 4 seconds

2nd bullet will make the enemy hit into gaining "A" status for 3 seconds

now :

if the enemy has no "Z" status when the 1st bullet collided with the enemy, the enemy will gain "Z" status

if the enemy ALREADY has "Z" status, then the duration will be refreshed into 3 seconds again (for anyone playing DOTA should understand, i meant to use 'orb effect' kind of thing)

if the enemy is hit by 2nd bullet, while ALREADY having the "Z" status, the status will simply add into "Z|A|", which means the enemy is AFFECTED by both effect.

https://www.dropbox.com/s/o73eymclbvu6p68/TestEffect.capx

i already made the whole 'not stacking' effect.
but i can't add the duration

can anyone make so that A status will be gone after the enemy is NOT hit by the 2nd bullet for 3 second, and so Z status will be gone after the enemy is not hit by the 1st bullet for 4 seconds?

and if able, the duration will be refreshed to 3 or 4 (based on the effect) if the enemy is hit again.

thanks
--
ah, if able, i would like for all the status effect to be placed on a string, so if i wanted to add more effect, i don't add an instance variable. well, if able @[email protected]vahnyourdoom2014-01-25 10:00:27
B
7
Posts: 11
Reputation: 397

Post » Sat Jan 25, 2014 10:19 am

Hi I added some animations to see if a, a, a and z, or none are true.
Didn't use a string though, for using booleans seems like an easier way.

testeffect-littlestain
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jan 25, 2014 2:45 pm

@LittleStain

ah, to check on opponent's current status, just clik on the sprite.
and to change the bullet, click on the turret
sorry i missed to explain that ~_~


anyway, can anyone do this? i've tried to use a timer, still doesn't work so well.

to be exact, i am unable to find the certain String that needs to be replaced by ""

i can't make the string to "", because that will reset ALL status that is currently applied on that unit.

i need to find the correct status(for example "Z|") then exchanging the "Z|" into ""

so if opponent currently is affected by
"A|Z|"

it will become

"A|" (the | is for separator)

is there a way to find the "Z|" on the string, then replace it


---

using replace and timer does well @[email protected], took me few hours to get it done (i first uses 'wait', but it went buggy as it does not refresh the duration like i wanted it to be)vahnyourdoom2014-01-25 15:43:20
B
7
Posts: 11
Reputation: 397

Post » Sat Jan 25, 2014 3:46 pm

What is it that doesn't work right in my example?

The timers are working correctly, as you can see from the animations I added.
I didn't try to create your string variable for I couldn't see the benefit if you are going to have to check it for all booleans and combinations thereof anyway.LittleStain2014-01-25 16:23:17
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Ashley, dop2000, Google [Bot], jatoblendy, MathNook, tarek2 and 33 guests