Hey, im testing some ideas for items in my rpg map (well it's not look's like map yet or ever, more like some kind of sandbox) and while thinking of tank class i wanted to create some special effect for item/abil described in title of this thread. So what i want to make is some abil that will deal damage equal to damage that hero received during last 3 seconds. I've been thinking how to implement this and come up with following: i need to create array, and each hit handled by hero record as variable which exist 3 seconds and create custom unit value that will be equal sum of all variables in this array(for calculation of this damage). Is it right approach or there are much easier ways to do it? and if so can someone help me to understand array usage in sc2 trigger editor, cuz i'm non-programmer and may suck in this matters.
Not sure if this works, because I use the wait function. At map initialization, save your heroes as variables. Create 3 variables, and name them Timer 1, Timer 2, and Timer 3. Then, create a trigger call it Set to 0 and do this:
Then, create three variables called Damage Taken 1, Damage Taken 2, and Damage Taken 3, change them all to the real type and make them constants. Then create a trigger, name it Hero takes damage and do the following, note that I'm writing this away from my computer, so on the variable part in here search for the taken damage thing in functions instead of using a value, because I forgot what it was exactly, and I don't have my computer with me now because I'm using my iPad:
Create a trigger and call it Ability Activate and put Hero uses (your dummy ability here) under events. Under actions, put If (Conditions) then do (Actions) Else do (Actions).
Put the condition as Timer 1 = 3, action as (search up deal damage, and you'll have the right one) and fill in the stuff and make the added damage as Taken Damage 1, and leave the other action as blank. Copy it two times, and change the values to Timer 2, Taken Damage 2; and Timer 3, Taken Damage 3. And hopefully it will work now.
Hey i made my abil but i made it like a total noob in programming( actually i am a total noob in programming)
So i will be very grateful if someone advise me how to utilize functions and FOR loop for my abil. And how to get rid of global variables and use local instead.
I'll attach the map and hope someone will help to clean the mess in it :)
Edit: I've just figured out how to use for loop and cleaned my triggers a bit. Anyways i still need help with functions. I want get rid of global variables and make things as efficient as possible.
okay so can someone at least tell me how can i attach array that updates every 0.1 second to attacker and then query it from defender when it takes damage? :/
Hey, im testing some ideas for items in my rpg map (well it's not look's like map yet or ever, more like some kind of sandbox) and while thinking of tank class i wanted to create some special effect for item/abil described in title of this thread. So what i want to make is some abil that will deal damage equal to damage that hero received during last 3 seconds. I've been thinking how to implement this and come up with following: i need to create array, and each hit handled by hero record as variable which exist 3 seconds and create custom unit value that will be equal sum of all variables in this array(for calculation of this damage). Is it right approach or there are much easier ways to do it? and if so can someone help me to understand array usage in sc2 trigger editor, cuz i'm non-programmer and may suck in this matters.
Not sure if this works, because I use the wait function. At map initialization, save your heroes as variables. Create 3 variables, and name them Timer 1, Timer 2, and Timer 3. Then, create a trigger call it Set to 0 and do this:
Create a new trigger, call it Timer and do the following:
Then, create three variables called Damage Taken 1, Damage Taken 2, and Damage Taken 3, change them all to the real type and make them constants. Then create a trigger, name it Hero takes damage and do the following, note that I'm writing this away from my computer, so on the variable part in here search for the taken damage thing in functions instead of using a value, because I forgot what it was exactly, and I don't have my computer with me now because I'm using my iPad:
Modify your Set to 0 trigger to this:
Create a trigger and call it Ability Activate and put Hero uses (your dummy ability here) under events. Under actions, put If (Conditions) then do (Actions) Else do (Actions).
Put the condition as Timer 1 = 3, action as (search up deal damage, and you'll have the right one) and fill in the stuff and make the added damage as Taken Damage 1, and leave the other action as blank. Copy it two times, and change the values to Timer 2, Taken Damage 2; and Timer 3, Taken Damage 3. And hopefully it will work now.
Hey i made my abil but i made it like a total noob in programming( actually i am a total noob in programming) So i will be very grateful if someone advise me how to utilize functions and FOR loop for my abil. And how to get rid of global variables and use local instead. I'll attach the map and hope someone will help to clean the mess in it :)
Edit: I've just figured out how to use for loop and cleaned my triggers a bit. Anyways i still need help with functions. I want get rid of global variables and make things as efficient as possible.
okay so can someone at least tell me how can i attach array that updates every 0.1 second to attacker and then query it from defender when it takes damage? :/