HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Shuriken Throw

07-27-2006, 07:14 PM#1
TGhost
Okay, i need some help or directions, creating an ability.
I want to make an ability wich throws a shuriken, and then damages the first unit hit by this shuriken, even if it is an ally, or even the caster itself. I know this sounds weird but it is because in my map, there is an ability to switch place with someone, and doing so should enable you to turn this shuriken thrown by your enemy into your own weapon, by making them hit themselves. But i will need so directions on how to make this spell. Im using GUI and i would like the spell to be MUI.
I havent made any triggers so far, cause im more trying to get an idea on how to do it. I guess if i want it to be MUI i cant really make a periodic trigger moving it, and if that was doable, how do i detect collision and such. Directions or even examples would be much appreciated.

EDIT: If it is 100% necesary, i might be able to use minor jass, but i havent really had the time to learn jass, since i didnt really like it.
07-27-2006, 08:57 PM#2
The)TideHunter(
If it was in GUI without using Jass, i would create a dummy unit (with the model of the shuriken), order it to move to the target loc, and in another trigger, periodic event, pick every shuriken and if theres a unit within 5-10 range, damage it and remove the shuriken.
07-28-2006, 06:50 AM#3
TGhost
But, when i order it to move, wouldnt the maximum movement speed be 522, or something like that? I want this shuriken to move at something like 700-800 speed, or can that be fully changed with gameplay constants? I will try, thanks.
07-28-2006, 07:04 AM#4
divine_peon
use move unit instantly instead of ordering it to move. not instantly to the target location, i mean. you need to set up a periodic trigger to move the shuriken instantly on an angle near his last position.
07-28-2006, 07:15 AM#5
Jacek
But then you'll have tough MUI problems...

GUI SUX LEARN JASS
07-28-2006, 07:58 AM#6
TGhost
Jacek, i wont, because so far i havent really liked the way jass is, but if i feel like it, i might try it today... but only if i feel like it.
Okay i got a trigger to sorta work. The Shuriken does throw, it does move, it does damage on collision and get removed, it is MUI. But sometimes it sort of malefunctions and flies from behind the caster, into him dealing damage to him? And it wont destroy the trees it flies by.
Here you can have the triggers:
This one Creates the shuriken when the spell is casted:
Trigger:
Shuriken
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Shuriken Throw
Collapse Actions
Set TempPoint[1] = ((Position of (Triggering unit)) offset by 101.00 towards (Angle from (Position of (Triggering unit)) to (Position of (Target unit of ability being cast))) degrees)
Set TempPoint[2] = (Target point of ability being cast)
Unit - Turn collision for (Triggering unit) Off
Unit - Create 1 Shuriken for (Owner of (Triggering unit)) at TempPoint[1] facing TempPoint[2]
Unit Group - Add (Last created unit) to Shurikens
Unit - Add Shuriken Throw to (Last created unit)
Unit - Set level of Shuriken Throw for (Last created unit) to (Level of Shuriken Throw for (Triggering unit))
Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
Unit - Turn collision for (Last created unit) Off
Unit - Turn collision for (Triggering unit) On
Custom script: call RemoveLocation(udg_TempPoint[1])
Custom script: call RemoveLocation(udg_TempPoint[2])
This one moves, detects collision etc.
Trigger:
Move Shurikens
Collapse Events
Time - Every 0.03 seconds of game time
Collapse Conditions
(Number of units in Shurikens) Greater than 0
Collapse Actions
Collapse Unit Group - Pick every unit in Shurikens and do (Actions)
Collapse Loop - Actions
Set TempPoint[2] = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Number of units in (Units in (Region centered at TempPoint[2] with size (100.00, 100.00)) matching ((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to (Picked unit))))) Greater than 0
Collapse Then - Actions
Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 50.00 at TempPoint[2], dealing (100.00 x (Real((Level of Shuriken Throw for (Picked unit))))) damage of attack type Spells and damage type Normal
Collapse Unit Group - Pick every unit in (Units in (Region centered at TempPoint[2] with size (100.00, 100.00)) matching (((Matching unit) is an illusion) Equal to True)) and do (Actions)
Collapse Loop - Actions
Unit - Kill (Picked unit)
Unit - Remove (Picked unit) from the game
Unit Group - Remove (Picked unit) from Shurikens
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Real((Custom value of (Picked unit)))) Less than or equal to 0.00
Collapse Then - Actions
Unit - Remove (Picked unit) from the game
Unit Group - Remove (Picked unit) from Shurikens
Else - Actions
Collapse Destructible - Pick every destructible within 150.00 of TempPoint[2] and do (Actions)
Collapse Loop - Actions
Destructible - Kill (Picked destructible)
Custom script: call RemoveLocation(udg_TempPoint[1])
Custom script: call RemoveLocation(udg_TempPoint[2])
Collapse Else - Actions
Set TempReal = (Facing of (Picked unit))
Set TempPoint[1] = (TempPoint[2] offset by 21.21 towards TempReal degrees)
Unit - Move (Picked unit) instantly to TempPoint[1], facing TempReal degrees
Custom script: call RemoveLocation(udg_TempPoint[1])
Custom script: call RemoveLocation(udg_TempPoint[2])
And this one just removes the shuriken when it dies:
Trigger:
Remove
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Dying unit) is in Shurikens) Equal to True
Collapse Actions
Unit Group - Remove (Dying unit) from Shurikens
I have also attached the map for people to see it for themselves

EDIT: I just discovered a leak, removed it and recopyed the triggers, but the leak still persists in the uploaded map itself, but dont worry, it is gone.
Attached Files
File type: w3xNinja Spell Map.w3x (26.0 KB)
07-28-2006, 10:05 AM#7
karukef
Odd, I actually made an ability called Shuriken for my map that works exactly like you say.

It's in pure Jass however using the CS system collition projectiles. I wont post it since it is too dependant on a lot of my maps auxiliary functions and can't just be copied into your map. And since you don't use JASS you can't learn from it either, so tough luck :)
07-28-2006, 10:20 AM#8
Freakazoid
Quote:
Originally Posted by TGhost
But, when i order it to move, wouldnt the maximum movement speed be 522, or something like that? I want this shuriken to move at something like 700-800 speed, or can that be fully changed with gameplay constants? I will try, thanks.

Lololol, 522 max movespped is in Dota :), to change the max movespeed just change it in under Advance - Gameplay Constants - Unit - Maximum movement speed. And change it to the shurkien. Also add a locut ability so you cant select it.
07-28-2006, 10:31 AM#9
Karawasa
Thought you couldn't go over 522........ Thats a War3 thing not DotA!
07-28-2006, 12:28 PM#10
karukef
You can't go over 522. Freakazoid, please do not post such nonsense.
07-28-2006, 01:01 PM#11
TGhost
okay, since it seems that most people just bitch you, or doesn't even care to response (Notice i said some people, not all), when the problem is in GUI, i have started to learn jass, im pretty far and got alot of understance, i already tryed the "Simple" stomp spell tutorial by Blade, but i can't get it to work, i get 90 compile errors using nothing but the simple version :( It seems like his and my code is identical, but someone mentioned something about a return exploit, and i did create the H2I and such in the custom script of the map. Also now that i have started to learn jass, any help or directions on what i should try to do first and such would be very appreciated. I plan on using jass to make trigger enchanced spells some time in the future, but right now i cant make a very useful spell.

EDIT: Ok, i found the problem in his simple stomp spell court. The spell works now, only problem is that they get pushed back just abit too long . But im starting to get the hang of jass.
EDIT 2: Anyone who would be willing to help me create a Jass MUI shuriken throw spell?