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 haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Rubbed the right way, the genie is out of its lamp! The 12th Concept Art Contest Results have been announced.
    Dismiss Notice
  4. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  5. 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.

[Spell] Increasing and decreasing target unit's attack range

Discussion in 'World Editor Help Zone' started by Saito, Mar 5, 2016.

  1. Saito

    Saito

    Joined:
    Feb 19, 2016
    Messages:
    32
    Resources:
    0
    Resources:
    0
    Hey, I'm making a skill that allows a sniper to take long range attack that deals more damage after spending some time out of combat. The main problem is, that I don't really know how to reduce attack range after taking the shoot. Any ideas?
     
  2. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    962
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You could make the sniper's range upgradeable, by some upgrade, and make that upgrade DECREASE its range. Just set the upgrade's level to 1 when you want to reduce the range, and to 0 when you want to insrease it.
    Or you could make the upgrade GIVE range instead, and keep its level high when you need more range, and reduce the lvl when you need lower range.

    You could give more levels to the upgrade if you want the sniper's range to have more than 2 values.
     
  3. Saito

    Saito

    Joined:
    Feb 19, 2016
    Messages:
    32
    Resources:
    0
    Resources:
    0
    Okay, so this is what I've tried.
    Upgrades: They somehow can't be lowered. Can't make increasing, or decreasing range upgrade and then un-research it. Setting upgrade to lower level with triggers did nothing.
    Aquisition range: I've looked for the way before I posted this, but I coulnd't find it. There was one thread when it was posted that the range is min(aquisition range,attack range). But setting range to 1050 and changing aquisition range with triggers also did nothing.
     
  4. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,427
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    The issue with upgrades is that they can't be unresearched, so you can change attack ranges a fixed number of times.

    @Saito: iirc you can't increase range through triggers, but try setting the unit's default object editor to that super long sniper range, and then reduce his acquisition range after his first shot. When he leaves combat, you can set his acquisition range back to the sniper value.

    Orbs are also a potential solution since they can enable the unit's attack 2.
     
  5. Saito

    Saito

    Joined:
    Feb 19, 2016
    Messages:
    32
    Resources:
    0
    Resources:
    0
    So his base range is 1050 for now. His base aqusition range is 1050 aswell. When the game starts(0.00 game time trigger) his aquisition range is set to 550 and the timer starts. At 5, 10 and 15 seconds of timer he gains another level of 100% critical strike ability and aqusition range is set to 600, 850, 1050. When he attacks his aquisition range is set to 550 and the critical strike is removed.

    And now, he attacks automaticly from aquisition range, but when I order him to smart enemy, he still attacks from range of 1050.

    Also, how to make this with orb effects if it's possible?
     
    Last edited: Mar 5, 2016
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,926
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Not really possible to do in WC3. Acquisition range does not alter attack range outside of the Object Editor where it limits maximum attack range for some reason (possibly some kind of safety net for "stupid" values).
     
  7. Saito

    Saito

    Joined:
    Feb 19, 2016
    Messages:
    32
    Resources:
    0
    Resources:
    0
    I think I've found a way to do it with saving original way the spell works.
    So it goes like this:
    - A channel based active spell(Without "visible" option is possible) with needed range.
    - A trigger making the spell work(The damage calculating, animation of projectile and dealing the damage)
    - A trigger making the spell activate when unit is ordered to "smart" enemy unit in range greater than 550.
    I'm gonna try doing the skill like this for now tho.
     
  8. Zunariel

    Zunariel

    Joined:
    May 21, 2006
    Messages:
    321
    Resources:
    2
    Maps:
    2
    Resources:
    2
    (Read this to the end!) You can make two Upgrades one which increase Range and one which decreases Range for example one which give +1200 range and one which gives -1200 range, now you give them like 1000 Levels each and every time the range should be increased you set the upgrade level +1 and each time you want to decrease it you set the other upgrade level +1 :D

    This definately works in my newest project http://www.hiveworkshop.com/forums/map-development-202/teop-cenarius-return-276321/ you can see it somewhere in the clip I've linked.
     
  9. Wietlol

    Wietlol

    Joined:
    Aug 1, 2013
    Messages:
    4,640
    Resources:
    3
    Spells:
    3
    Resources:
    3
    There are 3 (almost) proper ways to do it.

    1, infinite* upgrades.
    Create 2 upgrades, one to increase range, one to lower range.
    Then you can upgrade them lineary to increase and decrease at will... with the limit of their levels.
    So if you give both upgrades 100 levels, your hero can use this spell 100 times.

    2, shifting unit type.
    With reversed bear form transformation, you can instantly transform a unit with the least issues.
    You create two unit types (in your case 4) and then switch between them.
    The thread that explains instant shifting is named Hero Passive Transformation... but it ofcourse also works as active and on non-heroes... dunno who made that name.

    3, code basic attacks.
    This is the way that will require some serious shit to get it right, but it is rewarding in the end... to possibilities almost noone can get in WC3 modding.
    The basic thing is simple, you design your own way to simulate basic attacks.

    I recommend the second method.
     
  10. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,926
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Has a large impact on loading time so is not really practical.

    That is the closest one can get to changing attack range dynamically. I still would recommend considering another ability or mechanic for the unit which is better supported by the game.
     
  11. DracoL1ch

    DracoL1ch

    Joined:
    Dec 12, 2010
    Messages:
    1,912
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    ^ loading time impace? only if you ignore widgetizing. I have few 9kk levels upgrades in my map.
     
  12. WereElf

    WereElf

    Joined:
    Jan 2, 2016
    Messages:
    962
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Hmm, is it not possible to set upgrade's max level to -1, and then you'll get some really high number as max level?
     
  13. Zunariel

    Zunariel

    Joined:
    May 21, 2006
    Messages:
    321
    Resources:
    2
    Maps:
    2
    Resources:
    2
    The Loading Time is hardly affected by that according to my experience. I have 8 upgrades with 1000 levels. The only thing one should think about is that player properties need an eternity to load when opening it in the editor one should always mind that.