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. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  4. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  8. 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 cause AI cast custom spells?

Discussion in 'World Editor Help Zone' started by [E]clipse, Apr 17, 2015.

  1. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    Well.....

    I think u what I am gonna ask from the topic
    But still....

    How do I make units cast custom spells using triggers?
     
  2. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
    You have to know which spell you based the custom spell off. For example a custom AoE spell based off Blizzard.
    In triggers, you "Issue order". It's an action in the unit menu. There are many types of issue order actions - for example issue order targeting a point has all spells that target point (= not unit) - e.g. Flamestrike. Then there is issue order targeting a unit - e.g. Fireball. Last is issue order with no target - E.g. Starfall.

    Now you order your unit to cast the spell you based your custom spell off. So if your spell is based off Flamestrike, you order the unit to cast Flamestrike. Flamestrke is a point-target ability, so you won't find it anywhere else. That means you cannot order a unit to cast Flamestrike on specific unit. Same as you cannot order Fireball spell to be cast on a location, etc.
     
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,605
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    There is a order id field for each spell in the object editor. You simply order the unit to cast a spell using that order id with triggers.

    The tricky part is to detect WHEN to cast it. Trust me, it's really advanced and no one will be able to help without writing a bible and a half. There is a (very) simple tutorial that shows to to create an AI with trigger in the tutorial section. Sadly the tutorial is very specific and clearly not good enough for any project unless you want a 3 year old to be able to beat the AI.
     
  4. RobertMKD

    RobertMKD

    Joined:
    Jan 23, 2015
    Messages:
    787
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Just make sure the unit/hero's abilities are not based on same abilities, cause if you try to cast ability A based on a same ability as ability B, it may cast ability B instead of ability A.. there will always be conflict between those two, so make sure you use different base abilities for your spells :)
     
  5. BloodDrunk

    BloodDrunk

    Joined:
    May 11, 2012
    Messages:
    1,963
    Resources:
    1
    Maps:
    1
    Resources:
    1
    By ordering them to cast spell ID that's in your custom spell's orderID.
    Note that if you want quality AI and smart spell casting, you'll have to trigger all the logic, and situations. If you want them to just cast the spell anytime, use trigger which checks when they're attacked or use periodic trigger, check any nearby enemy units and order your AI to cast spell on an attacking unit or picked unit.
     
  6. [E]clipse

    [E]clipse

    Joined:
    Jan 6, 2015
    Messages:
    559
    Resources:
    0
    Resources:
    0
    Oh!! Thanks 2 all of u for making me clear... Thanks . :D