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.

Mobs using their abilities

Discussion in 'World Editor Help Zone' started by Elemental91, Apr 28, 2014.

  1. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    So, I've been wondering this forever and I see it all the time, but apparently it's not as easy at it looks, because it simply won't work.

    How to make neutral hostile/enemy mobs use their abilities?
    Working on a pretty big RPG project and I really need mobs to use their abilities but I do not know how to do this. :/
     
  2. GreeN!X

    GreeN!X

    Joined:
    Oct 20, 2012
    Messages:
    2,346
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    You can make them use abilities when they're attacked or whenever a timer runs out.

    There's also that field in the OE that allows them to cast autocast abilities if the ability was added in that list.
     
  3. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Is there no way to have them randomly use their abilities, then?

    Only triggered wise, and apparently autocast ?
     
  4. Zwiebelchen

    Zwiebelchen

    Joined:
    Sep 17, 2009
    Messages:
    6,789
    Resources:
    12
    Models:
    5
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    JASS:
    4
    Resources:
    12
    The AI will automaticly use all spells based on how the AI would use the ability the spell is based on.
    However, it will never use channel-based abilities.

    So if you want the AI to autocast spells, make sure they are based on an ability that has the desired AI behaviour.


    If the abilities are channel, you must manually script the AI.
     
  5. GreeN!X

    GreeN!X

    Joined:
    Oct 20, 2012
    Messages:
    2,346
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    You could try something like this:
    • Untitled Trigger 001
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Triggering unit) Equal to (Your hero)
            • (Attacking unit) Equal to (Casting Monster)
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and 100) Less than or equal to 40
          • Then - Actions
            • Issue order to cast spell
          • Else - Actions
     
  6. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Yeah I was thinking about summin like that, thanks guys :)
     
  7. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    I cannot seem to figure out how to order the monster to use custom abilities.
    All I can pick from are some preset hero abilities, but as these units aren't all heroes, that's extremely useless to me atm =/

    Isn't there a way to order units to use a custom spell ?
    In Custom Script if needed D;
     
  8. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    It's easy, create a database/library of abilities then make many triggers or one trigger with different kinds of events and activators to make them cast.

    I suggest using channel.

    I'll make an example for you. =)

    Though it does take time to use it since there is no easy way and having to make conditions for your abilities.
     
  9. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Holy sh... What? o.o;


    Wasn't there a way in which 2 or more abilities would cast simultaneously ?
    I remember it being something in the abilities editor giving 2 abilities the same to turn on..?
     
  10. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    You asked how to make the AI cast their own abilities right? If you use the standard almost AI ones then it could somewhat work without requiring you to re-trigger everything however war stomp only works with 3+ units for example.

    call IssueTargetOrderBJ( null, "invisibility", null ) That is what this looks like Unit - Order No unit to Human Sorceress - Invisibility No unit.
    You could try messing around with the JASS version however I don't know of a way so if there is one without making a massive library of abilities then I would as well appreciate anyone sharing their knowledge of it. Though you could just use normal ability checks and normal ability orders though it is slower and looks quite bad. Why use channel is for its versatility. Able to change your order string is quite the useful feature it provided for everyone.

    Yes though you could give two abilities however some don't double-cast such as blink or blizzard because they're point targets while warstomp and thunderclap would both cast I think because of no-target or point order.
     
  11. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    I don't get why they made it so difficult to let neutral/enemy monsters/units use custom abilities...
    How do they do it in all those RPG maps etc ?
     
  12. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    Usually like warstomp and common spells then ordering them anyways or using what I suggested. Some even do timers and randomizing such as impossible bosses I think or well It sure looked like it.

    Take for example firebolt, it only takes one unit. Do you still want an example or do you want to take the easier way?
    We could wait for someone to suggest something else though you know.

    GreeN!x has a good understanding of it and showed you a method.

    Hope this may provide some insight into your problem. http://www.hiveworkshop.com/forums/...m-v2-2-4-a-211823/?prev=search=ai&d=list&r=20

    Sadly Blizzard made it really hard on us GUI'ers, since I never bothered with abilities themselves much I am not sure if it is impossible or not for something else from what I have typed besides hashtables.
     
  13. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Again, made for the blizzard skills =(

    For example I'm trying to get a random mob to cast sleep, either as autocast or as a random chance when attacked, but neither is working, as there is simply no way in the trigger editor to have a unit cast "custom spell sleep"

    And seeing as it's an RPG map, I'm going to need many more monster skills, both for random monsters, mini bosses and bosses.
     
  14. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    I don't see what your issue is or the problem your facing. . .
    Yeah RPG's need lots.

    Why is there no way for a unit to cast custom sleep? Re-check before assuming.
     

    Attached Files:

  15. _MB_

    _MB_

    Joined:
    Jan 5, 2014
    Messages:
    79
    Resources:
    0
    Resources:
    0
    Is it really so hard?

    I guess you based your custom sleep spell on the normal sleep spell.
    There were also some talks about the spell being cast with some chance on an autoattack.

    So lets have unit A with the spell and unit B which attacks unit A.

    Event would be:
    Unit A is attacked

    Condition
    Random integer between 1 and 100 is lower than 70 (unit A will try to cast the spell in 70 percent of the cases when it is attacked)

    Action:
    (I persume you didn't change the order field for the spell in the editor)
    Order Unit A to Undead - Lich - Sleep the Unit B (or a random unit in 300 radius or whatever, be aware of leaks)
    (I use the Issue an order targeting a unit, I am not sure with the "Undead - Lich - Sleep" part, but it is something simmilar and you will surely find it there)

    I have to admit that I guess that the problem is more complicated coz so lot has been written here and I think my solution is too simple, yet I try
     
  16. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,709
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    This might be helpful for you: Link
    There is a demo map how to make use of blizzard's standarts in order to fire custom abilities.

    Keep in mind that most of these base abilities are fired as a response of i.e damage and not out of the blue.

    If you need a more intelligent creep behaviour, you'll have to write or use an AI System.
     
  17. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Haven't tested your link yet, but I'm not assuming, I have been trying for a while and cannot find a way.
    And like I said before, it's not just sleep I need, it's a wide array of custom abilities that need to work.


    This doesn't seem to work, even if you base it off the Hero Sleep spell.


    This seems promising, but in this list it says base ability Sleep should be cast by AIs... weird, cause it doesn't
     
  18. _MB_

    _MB_

    Joined:
    Jan 5, 2014
    Messages:
    79
    Resources:
    0
    Resources:
    0
    kinda interesting, for me it works perfectly

    in the attached map just learn the sleep ability with the dreadlord and than, when the ghoul attacks the dreadlord the dreadlord immidiately casts the sleep on the ghoul
     

    Attached Files:

  19. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,468
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
    You really should have tried my test-map instead of denying everyone trying to help you.
     
  20. Elemental91

    Elemental91

    Joined:
    Dec 3, 2012
    Messages:
    117
    Resources:
    0
    Resources:
    0
    Don't get me wrong, please, I am definitely not denying anyone trying to help me without reason.

    I have tested your map and I see it does indeed work, but it did not for me, so forgive me for being skeptical.
    So if I understand this correctly, the copied Sleep ability needs to remain a Hero ability for this to work?


    I never doubted that casting Dreadlord - Sleep using triggers would work with an actual Dreadlord hero with the Sleep ability.

    What I'm trying is to get normal units (non heroes) to be able to cast abilities