| 07-30-2007, 09:57 PM | #1 |
Hey, I'm making a "Corpse Explosion" spell and it works perfectly, except for the fact that it also damages allies. I have it built in GUI and it's based off of raise dead. You cast raise dead, and triggers create the explosion effect and have the spell caster deal damage in a circular area around the target of the ability being cast. The only problem with it is it deals damage to the caster and allied units also. I've tried assigning units to a group, and then dealing damage to that group, but I couldn't get it to work, if this method does work could someone help me figure out what I did wrong? Also, if there is a way to set which units are damaged in the "Unit- Cause unit to deal damage in an area" trigger, where is it? |
| 07-30-2007, 10:22 PM | #2 |
If you use the function "Unit- Cause unit to deal damage in an area", you can't control which units will receive damage or not. You have to catch the units via group units. |
| 07-30-2007, 10:23 PM | #3 |
It's been a while since I've done anything in GUI, but can't you do something like. |
| 07-30-2007, 11:22 PM | #4 |
Hmmm. . . alright, lets see, I'm havin' some trouble assigning just enemies to the group now, any suggestions? Also, I'm not completely new to JASS and I'd be very greatful if you posted a JASS solution, I could definately learn from that. ![]() Off topic, but how do you post triggers like Naakaloh? |
| 07-30-2007, 11:53 PM | #5 |
the [trigger] tags |
| 07-31-2007, 12:20 AM | #6 | |
Here's just a simple example of how you might want to damage a group of enemy non-magic-immune units at a given point( x and y) within a given range.
|
| 07-31-2007, 12:34 AM | #7 |
Hmm, I see what you mean. Could you use GetUnitLoc(GetSpellTargetUnit()) for the x and y instead? or is it something like GetUnitLoc(GetSpellTargetUnit(X)) and GetUnitLoc(GetSpellTargetUnit(Y))? Also, you could use GetUnitAbilityLevelSwapped to create formulas for radius and damage correct? ~Thanks by the way TheSecretarts |
| 07-31-2007, 12:44 AM | #8 |
Well, I would suggest something like GetLocationX(whichLocation) or GetUnitX(whichUnit)
Edit: And, yes, formulas would be easy to do. For example this returns 50, 75, 100 for levels 1, 2, 3, respectively. JASS:function GetDamageByLevel takes integer level returns real return level*25 + 25 endfunction |
| 07-31-2007, 12:55 AM | #9 |
How would you define the location or unit's x and y values if the effects have to take place at the target of the ability? "level" requires designation somewhere earlier in the script correct? Or does JASS automatically know you're talking about the ability used to trigger the trigger in the first place? Man, I really need to spend some serious time learning JASS it would be so helpful. Thanks Naakaloh, even though I've not solved my quandry yet. . . |
| 07-31-2007, 01:06 AM | #10 |
Sorry, I didn't realize I was discussing things you wouldn't get. Note, the variable names are arbitrary, and the ellipses are just denoting that this is a segment of the function. You would get the casting unit or target unit or location like this: JASS:... local unit source = GetSpellAbilityUnit() local unit targetunit = GetSpellAbilityTarget() local location targetloc = GetSpellTargetLoc() ... You would get the level by declaring an integer and then assigning the level to it like this JASS:... local integer level = GetUnitAbilityLevel( source, [AbilityCode]) ... |
| 07-31-2007, 02:15 AM | #11 |
Yea, I should have flat out said I'm horrible with JASS. I've only fiddled with JASS and wrote maybe two line triggers before, thanks for sticking with me on this one, I'ma compile what you've added to my knowledge, remake the spell, and then come back with any further questions. Expect to hear from me soon with tales of my failure |
| 07-31-2007, 06:52 AM | #12 |
This is a way to do it in GUI if you care. Trigger: Unit Group - Pick every unit in (Units within 512.00 of (Target point of ability being cast) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions) |
| 07-31-2007, 10:42 PM | #13 |
Zomg, awesome. I'ma still try to make it in JASS to expand my knowledge but if it doesn't work, GUI is where I'm gonna end up, thanks man. ![]() |
| 07-31-2007, 11:45 PM | #14 |
That's basically what I suggested first... though, I don't think Picked Unit works in the filter (the "matching" part), I think you'd have to use Matching Unit |
| 08-01-2007, 06:15 AM | #15 |
No, you use Picked Unit. |
