• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Toss (unit check)

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
I am trying to make a skill nearly same as the one in dota. (Toss of Tiny)
Toss part works but i also need to make an unit-check trigger. What does this unit-check thing do? At the "unit casts an ability" state, it counts the units in 200 range around caster and puts the calculated number into variable X; so my other trigger checks; if X=0 then orders caster to stop for preventing unnecessary mana loss and cd time. But it doesn't act like that. Actually it does nothing =) So:
1-) How do i stop casting if no unit is available around caster?
2-) How do i send UI message "No unit found to toss etc etc.."
By UI message i mean the ones "Must target an enemy unit" "Not Eneough Gold" kind of things..
 
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Toss
  • Actions
    • Set Point1 = (Target point of ability being cast)
    • Set Tgroup = (Units within 200.00 of Point1 matching ((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) and ...)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in Tgroup) Greater than 0
      • Then - Actions
        • //Make the ability's effect actions
      • Else - Actions
        • Game - Display to (Player Group(Owner of (Triggering unit))) the text: "No unit found to toss."
    • Custom script: call RemoveLocation (udg_Point1)
    • Custom script: call DestroyGroup (udg_Tgroup)
 
Yep, like swipe5weep said, they are based on channel. Once Sven's spell is cast, a missile is created towards the target unit. If the distance between the missile and the target is less than or equal to 10.00, then remove the missile and pick every unit within 200.00 range of the missile, create a dummy unit for each nearby enemy and order it to Human Mountain King - Storm Bolt the enemy (Picked) unit.
 
Level 8
Joined
Mar 26, 2009
Messages
301
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Toss
  • Actions
    • Set Point1 = (Target point of ability being cast)
    • Set Tgroup = (Units within 200.00 of Point1 matching ((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) and ...)
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of units in Tgroup) Greater than 0
      • Then - Actions
        • //Make the ability's effect actions
      • Else - Actions
        • Game - Display to (Player Group(Owner of (Triggering unit))) the text: "No unit found to toss."
    • Custom script: call RemoveLocation (udg_Point1)
    • Custom script: call DestroyGroup (udg_Tgroup)
*
Excuse me; but caster checks for units around himself, not at target location. I made Toss with 2 triggers (one containing basic commands, other handling the movement task) So; my first trigger works with "Unit starts the effect of an ability" event. I created a 3rd trigger goes like this:
Unit - A unit Begins casting an ability
Creat group, apply matching conditons and perform a real check blah blah.. It didn't work. About your suggestion:
1-) When made with "starts the effect of an ability" you cannot prevent mana reduction and the skill from going to cd.
2-) The next methord you suggest does not show the message like those error mesages (ex: Must target an enemy unit.)
3-) Again, caster will check the number of units around him, not at target location =)
 
Meh, then switch the "Target point of ability being cast" to "Position of (Triggering unit)". Big deal :p

For the other part:
  • One
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set hs = (Last created hashtable)
  • Two
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Toss
    • Actions
      • Set Point1 = (Position of (Triggering unit))
      • Set Tgroup = (Units within 200.00 of Point1 matching ((Matching unit) belongs to an enemy of (Owner of (Triggering unit)) and ...)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Tgroup) Equal to 0
        • Then - Actions
          • Game - Display to (Player Group(Owner of (Triggering unit))) the text: "No unit found to toss."
          • Unit - Order (Triggering unit) to Stop
          • Hashtable - Save (Level of (Ability being cast) for (Triggering unit)) as (Key lvl) of (Key (Triggering unit)) in hs
          • Unit - Remove (Ability being cast) from (Triggering unit)
          • Unit - Add Toss to (Triggering unit)
          • Unit - Set level of Toss for (Triggering unit) to (Load (Key lvl) of (Key (Triggering unit)) from hs)
          • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + (15.00 x (Real((Load (Key lvl) of (Key (Triggering unit)) from hs)))))
          • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in hs
        • Else - Actions
          • //Spell effect here.
      • Custom script: call RemoveLocation (udg_Point1)
      • Custom script: call DestroyGroup (udg_Tgroup)
This will prevent cooldown and mana cost.
The mana cost I used was 15/30/45. Up to the mana cost you add to your unit, make sure you get the right formula.
 
Level 8
Joined
Mar 26, 2009
Messages
301
Hastables, eh? Just what i've been runnig away for not to see :p
Ok, i have one flawlessly working Toss trigger. I made another trigger ike this one:
(Since the "dummy" skill of hero is based on Cloud; i used "begins channeling")

  • Unit - A unit Begins channeling an ability
  • (Ability being cast) Equal to Toss
  • Set Toss_Potential_Grabable_Units = (Units within 200.00 of (Position of (Triggering unit)) matching ((((Matching unit) is A structure) Not equal to True) and ((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is dead) Not equal to True))))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in Toss_Potential_Grabable_Units) Equal to 0
    • Then - Actions
      • Unit - Order (Triggering unit) to Stop
      • Custom script: call DestroyGroup (udg_Toss_Potential_Grabable_Units)
    • Else - Actions
      • Custom script: call DestroyGroup (udg_Toss_Potential_Grabable_Units)
Still it does not work; what exactly is wrong here? I want to do this simple way; "begins channeling/casting ability" refers to the time just before skill is launched; so i should be able to prevent skill to go into cd with correct triggering =)
 
I've already answered your question and I have tested it. A) I don't know why you did it this way, when I clearly showed the trigger you must follow and B) I don't understand why did you use a channeling spell in the first place. Use Channel as the base ability or Blizzard (with number of shards to 0 -> Use Shift+Enter to type and retain the 0 value).

Edit: http://www.hiveworkshop.com/forums/pastebin.php?id=iqr6ji

Firstly cast Banish on you (with no units around) and it will not work; then head towards the enemies and recast it: it will work.
 
Last edited:
Level 8
Joined
Mar 26, 2009
Messages
301
It was made before i opened this topic and i wanted to complete what i've started rather than beginning from scratch.
  • Game - Display to (Player Group(Owner of (Triggering unit))) the text: "No unit found to toss."
I am telling this the 3rd time; this does not show up as UI message.
And I don't see any technical diffrence between Cloud and Blizzard either..
And there is certainly nothing such as i "must" follow anything...
 
Status
Not open for further replies.
Top