SC2Mapster Forums

Development > AI Development

How to make my unit to use his abi

  • 10 posts
    #1 Sep 30, 2012 at 14:15 UTC - 0 likes

    I has custom unit with custom abilities, but he never cast them. Is there any AI trigger action which will cause my unit to cast abilities? Or another way?

    #2 Sep 30, 2012 at 14:50 UTC - 0 likes

    You need to set autocast range for the ability and check the "autocast is on" flag.

    #3 Sep 30, 2012 at 15:06 UTC - 0 likes

    Already tried it. But it looks not good when hero has all abilities as auto-cast... thats why I need normal ability.

    #4 Sep 30, 2012 at 15:34 UTC - 0 likes

    It depends on what you want. Are the AI units supposed to react with certain abilities? I haven't used the data module but with triggers there are ways to check when you want the units to use particular abilities and tell units which abilities to use.

    Current Project: SquadCraft 2
    Project Page
    Feedback Thread
    Latest Video
    Published Regions: SEA, NA, EU, KOR
    Status: Open Beta

    #5 Sep 30, 2012 at 15:37 UTC - 0 likes

    Try to add an autocast validator for each ability. Validator of "number of behavior x = 0".

    Each ability will have its own validator and own behavior. And each ability will apply its behavior on the the caster. Behavior duration time will be equal to ability's recharge time.

    For example: you have 3 abilities (A1, A2, A3) and 3 behaviors (B1, B2, B3).

    A1 applies B1 to caster. A2 applies B2 to caster. A3 applies B3 to caster.

    A1 autocast validator is "number of B1 = 0"
    A2 autocast validator is "number of B2 = 0"
    A3 autocast validator is "number of B3 = 0"

    The idea is simple: unit can only have 1 autocasted ability, but after the cast happens, its autocast become temporarily disabled, and unit kinda switches to another ability to autocast. I'm not sure it will work, but worth a try.

    #6 Sep 30, 2012 at 15:57 UTC - 0 likes

    @Zolden: Go

    Interesting. I think that could work if the unit waits until all ability behaviours are attached then clear them all to repeat the cycle. Before they're all attached there could be a randomising effect to pick abilities using the corresponding validators.

    #7 Sep 30, 2012 at 17:45 UTC - 0 likes

    Facepalm to all. As I said no need autocast, no need couple of trash behaviors and no need triggers... cus ai uses blizzard abilities when I add "Start ai for player" trigger action, but my custom abilities ai not wana to use.

    #8 Oct 24, 2012 at 19:53 UTC - 0 likes

    what kind of ability it is an train ability an cast ability an smart cast ability an target require ability an area ability ?

    and is the unit you use turnable ? if it is not turnable you must made the arc on the ability 360

    Last edited Oct 24, 2012 by rikky333

    sorry for some bad English i m dyslectic :(

    #9 Nov 20, 2012 at 09:17 UTC - 0 likes

    It active ability like psi storm, blink, etc. I've created Tactical Ai Data, Target Finds and Tactical Ai Cooldown in the Data editor for my hero. Added trigger which starts campaign ai for the owner of my hero. But it not works(

    #10 Feb 23, 2013 at 14:39 UTC - 0 likes

    No idea if this might help, but in each effect there is an AI flag containing options like "help friend" or "hurt enemy". The abilities themselves have an option "AI Notify Effect".

    Never tried that, but might help!

  • 10 posts

You must login to post a comment. Don't have an account? Register to get one!