1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

How to create units in a line

Discussion in 'World Editor Help Zone' started by makeranj, Oct 9, 2016.

  1. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    how to create units in a line, like fissure from DOTA and make them damage enemies?
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,167
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Depending on what you're using:
    native CreateUnit takes player id, integer unitid, real x, real y, real face

    • Unit - Create 1 <whatever> for Player 1 at <location> facing Default building facing degrees


    To damage enemies it depends how you want to do that. One time? Multiple times? DoT? Other conditions? You could use dummy units with Permanent Immolation (base on item version) to do the damage but the right unit won't get kill credit and the damage isn't very easily configured that way. Need more details.
     
  3. Kyrbi0

    Kyrbi0

    Joined:
    Jul 29, 2008
    Messages:
    7,907
    Resources:
    1
    Models:
    1
    Resources:
    1
    Simple.

    Haven't played DotA in forever, but give the Hero a simple point-target dummy spell (does nothing), then use a Trigger to create a special Dummy Caster (with Movespeed equal to however fast you want the 'line' to move).

    Give this DC a custom ability based off of "Factory" (not "Pocket Factory"), of which you can modify the spawn-rate, life-time, and unit-type of unit summoned. In the same Trigger that you created him, Order the DC to Move to the Target Point of Ability Being Cast.

    To make them damage, either give them a modified Permanent Immolation (as Pyrogasm suggested, though the issue of buff-stacking is raised), or alternatively, give them timed life/-hp regen & a modified "AoE Explode On Death" ability.
     
  4. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Take a look at this...

    • Untitled Trigger 023
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Fissure
      • Actions
        • Set TempUnit = (Triggering unit)
        • Set TempPoint = (Position of TempUnit)
        • Set TempPoint2 = (Target point of ability being cast)
        • Set TempReal = (Angle from TempPoint to TempPoint2)
        • Custom script: set udg_TempGroup = CreateGroup()
        • For each (Integer TempInteger) from 1 to 10, do (Actions)
          • Loop - Actions
            • Set TempPoint3 = (TempPoint offset by (someDistance x (Real(TempInteger))) towards TempReal degrees)
            • Unit - Create 1 FissurePiece for (Owner of TempUnit) at TempPoint3 facing Default building facing degrees
            • Unit - Add a X second Generic expiration timer to (Last created unit)
            • Set TempGroup = (Units within someRange of TempPoint3)
            • Unit Group - Pick every unit in TempGroup and do (Actions)
              • Loop - Actions
                • Set TempUnit2 = (Picked unit)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (TempUnit2 belongs to an enemy of (Owner of TempUnit)) Equal to True
                    • (TempUnit2 is in TempGroup) Equal to False
                    • // Other Conditions
                  • Then - Actions
                    • Unit Group - Add TempUnit2 to TempGroup
                    • Unit - Cause TempUnit to damage TempUnit2, dealing someDamage damage of attack type Spells and damage type Normal
                  • Else - Actions
            • Custom script: call RemoveLocation(udg_TempPoint3)
            • Custom script: call DestroyGroup(udg_TempGroup2)
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call RemoveLocation(udg_TempPoint2)
        • Custom script: call DestroyGroup(udg_TempGroup)



    So what's happening here is:

    Unit casts the spell
    We save their position
    We save their target position
    We use these two points to find the angle to make the wall along.

    We create a group so units can be added to it and not damaged by multiple "pieces"

    The Loop from 1 to 10 is an example of a distance, it could be longer or shorter.
    Inside the loop we create a piece of the fissure at each offset so its basically a "line" of units. The someDistance is how close together these units should be.

    It then creates a piece of the fissure, you add a generic expiration to the unit so it dies when the duration of the spell should end.

    Each time a piece of the fissure spawns, we want to check around the unit to deal damage to it. So we create a group and search for acceptable targets. If you want it to stun, you'd probably create a unit before this loop and have that dummy do all the stunning rather than creating one per unit.

    We add the unit to the tempgroup so it is not damaged/stunned more than once.

    Rest is removing leaks.
     
    Last edited: Oct 9, 2016
  5. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    one time only, right after spellcast
     
  6. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,167
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Do what pOke suggested.
     
  7. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    ok, thank you for the help.
     
  8. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    thank you! it helped me, but does it only summon three fissurepieces? like 0= fissure: C=Caster: C 0 0 0 looks like these.it has gaps. But much appreciated, thank you again :)
     
  9. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    ok no thanks, i've figured it out.
     
  10. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    If you want it to stun, you'd probably create a unit before this loop and have that dummy do all the stunning rather than creating one per unit.
    i don't really understand how to do this.
     
  11. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    So I've done some more testing and coding for it. Take a look at the test map and see if its to your liking.

    trigger
    • Fissure
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Fissure
      • Actions
        • Set TempUnit = (Triggering unit)
        • Set TempPlayer = (Owner of TempUnit)
        • Set TempPoint = (Position of TempUnit)
        • Set TempPoint2 = (Target point of ability being cast)
        • Set TempReal = (Angle from TempPoint to TempPoint2)
        • Custom script: set udg_TempGroup = CreateGroup()
        • For each (Integer TempInteger) from 1 to 10, do (Actions)
          • Loop - Actions
            • Set TempPoint3 = (TempPoint offset by (100.00 x (Real(TempInteger))) towards TempReal degrees)
            • Unit - Create 1 Fissure Piece for TempPlayer at TempPoint3 facing (Facing of TempUnit) degrees
            • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
            • Unit - Create 1 Path Blocker Dummy for TempPlayer at TempPoint3 facing (Facing of TempUnit) degrees
            • Custom script: call SetUnitX(bj_lastCreatedUnit, GetLocationX(udg_TempPoint3))
            • Custom script: call SetUnitY(bj_lastCreatedUnit, GetLocationY(udg_TempPoint3))
            • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
            • Set TempGroup2 = (Units within 100.00 of TempPoint3)
            • Unit Group - Pick every unit in TempGroup2 and do (Actions)
              • Loop - Actions
                • Set TempUnit3 = (Picked unit)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (TempUnit3 belongs to an enemy of (Owner of TempUnit)) Equal to True
                    • (TempUnit3 is in TempGroup) Equal to False
                  • Then - Actions
                    • Unit Group - Add TempUnit3 to TempGroup
                    • Unit - Create 1 Generic Dummy for (Owner of TempUnit3) at TempPoint3 facing Default building facing degrees
                    • Set TempUnit4 = (Last created unit)
                    • Unit - Add Fissure Stun to TempUnit4
                    • Unit - Set level of Fissure Stun for TempUnit4 to (Level of Fissure for TempUnit)
                    • Unit - Add a 1.00 second Generic expiration timer to TempUnit4
                    • Unit - Order TempUnit4 to Human Mountain King - Storm Bolt TempUnit3
                    • Unit - Cause TempUnit to damage TempUnit3, dealing (100.00 x (Real((Level of Fissure for TempUnit)))) damage of attack type Spells and damage type Normal
                  • Else - Actions
            • Custom script: call RemoveLocation(udg_TempPoint3)
            • Custom script: call DestroyGroup(udg_TempGroup2)
        • Custom script: call RemoveLocation(udg_TempPoint)
        • Custom script: call RemoveLocation(udg_TempPoint2)
        • Custom script: call DestroyGroup(udg_TempGroup)
     

    Attached Files:

  12. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    yeah,, i'll try it. uhh how do i make a unit move to a specific distance?, also damaging anything it passes
     
  13. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,167
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Unit - move UNIT to LOCATION
    Or SetUnitX() and SetUnitY()

    To damage, check out what pOke did-- get a group of the units in range and use the "Unit - Cause UNIT to damage UNIT for X damage of attack type spells and damage type normal" command like he did.
     
  14. makeranj

    makeranj

    Joined:
    Aug 29, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    ok