* * * This tutorial assumes you have a basic understanding of data editing * * *
So you want your unit to be able to Miss or Crit on their attack based on a Percentage chance...
To do this with the data editor is actually very simple. First, The required data "Objects"
You will need:
3 Damage Effects (Address each one with a suffix of "Hit", "Miss", "Crit" respectively)
1 Persistent
1 Weapon
(Optional) Launch Missile Effect
If you do not know how to define your own Damage effect, duplicate one in existence that behaves the way you want your unit's attack to behave. Now, Select the "Hit" effect. The only field that needs to be edited here is "Combat - Amount" - This is what you would like the base damage of your attack to be. Set it to an arbitrary number of your own choosing.
Next, Select the "Crit" effect. Set the "Combat - Amount" to a value of your choosing (Ideally a critical hit does more damage than a normal attack and should be higher than your "Hit" Amount.
Now Select the "Miss" effect. Set this "Combat - Amount" to 0 (While a miss should not hit a target in theory, the easiest way to have a miss effect work efficiently is to instead make it do nothing to the target when hit)
After that, Select the Persistent effect. We are going to edit 3 Fields here:
Effect - Flags: Enable "Random Effect"
Effect - Period Count: Set this to 1
Effect - Period Effects: Now when we select this field, we can add multiple effects to a list. What we will now do is Add each Damage effect into the field.
This will give you a 33% Hit, 33% Crit, 33% Miss Chance. The Periodic will randomly select an item from the "Effect - Period Effects" list and fire off that effect. The trick to editing these percentages is duplicating items in the list.
For Example: If you have 3 Instances of "Hit", 1 of "Crit", and 1 of "Miss" on your list. The Chances are now, 60% Hit, 20% Crit, 20% Miss.
Optional Step: If you want the weapon to fire a missile that hits the target, you must tie the Persistent to a Launch Missile Effect. Once again, duplicate an Object of the Effect type, if you do not know how to make your own. Edit the "Effect - Impact Effect" to Fire the persistent you created.
Getting Close to Finished: Now, Goto the Weapon you created for your unit. Set "Effect - Effect" to the persistent you created (or the Launch missile effect if you included this step).
Final Step: Now you have a weapon that can Hit, Crit, or Miss. The Last step is to goto the Unit that you want to give this weapon to, and edit "Combat - Weapons +" to use the Weapon you created.
not so similar to Warcaft critical
i must add this effects to my weapon
if i have many weapons (for zealot , marine hydra etc) i need to recreate this effect for all of them
if this units are heros , they have attributes (str) which gives dmg (1 per str) and crit must do two normal dmg
when i have 0 str all is ok (my marine have 10 dmg and my crit effect do 20 dmg) but when i have 10 or 100 str (my marine do 20/110 dmg and crit do 30/120 dmg) this is more similar to mkb effect
can you find different way to do this
i will be very thankful to you if you succeed
I have a related question. Let's say you wanted to give a unit an ability that reduces their chance of being crit by 50% for 6 seconds. Would that work with a system like this?
I tried to brainstorm solutions but I wasn't sure how to make a buff on the target change behaviors like crit that are on the attacker.
I haven't played too much with all the validator types, but there might be a way have it randomly validate an effect... at which I don't know if the Periodic will try to fire effects that the validator doesn't allow and just return a fail, or if it will return to randomly selecting one of the remaining effects that hasn't failed.
I am looking into doing a miss effect for my map project, but I don't like how you said a miss should not hit, and then ignored yourself and did it anyway.
Now Select the "Miss" effect. Set this "Combat - Amount" to 0 (While a miss should not hit a target in theory, the easiest way to have a miss effect work efficiently is to instead make it do nothing to the target when hit)
Shouldn't there be a trigger setup you can use that will return a random real number between 1 and 100, and if you wanted only 20% miss chance you could have numbers lower than 20 create some sort of actor effect that alters the trajectory of a projectile to not hit your target (and still deal 0 damage)?
Two ways to accomplish that, and I haven't played with it enough to give any step by step instructions. You can create an Actor Message ( I think it's message) that ignores the actor that is the target of it's animation. In theory, this will cause no impact. But I'm not sure if you need any other alterations to allow the missile to continue on it's course passed the unit. The offtarget arc can be adjusted by offsets. to cause a missile to give the visual representation of a miss.
However, with this, i'm not quite sure how you would handle causing a hit on another target that the missile's offset just happened to hit.
The other way, is like you said, with triggers. I don't like handling combat data by triggers, because it's heavier than data and can slow down performance when in a network game.
A behavior with a damage response does the same thing with more flexibility and granularity (there's a limited to how many effects you can specify so I think the minimum crit granularity with this technique would be around 3-5% unless you used a multiple roll system which makes it even more ridiculously complicated.)
Interesting stuff. I tried out the steps above but wasn't able to get the persistant to work right. Even with a single damage effect, it never did damage.
I'm working on a system to allow not only hits and misses, but when it misses to detect a unit, wall, etc. within a defined radius of the intended target and apply damage there. I believe this can be done with a trigger, but I haven't found anything in the data that would allow me to do that.
My thought is:
1. Check for hit or miss using RNG
2. if hit, apply damage effect
3. if miss
3a. get radius of weapon (local variable)
3b. create a projectile that moves instantly in a random x,y from the intended target and attach a region to it.
3c. check if region collides at new location with a unit, if so apply damage if hostile
3d. display animation for where the hit happened.
In my case there should only be about 5 players attacking at any given time so I don't believe this will lag things too much. If I can get it to work right I will post my results and how to do it.
Anyone have any luck with anything like this or any thoughts to my methodology? I'm new to SC2 editing myself.
* * * This tutorial assumes you have a basic understanding of data editing * * *
So you want your unit to be able to Miss or Crit on their attack based on a Percentage chance...
To do this with the data editor is actually very simple. First, The required data "Objects"
You will need:
3 Damage Effects (Address each one with a suffix of "Hit", "Miss", "Crit" respectively)
1 Persistent
1 Weapon
(Optional) Launch Missile Effect
If you do not know how to define your own Damage effect, duplicate one in existence that behaves the way you want your unit's attack to behave. Now, Select the "Hit" effect. The only field that needs to be edited here is "Combat - Amount" - This is what you would like the base damage of your attack to be. Set it to an arbitrary number of your own choosing.
Next, Select the "Crit" effect. Set the "Combat - Amount" to a value of your choosing (Ideally a critical hit does more damage than a normal attack and should be higher than your "Hit" Amount.
Now Select the "Miss" effect. Set this "Combat - Amount" to 0 (While a miss should not hit a target in theory, the easiest way to have a miss effect work efficiently is to instead make it do nothing to the target when hit)
After that, Select the Persistent effect. We are going to edit 3 Fields here:
Effect - Flags: Enable "Random Effect"
Effect - Period Count: Set this to 1
Effect - Period Effects: Now when we select this field, we can add multiple effects to a list. What we will now do is Add each Damage effect into the field.
This will give you a 33% Hit, 33% Crit, 33% Miss Chance. The Periodic will randomly select an item from the "Effect - Period Effects" list and fire off that effect. The trick to editing these percentages is duplicating items in the list.
For Example: If you have 3 Instances of "Hit", 1 of "Crit", and 1 of "Miss" on your list. The Chances are now, 60% Hit, 20% Crit, 20% Miss.
Optional Step: If you want the weapon to fire a missile that hits the target, you must tie the Persistent to a Launch Missile Effect. Once again, duplicate an Object of the Effect type, if you do not know how to make your own. Edit the "Effect - Impact Effect" to Fire the persistent you created.
Getting Close to Finished: Now, Goto the Weapon you created for your unit. Set "Effect - Effect" to the persistent you created (or the Launch missile effect if you included this step).
Final Step: Now you have a weapon that can Hit, Crit, or Miss. The Last step is to goto the Unit that you want to give this weapon to, and edit "Combat - Weapons +" to use the Weapon you created.
That is all there is to a Miss / Crit Effect.
not so similar to Warcaft critical i must add this effects to my weapon if i have many weapons (for zealot , marine hydra etc) i need to recreate this effect for all of them if this units are heros , they have attributes (str) which gives dmg (1 per str) and crit must do two normal dmg when i have 0 str all is ok (my marine have 10 dmg and my crit effect do 20 dmg) but when i have 10 or 100 str (my marine do 20/110 dmg and crit do 30/120 dmg) this is more similar to mkb effect can you find different way to do this i will be very thankful to you if you succeed
@themean: Go
You can use triggers to change the effec damage: Catalog - Set Catalog Value (Effects, yourDamageEffect, amount)
You still need this effect for every unit, but crits and normal hits do the correct amount of damage then.
10x i will try
any chance you can tutorial a pseudo sort of setup, if that's even possible? (pseudo random distribution)
I have a related question. Let's say you wanted to give a unit an ability that reduces their chance of being crit by 50% for 6 seconds. Would that work with a system like this?
I tried to brainstorm solutions but I wasn't sure how to make a buff on the target change behaviors like crit that are on the attacker.
@Aenigma: Go
I haven't played too much with all the validator types, but there might be a way have it randomly validate an effect... at which I don't know if the Periodic will try to fire effects that the validator doesn't allow and just return a fail, or if it will return to randomly selecting one of the remaining effects that hasn't failed.
I am looking into doing a miss effect for my map project, but I don't like how you said a miss should not hit, and then ignored yourself and did it anyway.
Shouldn't there be a trigger setup you can use that will return a random real number between 1 and 100, and if you wanted only 20% miss chance you could have numbers lower than 20 create some sort of actor effect that alters the trajectory of a projectile to not hit your target (and still deal 0 damage)?
@Zeban: Go
Two ways to accomplish that, and I haven't played with it enough to give any step by step instructions. You can create an Actor Message ( I think it's message) that ignores the actor that is the target of it's animation. In theory, this will cause no impact. But I'm not sure if you need any other alterations to allow the missile to continue on it's course passed the unit. The offtarget arc can be adjusted by offsets. to cause a missile to give the visual representation of a miss.
However, with this, i'm not quite sure how you would handle causing a hit on another target that the missile's offset just happened to hit.
The other way, is like you said, with triggers. I don't like handling combat data by triggers, because it's heavier than data and can slow down performance when in a network game.
A behavior with a damage response does the same thing with more flexibility and granularity (there's a limited to how many effects you can specify so I think the minimum crit granularity with this technique would be around 3-5% unless you used a multiple roll system which makes it even more ridiculously complicated.)
@FrozenFirebat: Go
Interesting stuff. I tried out the steps above but wasn't able to get the persistant to work right. Even with a single damage effect, it never did damage.
I'm working on a system to allow not only hits and misses, but when it misses to detect a unit, wall, etc. within a defined radius of the intended target and apply damage there. I believe this can be done with a trigger, but I haven't found anything in the data that would allow me to do that.
My thought is: 1. Check for hit or miss using RNG 2. if hit, apply damage effect 3. if miss 3a. get radius of weapon (local variable) 3b. create a projectile that moves instantly in a random x,y from the intended target and attach a region to it. 3c. check if region collides at new location with a unit, if so apply damage if hostile 3d. display animation for where the hit happened.
In my case there should only be about 5 players attacking at any given time so I don't believe this will lag things too much. If I can get it to work right I will post my results and how to do it.
Anyone have any luck with anything like this or any thoughts to my methodology? I'm new to SC2 editing myself.
so i basically have to have a *hit* and *crit* effect on each of my weapons???? ouch. hours in the dark staring at a PC screen much.