HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Explode on touch spell?

03-18-2007, 03:52 AM#1
botanic
Anyone know how I could make a spell that explodes a unit when it touches an enemy? I was thinking about the goblin land mines ability I just dont know how to add that to a unit...

thanks in advance
03-18-2007, 04:15 AM#2
Hydrolisk
Wait wait wait, what are you talking about?
So let me get this straight.
You need a spell like Goblin Land Mine but you DON'T KNOW HOW TO ADD IT TO A UNIT.
Ok, your helplessness inspires my curiosity. Are you using ROC or TFT? I'm pretty sure either one would work, though with possibly GAY effects in ROC. First of all, you should go to the G section of Abilities/Units. Or items. Then find Goblin Land Mines. Or perhaps Item Goblin Land Mines in item section. Then, right around the top of any unit in the OBJECT editor, there should be a field like Ability - Normal. Add.
If you're using TFT, I suggest making a custom ability off of Goblin Land Mines.
...Ok screw that, I now understand your question.

I'm pretty sure, that the answer is NO. Basing a unit off of the Goblin Land Mine and basing an ability off of LAYING Goblin Land Mines is your best bet. Besides triggers that check every single second if a unit is in the radius of a mine. NO. That would be gay.

So yeah, two answers. Each for seperate situations. Useless. o.O
03-18-2007, 04:36 AM#3
Pyrogasm
You'd need to use the "A unit comes within range of unit" event, but in GUI it would get all wonky-jod.

A JASS version could work fine, though.
03-18-2007, 06:29 PM#4
botanic
is there any way that someone could post something in jass then that I could use or at least so that I can go in the right direction I don't know jass very well
03-18-2007, 07:00 PM#5
Dil999
Just do:
Every .2 seconds
Pick all units in range of (Your unit)
and do
If unit is (whatever conditions u wnat)
Then do
Unit - Explode picked unit
03-18-2007, 07:40 PM#6
Hydrolisk
Not MUI?
03-18-2007, 08:19 PM#7
oNdizZ
then just do another group loop and use picked unit instead of (Your unit)?
03-18-2007, 08:44 PM#8
AKAmrdivine
Code:
explode
    Events
        Unit - A unit comes within 200.00 of YourUnit <gen>
    Conditions
    Actions
        Unit - Explode (Triggering unit)
03-18-2007, 08:45 PM#9
Pyrogasm
This should work; just change the range to change how close a unit must be to explode. If you're not using unit-types, set TempGroup[1] to units with a specific buff, instead.

Trigger:
Collapse Events
Time - Every 0.20 seconds of game-time
Conditions
Collapse Actions
Set TempGroup[1] = Units in (Playable Map Area) matching (Unit-type of (Matching Unit) equal to YOUR UNIT)
Collapse Unit Group - Pick every unit in TempGroup[1] and do (Actions)
Collapse Loop - Actions
Set TempPoint = Position of (Picked Unit)
Set TempGroup[2] = Units within 20.00 of (TempPoint)
Unit Group - Pick every unit in (TempGroup[2]) and do (Unit - Explode (Picked Unit))
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call DestroyGroup(udg_TempGroup[1])
Custom script: call DestroyGroup(udg_TempGroup[2])
03-18-2007, 09:58 PM#10
botanic
Ok this is what I have for the spell so far I just need to add in the exploding part... Can someone help with that please ^.^ I used the mirror image as a base for this spell. All the images will move away from the caster. What I would prefer is if they explode when they stop moving (hit a tree or whatever) however hitting a unit is fine.

Trigger:
Mirror Image Explode
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Deadly [H]allucinations
Collapse Actions
Set MS_Trigger_unit = (Casting unit)
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Wait 0.10 seconds
Trigger - Turn on Mirror Image Explode Copy <gen>
Wait ((Real((Level of Deadly [H]allucinations for MS_Trigger_unit))) x 15.00) game-time seconds
Custom script: call DestroyGroup(udg_MS_Group)
Trigger - Turn off Mirror Image Explode Copy <gen>

Trigger:
Mirror Image Explode Copy
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Set MS_Trigger_unit_loc = (Position of MS_Trigger_unit)
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Unit Group - Remove MS_Trigger_unit from MS_Group
Set TempInteger = (0 + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(MS_Trigger_unit is alive) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in MS_Group and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is an illusion) Equal to True
Collapse Then - Actions
Set MS_Picked_unit_loc[1] = (Position of (Picked unit))
Set MS_Picked_unit_loc[2] = (MS_Picked_unit_loc[1] offset by 15.00 towards (Angle from MS_Trigger_unit_loc to MS_Picked_unit_loc[1]) degrees)
Set MS_Picked_unit_loc[3] = MS_Picked_unit_loc[2]
Unit - Move (Picked unit) instantly to MS_Picked_unit_loc[3]
For each (Integer A) from 1 to 3, do (Custom script: call RemoveLocation(udg_MS_Picked_unit_loc[GetForLoopIndexA()]))
Collapse Else - Actions
Unit - Kill (Picked unit)
Custom script: call RemoveLocation(udg_MS_Trigger_unit_loc)
Custom script: call DestroyGroup(udg_MS_Group)
Else - Actions
03-18-2007, 11:50 PM#11
Pyrogasm
Try this; it should explode the mirror images whenever they come within 20.00 of a unit (changeable). To get them to explode when they reach a destructable, you would need JASS and a pathability check function.

Trigger:
Mirror Image Explode Copy
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Set MS_Trigger_unit_loc = (Position of MS_Trigger_unit)
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Unit Group - Remove MS_Trigger_unit from MS_Group
Set TempInteger = (0 + 1)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(MS_Trigger_unit is alive) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in MS_Group and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is an illusion) Equal to True
Collapse Then - Actions
Set MS_Picked_unit_loc[1] = (Position of (Picked unit))
Set MS_Picked_unit_loc[2] = (MS_Picked_unit_loc[1] offset by 15.00 towards (Angle from MS_Trigger_unit_loc to MS_Picked_unit_loc[1]) degrees)
Set MS_Picked_unit_loc[3] = MS_Picked_unit_loc[2]
Unit - Move (Picked unit) instantly to MS_Picked_unit_loc[3]
Unit Group - Add (Picked Unit) to MS_Explode_Group
For each (Integer A) from 1 to 3, do (Custom script: call RemoveLocation(udg_MS_Picked_unit_loc[GetForLoopIndexA()]))
Collapse Else - Actions
Unit - Kill (Picked unit)
Custom script: call RemoveLocation(udg_MS_Trigger_unit_loc)
Custom script: call DestroyGroup(udg_MS_Group)
Else - Actions
Collapse Unit Group - Pick every unit in MS_Explode_Group and do (Actions)
Collapse Loop - Actions
Set MS_Picked_unit_loc[4] = Position of (Picked Unit)
Set MS_Group = Units within 20.00 of (MS_Picked_unit_loc[4]) matching ((Matching Unit) belongs to an enemy of (Owner of (Picked Unit)))
If (Number of units in MS_group equal 0) then do (Unit - Explode (Picked Unit)), else do (Do Nothing)
Custom script: call RemoveLocation(udg_MS_Picked_unit_loc[4])
Custom script: call DestroyGroup(udg_MS_Group)
Custom script: call GroupClear(udg_MS_Explode_Group)
Note that the last line is "GroupClear", not "DestroyGroup". A couple of other things I noticed:

- You're setting TempInteger = 0+1. Why? It's not used, and just setting it to 1 would be easier.
- Any unit within a 10,000 (ten-thousand) radius of the casting unit that is owned by the owner of the casting unit will be killed.
- You have "MS_Trigger_unit_loc" and "MS_Picked_unit_loc[index]"; couldn't you just combine them into 1 array variable?


If you want the mirror images to be uncontrollable, add this line right after the "Unit Group - Add (Picked Unit) to MS_Explode_Group)" line:
Trigger:
Unit - Pause (Picked Unit)
03-19-2007, 01:51 AM#12
botanic
Ok it works not they die when they hit a unit but I cant get them to be removed when the spell ends. That means that the first trigger doesn't work correctly... here is what I got

Trigger:
Mirror Image Explode
Collapse Events
Unit - A unit Begins casting an ability
Collapse Conditions
(Ability being cast) Equal to Deadly [H]allucinations
Collapse Actions
Set MS_Trigger_unit = (Casting unit)
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Wait 0.10 seconds
Trigger - Turn on Mirror Image Explode Copy <gen>
Wait ((Real((Level of Deadly [H]allucinations for MS_Trigger_unit))) x 15.00) game-time seconds
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Unit Group - Remove MS_Trigger_unit from MS_Group
Collapse Unit Group - Pick every unit in MS_Group and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Custom script: call GroupClear(udg_MS_Group)
Trigger - Turn off Mirror Image Explode Copy <gen>

Trigger:
Mirror Image Explode Copy
Collapse Events
Time - Every 0.05 seconds of game time
Conditions
Collapse Actions
Set MS_Trigger_unit_loc = (Position of MS_Trigger_unit)
Set MS_Group = (Units within 10000.00 of MS_Trigger_unit_loc matching ((Owner of (Matching unit)) Equal to (Owner of MS_Trigger_unit)))
Unit Group - Remove MS_Trigger_unit from MS_Group
Set TempInteger = 1
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(MS_Trigger_unit is alive) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in MS_Group and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Collapse Then - Actions
Set MS_Picked_unit_loc[1] = (Position of (Picked unit))
Set MS_Picked_unit_loc[2] = (MS_Picked_unit_loc[1] offset by 15.00 towards (Angle from MS_Trigger_unit_loc to MS_Picked_unit_loc[1]) degrees)
Set MS_Picked_unit_loc[3] = MS_Picked_unit_loc[2]
Unit - Move (Picked unit) instantly to MS_Picked_unit_loc[3]
Unit Group - Add (Picked unit) to MS_Explode_Group
For each (Integer A) from 1 to 3, do (Custom script: call RemoveLocation(udg_MS_Picked_unit_loc[GetForLoopIndexA()]))
Else - Actions
Custom script: call RemoveLocation(udg_MS_Trigger_unit_loc)
Custom script: call GroupClear(udg_MS_Group)
Else - Actions
Collapse Unit Group - Pick every unit in MS_Explode_Group and do (Actions)
Collapse Loop - Actions
Set MS_Picked_unit_loc[4] = (Position of (Picked unit))
Set MS_Group = (Units within 100.00 of MS_Picked_unit_loc[4] matching (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))
Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 100.00 at MS_Picked_unit_loc[4], dealing 50.00 damage of attack type Spells and damage type Normal
If ((Number of units in MS_Group) Greater than or equal to 1) then do (Unit - Explode (Picked unit)) else do (Do nothing)
Custom script: call RemoveLocation(udg_MS_Picked_unit_loc[4])
Custom script: call GroupClear(udg_MS_Group)
Custom script: call GroupClear(udg_MS_Explode_Group)