- Joined
- Apr 5, 2009
- Messages
- 18
So this is what its supposed to do:
The targeted hero is tied up to the nearest object within 250 range, whether its a tree, a unit, or a building.
If there are no units, trees, or buildings the targeted hero will be ensnared.
Currently the effects are all over the place. From my tests, the code in the destructible and "no units, tree or building" part is sound a.k.a the beginning and end are fine. Just the massive bulk in the middle is riddled with bugs that i cannot seem to see.
I think the bug(s) have/has got to do with detecting whether or not the system has picked up a "nearest unit" and how it stores this info. Anyway, please and thank you.
Warning: Following is a massive wall of code
…
The targeted hero is tied up to the nearest object within 250 range, whether its a tree, a unit, or a building.
If there are no units, trees, or buildings the targeted hero will be ensnared.
Currently the effects are all over the place. From my tests, the code in the destructible and "no units, tree or building" part is sound a.k.a the beginning and end are fine. Just the massive bulk in the middle is riddled with bugs that i cannot seem to see.
I think the bug(s) have/has got to do with detecting whether or not the system has picked up a "nearest unit" and how it stores this info. Anyway, please and thank you.
Warning: Following is a massive wall of code
-
Tie em up
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Tie em up!
-
-
Actions
-
Unit - Kill TieemupDummy
-
Unit - Kill TieemupDummy2
-
Set TieemupUnitCaster = (Casting unit)
-
Set TieemupTarget = (Target unit of ability being cast)
-
Set TieemupPositionZ = (Position of TieemupTarget)
-
Destructible - Pick every destructible within 250.00 of (Position of TieemupTarget) and do (Actions)
-
Loop - Actions
-
Set TieemupNearestDoodad = (Picked destructible)
-
Set TieemupPositionX = (Position of TieemupNearestDoodad)
-
-
-
Destructible - Pick every destructible within 250.00 of (Position of TieemupTarget) and do (Actions)
-
Loop - Actions
-
Set TieemupPositionY = (Position of (Picked destructible))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between TieemupPositionZ and TieemupPositionY) Less than (Distance between TieemupPositionZ and TieemupPositionX)
-
-
Then - Actions
-
Set TieemupNearestDoodad = (Picked destructible)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_TieemupPositionY)
-
-
-
Unit - Create 1 Tie em up! Dummy for (Owner of TieemupUnitCaster) at (Position of TieemupNearestDoodad) facing Default building facing degrees
-
Set TieemupDummy = (Last created unit)
-
Unit - Order TieemupDummy to Human Dragonhawk Rider - Aerial Shackles TieemupTarget
-
Custom script: call RemoveLocation(udg_TieemupPositionX)
-
Custom script: call RemoveLocation(udg_TieemupPositionZ)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TieemupNearestDoodad Equal to No destructible
-
-
Then - Actions
-
Set TieemupNearestUnit = (Random unit from (Units within 250.00 of (Position of TieemupTarget) matching (((Matching unit) Not equal to TieemupTarget) and (((Matching unit) belongs to an enemy of (Owner of TieemupUnitCaster)) Equal to True))))
-
Set TieemupPositionX = (Position of TieemupNearestUnit)
-
Unit Group - Pick every unit in (Units within 250.00 of (Position of TieemupTarget)) and do (Actions)
-
Loop - Actions
-
Set TieemupPositionY = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between TieemupPositionZ and TieemupPositionY) Less than (Distance between TieemupPositionZ and TieemupPositionX)
-
-
Then - Actions
-
Set TieemupNearestUnit = (Picked unit)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_TieemupPositionY)
-
-
-
Unit - Create 1 Tie em up! Dummy for (Owner of TieemupUnitCaster) at (Position of TieemupNearestUnit) facing Default building facing degrees
-
Set TieemupDummy = (Last created unit)
-
Unit - Order TieemupDummy to Human Dragonhawk Rider - Aerial Shackles TieemupTarget
-
Unit - Create 1 Tie em up! Dummy for (Owner of TieemupUnitCaster) at (Position of TieemupTarget) facing Default building facing degrees
-
Set TieemupDummy2 = (Last created unit)
-
Unit - Order TieemupDummy2 to Human Dragonhawk Rider - Aerial Shackles TieemupNearestUnit
-
Custom script: call RemoveLocation(udg_TieemupPositionX)
-
Custom script: call RemoveLocation(udg_TieemupPositionZ)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
TieemupNearestUnit Equal to No unit
-
-
Then - Actions
-
Unit - Create 1 Tie em up! Dummy for (Owner of TieemupUnitCaster) at (Position of TieemupTarget) facing Default building facing degrees
-
Unit - Order TieemupDummy to Orc Raider - Ensnare TieemupTarget
-
Set TieemupDummy = (Last created unit)
-
-
Else - Actions
-
Do nothing
-
-
-
-
-
Set TieemupNearestDoodad = No destructible
-
Set TieemupNearestUnit = No unit
-
-