[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > World Editor Help Zone


World Editor Help Zone Ask general questions about World Editor features and use in this forum. If you need help fixing a trigger, please post it in Triggers & Scripts. Please review the forum rules before posting.

Closed Thread
 
Thread Tools
Old 09-04-2009, 06:35 AM   #1 (permalink)
Registered User Killd0zer
Recoloring ninja.
 
Killd0zer's Avatar
 
Join Date: Jun 2009
Posts: 194
Killd0zer has little to show at this moment (29)Killd0zer has little to show at this moment (29)Killd0zer has little to show at this moment (29)
Need some more help......

I want to make a spell that causes the targeted units to be blasted backwards, I can do most of it but one part: It needs to some how get the opposite angle from the point I target (its AoE)

For Example, I target an area and an unit affected is directally south of the center of the targeted area, the unit needs to be moved from the center point, but I can't seem to find a way to do this,

I set the center as a variable, but How do I then set a point thats behind the targeted unit at the right angle?


Center Is here * Unit here * thrown back here*


Unit here*

thrown here *

(Distences are not right Just showing what I mean, If you need more info, please ask :))
Killd0zer is offline  
Old 09-04-2009, 08:50 AM   #2 (permalink)
Forum Moderator Maker
I...make things
 
Maker's Avatar
Resource Moderator
 
Join Date: Mar 2006
Posts: 7,585
Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)
Temp_Loc_1 = Caster's position
Temp_Loc_ 2= Point of ability being cast/ Position of unit of ability being cast
Temp_Real = Angle between Temp_Loc_1 and Temp_Loc_2

In another trigger

Every 0.03 seconds

Temp_Loc_1 = Unit's position
Temp_Loc_ 2= Temp_Loc 1 offset by x.xx towards Temp_Real (point with polar offset)
Move unit instantly to Temp_Loc_2
Maker is offline  
Old 09-04-2009, 12:21 PM   #3 (permalink)
Registered User Killd0zer
Recoloring ninja.
 
Killd0zer's Avatar
 
Join Date: Jun 2009
Posts: 194
Killd0zer has little to show at this moment (29)Killd0zer has little to show at this moment (29)Killd0zer has little to show at this moment (29)
thanks a ton, I spent a good 30 minutes just trying to get it but for some reason, not being able to.
Killd0zer is offline  
Old 09-04-2009, 01:37 PM   #4 (permalink)
Forum Moderator Maker
I...make things
 
Maker's Avatar
Resource Moderator
 
Join Date: Mar 2006
Posts: 7,585
Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)Maker has a reputation beyond repute (2473)
Let me know what you think of this:

trigger
Ability X
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Pushback
Actions
-------- Area of effect --------
Set Temp_Real_1 = (150.00 + (50.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
-------- How far units get pushed back. Base + level upgrade. --------
Set Temp_Real_2 = (400.00 + (50.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
-------- Damage of the spell. base + level upgrade --------
Set Temp_Real_3 = (100.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
Set Temp_Loc_1 = (Target point of ability being cast)
-------- -------------------- --------
Set Temp_Group = (Units within Temp_Real_1 of Temp_Loc_1 matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is alive) Equal to True))))
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Set Temp_Loc_2 = (Position of (Picked unit))
-------- -------------------- --------
Set Temp_Real_4 = (Angle from Temp_Loc_1 to Temp_Loc_2)
Unit - Cause (Triggering unit) to damage (Picked unit), dealing Temp_Real_3 damage of attack type Hero and damage type Magic
-------- -------------------- --------
Unit - Pause (Picked unit)
Unit Group - Add (Picked unit) to Ability_X_Group
-------- -------------------- --------
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Tornado\Tornado_Target.mdl
-------- -------------------- --------
Hashtable - Save 0.00 as (Key loop) of (Key (Picked unit)) in Abitlity_X_Hash
Hashtable - Save 0.00 as (Key offset) of (Key (Picked unit)) in Abitlity_X_Hash
Hashtable - Save Temp_Real_2 as (Key range) of (Key (Picked unit)) in Abitlity_X_Hash
Hashtable - Save Temp_Real_4 as (Key angle) of (Key (Picked unit)) in Abitlity_X_Hash
Hashtable - Save Handle Of(Last created special effect) as (Key eff) of (Key (Picked unit)) in Abitlity_X_Hash
-------- -------------------- --------
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
Special Effect - Destroy (Last created special effect)
-------- -------------------- --------
Custom script: call RemoveLocation(udg_Temp_Loc_2)
-------- -------------------- --------
Trigger - Turn on Ability Knockback <gen>
-------- -------------------- --------
Custom script: call DestroyGroup(udg_Temp_Group)
Custom script: call RemoveLocation(udg_Temp_Loc_1)


trigger
Ability Knockback
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Ability_X_Group and do (Actions)
Loop - Actions
Set Temp_Loc_1 = (Position of (Picked unit))
Set Temp_Real_1 = (Load (Key loop) of (Key (Picked unit)) from Abitlity_X_Hash)
Set Temp_Real_2 = (Load (Key angle) of (Key (Picked unit)) from Abitlity_X_Hash)
Set Temp_Real_3 = (Load (Key offset) of (Key (Picked unit)) from Abitlity_X_Hash)
Set Temp_Real_4 = (Load (Key range) of (Key (Picked unit)) from Abitlity_X_Hash)
-------- -------------------- --------
Set Temp_Real_1 = (Temp_Real_1 + 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Real_3 Less than Temp_Real_4
Then - Actions
Set Temp_Real_3 = (Temp_Real_3 + ((Temp_Real_4 x 0.12) x (Power(0.90, Temp_Real_1))))
Set Temp_Real_5 = ((Temp_Real_4 x 0.12) x (Power(0.90, Temp_Real_1)))
Set Temp_Loc_2 = (Temp_Loc_1 offset by Temp_Real_5 towards Temp_Real_2 degrees)
-------- -------------------- --------
Unit - Move (Picked unit) instantly to Temp_Loc_2
-------- -------------------- --------
Set Temp_Integer_1 = (Random integer number between 1 and 4)
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Integer_1 Equal to 1
Then - Actions
Unit - Make (Picked unit) face ((Facing of (Picked unit)) - 180.00) over 0.00 seconds
Else - Actions
Else - Actions
Unit - Unpause (Picked unit)
Set Temp_Effect = (Load (Key eff) of (Key (Picked unit)) in Abitlity_X_Hash)
Special Effect - Destroy Temp_Effect
Unit Group - Remove (Picked unit) from Ability_X_Group
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Abitlity_X_Hash
-------- -------------------- --------
Hashtable - Save Temp_Real_1 as (Key loop) of (Key (Picked unit)) in Abitlity_X_Hash
Hashtable - Save Temp_Real_3 as (Key offset) of (Key (Picked unit)) in Abitlity_X_Hash
-------- -------------------- --------
Custom script: call RemoveLocation(udg_Temp_Loc_1)
Custom script: call RemoveLocation(udg_Temp_Loc_2)
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in Ability_X_Group) Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Attached Files
File Type: w3x test.w3x (17.4 KB, 10 views)
Maker is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 07:03 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle