Login

russian armor

Auto casting / toggling abilities with cool-downs.

18 Aug 2016, 03:07 AM
#1
avatar of Moocats

Posts: 71

Hey all.

I'm getting to grips quite well with the COH Mod tools and learning my way around at least the basic to intermediate stuff but I'm having some issues with how abilities work. When I use the word ability I refer to things such as off map arty or unit call-in's/dispatching units.

Here is an example, lets say I want the game to automatically call in a KV-1 tank, cool down for 5 mins then call in another one with no interaction from the player or AI. How would one do this?

I find setting the ability_bag / activation = always_on will simply override any attempts at a cool down timer. So in the example used above the game would simply non stop summon KV-1's until your game crashed. That said, if one was to set that to = timed. Then player/AI interaction would be required to activate the ability by way of clicking on a button or something. Is what I want to do here even possible?

Another question again related to my confusion with abilities. I'd like you all to think back to when the British Advanced Emplacements Commander was first introduced. Back then if one was to turn on the counter battery ability it would remain on unless you turned it off. So ability_bag / activation = toggle. BUT if you did disengage the ability for counter battery then there would be a cool-down before you could toggle it on once more. Again, how? I can't quite figure this out.


Many thanks for any help provided.
-Kane
18 Aug 2016, 12:07 PM
#2
avatar of Planet Smasher
Senior Modmaker Badge

Posts: 632 | Subs: 1

jump backJump back to quoted post18 Aug 2016, 03:07 AMMoocats
Here is an example, lets say I want the game to automatically call in a KV-1 tank, cool down for 5 mins then call in another one with no interaction from the player or AI. How would one do this?

I find setting the ability_bag / activation = always_on will simply override any attempts at a cool down timer. So in the example used above the game would simply non stop summon KV-1's until your game crashed. That said, if one was to set that to = timed. Then player/AI interaction would be required to activate the ability by way of clicking on a button or something. Is what I want to do here even possible?

Your best option is probably making an always_on ability that contains an interval_action!

jump backJump back to quoted post18 Aug 2016, 03:07 AMMoocats
Another question again related to my confusion with abilities. I'd like you all to think back to when the British Advanced Emplacements Commander was first introduced. Back then if one was to turn on the counter battery ability it would remain on unless you turned it off. So ability_bag / activation = toggle. BUT if you did disengage the ability for counter battery then there would be a cool-down before you could toggle it on once more. Again, how? I can't quite figure this out.

I'm pretty sure there is a variable for this somewhere in the ability_bag, but I can't look it up right now. Have a good look again!
18 Aug 2016, 17:56 PM
#3
avatar of Moocats

Posts: 71

Hey Planet Smasher, I appreciate the response.

The problem with using an always_on type is that it seems impossible to place the ability into a buildings UI in that mode. I need to be able to have the visual cue there in the building of how long is left in the recharge time.

Another problem is with interval_action. Using this will override the visual cool-down effect on the UI.

I'm pretty sure to maintain the UI effects needed here it needs to stay on type = timed. I had been browsing through the action_list to see if there's something that resembles auto triggering but nothing is jumping out at me.

-Kane
19 Aug 2016, 18:04 PM
#4
avatar of Planet Smasher
Senior Modmaker Badge

Posts: 632 | Subs: 1

No problem! First of all, I found the answer to your second question:

jump backJump back to quoted post18 Aug 2016, 03:07 AMMoocats
Another question again related to my confusion with abilities. I'd like you all to think back to when the British Advanced Emplacements Commander was first introduced. Back then if one was to turn on the counter battery ability it would remain on unless you turned it off. So ability_bag / activation = toggle. BUT if you did disengage the ability for counter battery then there would be a cool-down before you could toggle it on once more. Again, how? I can't quite figure this out.

The variable you need to use for this is "toggled_recharge_time_off" in the ability_bag.

jump backJump back to quoted post18 Aug 2016, 17:56 PMMoocats
The problem with using an always_on type is that it seems impossible to place the ability into a buildings UI in that mode. I need to be able to have the visual cue there in the building of how long is left in the recharge time.

Another problem is with interval_action. Using this will override the visual cool-down effect on the UI.

I'm pretty sure to maintain the UI effects needed here it needs to stay on type = timed. I had been browsing through the action_list to see if there's something that resembles auto triggering but nothing is jumping out at me.

It might not be possible to achieve exactly what you want with the Attribute Editor. A somewhat cheap workaround I can think of right now would be making a "dummy" toggle ability to show an icon, as used for passive commander abilities, and making another ability containing three actions:

1. reinforcements_action: Used to call in one KV-1 right at the beginning of the match.
2. delay_action containing a copy of that reinforcements_action with a five minute timer and "progress_bar" set to True: For the second KV-1 after five minutes.
3. interval_action calling a copy of that delay_action every five minutes: For another KV-1 every five minutes after that.

You could give this ability to the HQ, for example, to have the tanks move there.

A more elegant solution might be possible with SCAR, but I can't help you with that. Sorry!
19 Aug 2016, 21:16 PM
#5
avatar of Moocats

Posts: 71

Thanks for getting back to me once again P/S.

Your suggestion is very similar to what I have done as it happens. This is the construction of my..lets just call it a "runtime" I'll only mark relevant settings. For the sake of reference we'll name this ability"ABKS1"

ability_bag
-activation = always_on
-action_list
--start_target_actions / interval_action (15 sec) / int_sub_actions / actions / delay (15 sec)
/ delayed_action / reinforcement_action = sbps/Kv1Tank


This will spawn a KV1 Tank 15 seconds into the game, then spawn another 15 seconds later, then another and so on.

I didn't want one at match start as these are intended to not trigger in the mod I'm working on for a good 10 mins and longer depending on the unit types.

In your suggestion though you mentioned setting progress_bar to "true" wouldn't that be redundant with an ability that is set to always_on as these ability types can't display UI icons?

speaking of UI, that's now where my remaining problem lies with this.

I had the same idea about using a dummy group. I did indeed create one to provide UI indications. We'll call this ability ABKS2.

The method I tried is to set ABKS2 as activation=timed and set the recharge to 15 seconds with initial_recharge set to true. This means at the game start the timer will start counting down 15 seconds. The next part was to make sure that timer restarted every 15 seconds, and this is where I ran into problems. We already know that with a timed ability we can't make it auto trigger. The player needs to click the UI button.

Genius then struck, or so I thought. I went back to ABKS1, our first ability.

I added the following to the following part;

-action_list
--start_target_actions / interval_action (15 sec) / int_sub_actions / actions / delay (15 sec) / reset_ability_recharge_action = ABKS2.

I thought that would be all sorted. Sadly, "reset" in this context seems to mean stop, not restart. So as soon as my ability ABKS1 triggers and the unit spawns the cooldown on ABKS2 stops. Perfectly timed I might add but it doesn't restart the cooldown. back to the drawing board on that part it seems.
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

719 users are online: 719 guests
7 posts in the last 24h
22 posts in the last week
136 posts in the last month
Registered members: 45032
Welcome our newest member, lanawatt
Most online: 2043 users on 29 Oct 2023, 01:04 AM