• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

GUI Dummcaster 1.0

description

triggers

examples

This is dummycaster system that uses one caster for most abilities, this does not include channeling abilities or abilities with a casting time greater then 0.00. It uses the instant cast method(i have no idea who came up with it) along with a structure(this is what enables it to cast point and target spells instantly, because structures don't turn.)
  • GUI DummyCaster
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: call ExecuteFunc("InitDummycaster")
      • Custom script: endfunction
      • -------- --------
      • Custom script: function DummyCaster_OrderCast takes nothing returns boolean
      • -------- --------------------------------------------------------- --------
      • -------- checking to see if you are using a point as where to move the spellcaster --------
      • -------- --------------------------------------------------------- --------
      • Custom script: if udg_Dummy_From_Loc != null then
      • -------- --------------------------------------------------------- --------
      • -------- making it use XY coords because they are faster --------
      • -------- --------------------------------------------------------- --------
      • Custom script: set udg_Dummy_FromX=GetLocationX(udg_Dummy_From_Loc)
      • Custom script: set udg_Dummy_FromY=GetLocationX(udg_Dummy_From_Loc)
      • -------- --------------------------------------------------------- --------
      • -------- Removing Leaks,WARNING if you set this = to anothing point variable that point varible won't work --------
      • -------- because that location has been destroyed --------
      • -------- --------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_Dummy_From_Loc)
      • Custom script: set udg_Dummy_From_Loc = null
      • Custom script: endif
      • -------- --------------------------------------------------------- --------
      • -------- Moving the Spellcaster to the desired location --------
      • -------- --------------------------------------------------------- --------
      • Custom script: call SetUnitX(udg_Dummycaster,udg_Dummy_FromX)
      • Custom script: call SetUnitY(udg_Dummycaster,udg_Dummy_FromY)
      • -------- --------------------------------------------------------- --------
      • -------- Adding the ability --------
      • -------- --------------------------------------------------------- --------
      • Custom script: call UnitAddAbility(udg_Dummycaster,udg_Dummy_to_cast)
      • Unit - Change ownership of Dummycaster to Dummy_WhichPlayer and Retain color
      • -------- --------------------------------------------------------------------- --------
      • -------- checking to see if you are targeting a location --------
      • -------- --------------------------------------------------------------------- --------
      • Custom script: if udg_Dummy_Target_Point != null then
      • -------- --------------------------------------------------------------------- --------
      • -------- casting on that location --------
      • -------- --------------------------------------------------------------------- --------
      • Custom script: call IssuePointOrderLoc(udg_Dummycaster,udg_Dummy_Order,udg_Dummy_Target_Point)
      • -------- --------------------------------------------------------- --------
      • -------- Removing Leaks,WARNING if you set this = to anothing point variable that point varible won't work --------
      • -------- because that location has been destroyed --------
      • -------- --------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_Dummy_Target_Point)
      • Custom script: set udg_Dummy_Target_Point = null
      • Custom script: else
      • -------- ----------------------------------------------------- --------
      • -------- Here i wish that GUI could use widgets instead, as it would be a whole lot easier. --------
      • -------- ----------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Dummy_Target_Unit Not equal to No unit
        • Then - Actions
          • -------- ----------------------------------------------------- --------
          • -------- Casting on a unit --------
          • -------- ----------------------------------------------------- --------
          • Custom script: call IssueTargetOrder(udg_Dummycaster,udg_Dummy_Order,udg_Dummy_Target_Unit)
          • Custom script: set udg_Dummy_Target_Unit = null
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Dummy_Target_Destructable Not equal to No destructible
            • Then - Actions
              • -------- ----------------------------------------------------- --------
              • -------- Casting on a destructable --------
              • -------- ----------------------------------------------------- --------
              • Custom script: call IssueTargetOrder(udg_Dummycaster,udg_Dummy_Order,udg_Dummy_Target_Destructable)
              • Custom script: set udg_Dummy_Target_Destructable = null
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Dummy_Target_Item Not equal to No item
                • Then - Actions
                  • -------- ----------------------------------------------------- --------
                  • -------- Casting on a item --------
                  • -------- ----------------------------------------------------- --------
                  • Custom script: call IssueTargetOrder(udg_Dummycaster,udg_Dummy_Order,udg_Dummy_Target_Item)
                  • Custom script: set udg_Dummy_Target_Item = null
                • Else - Actions
                  • -------- --------
                  • -------- this is the easiest way to check if it is a Location targeting spell and you are using xy coords --------
                  • -------- if it isn't a spell that targets ground, it won't cast --------
                  • -------- I put at the end because there are some spells(like mass teloport) that target ground and units --------
                  • -------- --------
                  • Custom script: if not IssuePointOrder(udg_Dummycaster,udg_Dummy_Order,udg_Dummy_TargetX,udg_Dummy_TargetY) then
                  • -------- ----------------------------------------------------- --------
                  • -------- Instant Casting --------
                  • -------- ----------------------------------------------------- --------
                  • Custom script: call IssueImmediateOrder(udg_Dummycaster,udg_Dummy_Order)
                  • Custom script: endif
      • Custom script: endif
      • Unit - Change ownership of Dummycaster to Neutral Extra and Retain color
      • Custom script: call UnitRemoveAbility(udg_Dummycaster,udg_Dummy_to_cast)
      • Custom script: set udg_Dummy_WhichPlayer = null
      • Custom script: return false
      • Custom script: endfunction
      • -------- ------------------------------------ --------
      • -------- this is the initialization trigger --------
      • -------- ------------------------------------ --------
      • Custom script: function InitDummycaster takes nothing returns nothing
      • Custom script: set udg_Dummycaster = CreateUnit(Player(15),'hwtw',0,0,0)
      • Unit - Hide Dummycaster
      • Custom script: call UnitAddAbility(udg_Dummycaster,'Aloc')
      • Custom script: call DestroyTrigger(gg_trg_GUI_DummyCaster)
      • Custom script: set gg_trg_GUI_DummyCaster = CreateTrigger()
      • Custom script: call TriggerAddCondition(gg_trg_GUI_DummyCaster,Condition(function DummyCaster_OrderCast))
  • UnitTarget
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FireStorm
    • Actions
      • Custom script: local unit target = GetSpellTargetUnit()
      • Custom script: local real x= GetUnitX(target)
      • Custom script: local real y= GetUnitY(target)
      • Custom script: local player p = GetTriggerPlayer()
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: set udg_Dummy_Target_Unit= target
          • Custom script: set udg_Dummy_FromX=Cos(bj_forLoopAIndex*36)*400+x
          • Custom script: set udg_Dummy_FromY=Sin(bj_forLoopAIndex*36)*400+y
          • Custom script: set udg_Dummy_WhichPlayer = p
          • Set Dummy_Order = firebolt
          • Set Dummy_to_cast = Firebolt (Neutral Hostile)
          • Trigger - Run GUI DummyCaster <gen> (checking conditions)
      • Custom script: set target = null
      • Custom script: set p = null
  • CoordTarget
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to shower
    • Actions
      • Custom script: local real x=GetUnitX(GetTriggerUnit())
      • Custom script: local real y= GetUnitY(GetTriggerUnit())
      • Custom script: local player p = GetTriggerPlayer()
      • Custom script: set udg_Dummy_FromX=Cos(bj_forLoopAIndex*36)*400+x
      • Custom script: set udg_Dummy_FromY=Sin(bj_forLoopAIndex*36)*400+y
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: set udg_Dummy_TargetX=Cos(bj_forLoopAIndex*36)*400+x
          • Custom script: set udg_Dummy_TargetY=Sin(bj_forLoopAIndex*36)*400+y
          • Custom script: set udg_Dummy_WhichPlayer = p
          • Set Dummy_Order = rainoffire
          • Set Dummy_to_cast = Rain of Fire (Neutral Hostile 1)
          • Trigger - Run GUI DummyCaster <gen> (checking conditions)
      • Custom script: set p = null
Keywords:
dummycaster,one,singular,instant,target,point
Contents

GUI Spellcaster (Map)

Reviews
15:33, 17th Nov 2012 Magtheridon96: Approved. This is easy to use and coded decently. You don't really need to null Dummy_WhichPlayer at the end of the function though.

Moderator

M

Moderator

15:33, 17th Nov 2012
Magtheridon96: Approved.
This is easy to use and coded decently.

You don't really need to null Dummy_WhichPlayer at the end of the function though.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
- Whats the use of the Dummy_From_Loc?, also why dont you just make an example of a location cast since the system casted on a location, not coordinates...
- You should put in the description that the point/cast backswing should be 0, cooldown/cast is 0...
- Remove the dummy's ability >>> 'Amov'
- I think t's best do do a channeling for this, see my http://www.hiveworkshop.com/forums/submissions-414/snippet-muidummycasters-211663/index2.html on how it's done...
 
Level 7
Joined
Jan 28, 2012
Messages
266
- Remove the dummy's ability >>> 'Amov'
why? I use a structure, does removing amov do the same thing that using a structure does? ie eliminate the units ability to turn.

- Whats the use of the Dummy_From_Loc?
they can use it instead of from_x/y

also why don't you just make an example of a location cast since the system casted on a location, not coordinates.
I probably should, btw my example used xy coordinates not a location.

- I think t's best do do a channeling for this, see my [Snippet] MuiDummyCasters on how it's done...
I have looked at that, but this does everything except channeling spells with one unit, though I might make it use one for each player(for scoring). The main purpose of this casting system is for buffing units, if you think I should support channeling spells I will.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
why? I use a structure, does removing amov do the same thing that using a structure does? ie eliminate the units ability to turn.
Serously, Idk that the hwtw is a structure until I opened the map, but yeah it does the same thing...

they can use it instead of from_x/y
GUI'ers will not be familiar with that, I suggest to use locations alone...

if you think I should support channeling spells I will
Moderators told me that if it can be modular then do it, but anyway it's just my suggestion, there's nothing wrong not to follow it :)...
 
Top