edited August 2015 in ORK Scripting
like the title says how would i go about using an ability from script. i.e. if i write my own ai and want them to attack using an ability i have set up with in ork to make use of your damage dealers. or if i do something like add the base attack on the damage dealer and always keep it on so when the damage dealer hits the target i can deactivate it for a a second the reactivate it again ? not sure if this method will work either so figured id ask.
Post edited by wtyson on
new website can be found here http://www.fore-loregames.com

Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Once you've got the AbilityShortcut of the ability, (e.g. through functions in the combatant's ability handler, combatant.Abilities), you can use this function to start the ability:

    AbilityShortcut ability = combatant.Abilities.Get(int id);
    ability.Use(Combatant user, List<Combatant> targets, bool useAction);


    id is the index/ID of the ability.
    user is the user combatant, targets is a list of target combatants, useAction being true means that it will use an action and animate everything, otherwise it'll just use the calculation.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited August 2015
    do i need variables for user and targets? also will this work for base attack to?
    Post edited by wtyson on
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • User is needed, targets can also be an empty list. This works also for base attacks, but you need to get the base attack ability from the combatant (there's a different function for that).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • and that function is? :p sorry any time i try to use the api i can never get it to work correctly thats why i ask here instead
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • AbilityShortcut ability = combatant.Abilities.GetBaseAttack(ref int id);
    ability.Use(Combatant user, List<Combatant> targets, bool useAction);

    like this?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Basically, yes - but you need to remove the class/parameter types (int, Combatant, etc.).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • decided to use a custom separate damage system for the ai just to make things simpler and more streamlined since im writing the ai out in c#. just have to get the attack 100% of the time instead of 40% of the time atm. Thanks though, sorry i didnt update this earlier !
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
Sign In or Register to comment.