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.

Make a creep cast a spell while..

Discussion in 'World Editor Help Zone' started by evjhen, Feb 17, 2018.

  1. evjhen

    evjhen

    Joined:
    Jul 22, 2017
    Messages:
    15
    Resources:
    0
    Resources:
    0
    I want to make a unit cast a spell that is a missile while in combat. This unit has both attack disabled because I want that only attack with the missile. Just like do archers in diablo 2. The point is that I have no idea of how the unit detect the combat while both of his attack are disabled.
     
  2. MadnessTheKey

    MadnessTheKey

    Joined:
    Oct 9, 2017
    Messages:
    116
    Resources:
    0
    Resources:
    0
    What missile ability u gonna use?
     
  3. Licheus

    Licheus

    Joined:
    Apr 18, 2009
    Messages:
    562
    Resources:
    0
    Resources:
    0
    Can you explain how you want the missile to work a bit more and why it's so important that its cast is not based on an attack? Why is it important that it's a missile and not just a spell-type attack with some arcane missile model or something?

    Is it a projectile that fires in a line and deals areal damage at impact? Is it a projectile that works like a standard firebolt without the stun? etc.

    I'd personally code any projectile like this based off of the attack because it makes life easier. I guess you can create systems for combat detection, but how far are you willing to go and have you considered the options? You can set the attack to 0-0 by setting the following fields to zero: Damage Base, Damage Number of Dice and Damage Sides per Die (hold shift and double-click the field to allow negative values). This way you can just use the unit's attack as a trigger for casting a spell.

    Edit: Archers in Diablo 2 fires an arrow towards a target point, right? So the arrow will be a projectile which flies in a direction until it hits something?

    1) Set the unit attack to 0-0
    2) Create a dummy spell which will be cast at the point of the target every time the units attack
    3) Every time the dummy spell is fired, create a dummy unit at the caster facing the target point of the spell being cast. This unit will be your projectile and is added to a unit group for projectiles
    4) Every x seconds, move every unit in the projectile unit group some range in their facing direction. If there are enemies within some range of the new point where the projectile dummy is moved, deal damage to the first unit in range and kill the projectile. Remove the projectile from the dummy group

    Tell me if I understood the missile behaviour right and you want an example map or whatever.
     
    Last edited: Feb 17, 2018
  4. evjhen

    evjhen

    Joined:
    Jul 22, 2017
    Messages:
    15
    Resources:
    0
    Resources:
    0
    Well I have no idea of how to detect combat. However the solution you gave to me seems to work. And yes, your idea of what I was searching from a missile is correct. The missile is already done but I haven't idea of how the creep attack. But now as I said your solution works fine. Sorry if my english is bad.