• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

System doesnt Work

Status
Not open for further replies.
Level 33
Joined
Apr 24, 2012
Messages
5,099
Hello,readers.

Im developing a system which allows a dummy to cast something.
Here are the triggers:

Setup

Remove Abil

Target Unit Ex

Target Point Ex

[trigger=]Dummy Caster
Events
Map initialization
Conditions
Actions
Custom script: set udg_DC_Hash = InitHashtable()
-------- ---------------------------- --------
-------- Creating Dummy --------
-------- ---------------------------- --------
Set DC_Loc = (Center of (Playable map area))
Unit - Create 1 Dummy for Neutral Passive at DC_Loc facing Default building facing degrees
Set DC_DummyCaster = (Last created unit)
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call ExecuteFunc("Configuration")
Custom script: endfunction
Custom script: function Encapsulate takes nothing returns nothing
Hashtable - Save DC_AddedAbil as (Key Added Ability) of DC_CastedAbil in DC_Hash
Hashtable - Save DC_Order as (Key Dummy Order) of DC_CastedAbil in DC_Hash
Custom script: endfunction
Custom script: function Configuration takes nothing returns nothing
-------- ---------------------------- --------
-------- Configuration Here --------
-------- ---------------------------- --------
-------- ---------------------------- --------
-------- Storm Bolt orders dummy to cast Banish --------
-------- ---------------------------- --------
Custom script: set udg_DC_CastedAbil = 'AHtb'
Custom script: set udg_DC_AddedAbil = 'AHbn'
Set DC_Order = banish
Custom script: call Encapsulate()
-------- ---------------------------- --------
-------- Thunder Clap orders dummy to cast Carrion Swarm --------
-------- ---------------------------- --------
Custom script: set udg_DC_CastedAbil = 'AHtc'
Custom script: set udg_DC_AddedAbil = 'AUcs'
Set DC_Order = carrionswarm
Custom script: call Encapsulate()
-------- ---------------------------- --------
-------- End of Configuration Here --------
-------- ---------------------------- --------
Custom script: endfunction
-------- ---------------------------- --------
-------- This function resets the dummy caster --------
-------- ---------------------------- --------
Custom script: function DummyCasterReset takes nothing returns nothing
Set DC_Loc = (Center of (Playable map area))
Unit - Move DC_DummyCaster instantly to DC_Loc
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call UnitRemoveAbility(udg_DC_DummyCaster,GetSpellAbilityId())
Custom script: endfunction
-------- ---------------------------- --------
-------- This function orders the dummy caster to target unit --------
-------- Use call ExecuteFunc("OrderDummyCasterTargetUnit") --------
-------- ---------------------------- --------
Custom script: function OrderDummyCasterTargetUnit takes nothing returns nothing
Set DC_Loc = (Position of DC_Caster)
Unit - Move DC_DummyCaster instantly to DC_Loc
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call IssueTargetOrder(udg_DC_DummyCaster,udg_DC_Order,udg_DC_Target)
Custom script: endfunction
-------- ---------------------------- --------
-------- This function orders the dummy caster to target point --------
-------- Use call ExecuteFunc("OrderDummyCasterTargetPoint") --------
-------- ---------------------------- --------
Custom script: function OrderDummyCasterTargetPoint takes nothing returns nothing
Set DC_Loc = (Position of DC_Caster)
Unit - Move DC_DummyCaster instantly to DC_Loc
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call IssuePointOrderLoc(udg_DC_DummyCaster,udg_DC_Order,udg_DC_TargetLoc)
Custom script: endfunction
-------- ---------------------------- --------
-------- This function orders the dummy caster to target destructable --------
-------- This is good for destroying trees --------
-------- Use call ExecuteFunc("OrderDummyCasterTargetDest") --------
-------- ---------------------------- --------
Custom script: function OrderDummyCasterTargetDest takes nothing returns nothing
Set DC_Loc = (Position of DC_Caster)
Unit - Move DC_DummyCaster instantly to DC_Loc
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call IssueTargetDestructableOrder(udg_DC_DummyCaster,udg_DC_Order,udg_DC_TargetDest)
Custom script: endfunction
-------- ---------------------------- --------
-------- This function orders the dummy caster with no target --------
-------- Use call ExecuteFunc("OrderDummyCasterNoTarget") --------
-------- ---------------------------- --------
Custom script: function OrderDummyCasterNoTarget takes nothing returns nothing
Set DC_Loc = (Position of DC_Caster)
Unit - Move DC_DummyCaster instantly to DC_Loc
Custom script: call RemoveLocation(udg_DC_Loc)
Custom script: call IssueImmediateOrder(udg_DC_DummyCaster,udg_DC_Order)
[/trigger]
[trigger=]Remove Abil
Events
Unit - A unit Starts the effect of an ability
Conditions
(Unit-type of (Triggering unit)) Equal to Dummy
Actions
Custom script: call DummyCasterReset()
[/trigger]
[trigger=]Target Unit
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Storm Bolt Ex
Actions
Set DC_Caster = (Triggering unit)
Set DC_Target = (Target unit of ability being cast)
Custom script: set udg_DC_CastedAbil = GetSpellAbilityId()
Set DC_AddedAbil = (Load (Key Added Ability) of DC_CastedAbil from DC_Hash)
Set DC_Order = (Load (Key Dummy Order) of DC_CastedAbil from DC_Hash)
Custom script: call UnitAddAbility(udg_DC_DummyCaster,udg_DC_AddedAbil)
Custom script: call SetUnitAbilityLevelSwapped( udg_DC_AddedAbil , udg_DC_DummyCaster , GetUnitAbilityLevelSwapped(udg_DC_CastedAbil , udg_DC_Caster))
Custom script: call ExecuteFunc("OrderDummyCasterTargetUnit")
[/trigger]
[trigger=]Target Point
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Thunder Clap Ex
Actions
Set DC_Caster = (Triggering unit)
Set DC_TargetLoc = (Position of DC_Caster)
Custom script: set udg_DC_CastedAbil = GetSpellAbilityId()
Set DC_AddedAbil = (Load (Key Added Ability) of DC_CastedAbil from DC_Hash)
Set DC_Order = (Load (Key Dummy Order) of DC_CastedAbil from DC_Hash)
Custom script: call UnitAddAbility(udg_DC_DummyCaster,udg_DC_AddedAbil)
Custom script: call SetUnitAbilityLevelSwapped( udg_DC_AddedAbil , udg_DC_DummyCaster , GetUnitAbilityLevelSwapped(udg_DC_CastedAbil , udg_DC_Caster))
Custom script: call ExecuteFunc("OrderDummyCasterTargetPoint")
Custom script: call RemoveLocation(udg_DC_TargetLoc)
[/trigger]


My problem is that the dummy doesnt follow the orders.

Here is the map:
 

Attachments

I don't have WE on this comp so I'll just give you a list of things you might want to check:
  • First, try giving the dummy unit an actual model. It can be anything. This will let you debug it properly to know whether it has moved, whether it has casted, etc.
  • Make sure the dummy has a cast point of 0.
  • Make sure the dummy has enough mana to cast.
  • Make sure the dummy has enough time to cast.
  • Make sure the dummy has a movement speed of 0 so the cast will be instant. (no turning or w/e)
  • Try running a 0 second timer after the ability finishes before calling the reset function.
 
Status
Not open for further replies.
Back
Top