Login

russian armor

Adding commander abilities

10 Mar 2014, 19:26 PM
#1
avatar of LizardKing

Posts: 4

I've been working on a silly - and horribly unbalanced - comp stomp map, and have managed to get a few things working so far (a "training school" that adds xp to units inside in exchange for fuel and munitions, a fuel point that reduced CPU fuel intake to 0 when captured), but I can't appear to add commander abilities. I'd like to let everyone build arty, or call in nice tanks, regardless of commander choice.

I tried using Player_SetAbilityAvailability as noted in this guide, except with ITEM_UNLOCKED, yet it does not seem to work. Is there a limit of 5 abilities built into the UI? Would other abilities need to be removed first? Is there something else wrong with how I'm doing it? Janne252 says they have managed to add abilities in the comments after the guide, so clearly such a thing is feasible somehow.

As an aside, how on earth do you search these forums? I can only see those whacky filters at the bottom, which didn't help much.
10 Mar 2014, 19:29 PM
#2
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Player_AddAbility(player, abp)
10 Mar 2014, 19:47 PM
#3
avatar of LizardKing

Posts: 4

Player_AddAbility(player, abp)


Ah, I assume that's one of the new commands, since I didn't see it listed in ScarDoc.

I just tried it, and while it doesn't crash or give me an error, it doesn't appear to be working either. Are there any limitations on it? I'm just calling it in the same fashion as in the guide. I also tried adding it slightly later (via oneshot) in case choosing a commander overwrote it, but that still didn't add anything.
Code
[blah blah oninitid]

local _vehicleAbilities = {
"tiger_tank", "elefant_unlock", "cmd_isu-152", }

for key, abp in ipairs(_vehicleAbilities) do
Player_AddAbility(World_GetPlayerAt(1), BP_GetAbilityBlueprint(abp))
end

10 Mar 2014, 19:54 PM
#4
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

I'm not 100% sure but commander abilities might be protected against this. Try adding a non-commander global ability for the player. You could take a look at the SP mission scripts for finding an ability like this as SP missions don't use commanders.
10 Mar 2014, 20:01 PM
#5
avatar of LizardKing

Posts: 4

I'm not 100% sure but commander abilities might be protected against this. Try adding a non-commander global ability for the player. You could take a look at the SP mission scripts for finding an ability like this as SP missions don't use commanders.


Ah, that must be it. Adding the SP sniper call-in worked. Bummer. I guess I can see what useful SP ones I can add, and try and replicate the rest with scripts. Thanks.
10 Mar 2014, 22:46 PM
#6
avatar of Srinidhalaya

Posts: 357

Interesting concept...but I think they would have locked this down, so that people who haven't paid for certain commanders, cannot get their abilities...
19 Apr 2014, 12:51 PM
#7
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Update: Nope, they are not blocked. All commander abilities can be added for the player and then executed. Even cross-army.
27 Apr 2014, 10:20 AM
#8
avatar of LizardKing

Posts: 4

Update: Nope, they are not blocked. All commander abilities can be added for the player and then executed. Even cross-army.


I don't know if that was changed in an update and then removed again, but I just tried it and it still doesn't work.

On a related note, is there a way to remove an ability? I'd like to add an ability, have it targeted at a pre-determined location, and then remove it again. I tried simply not giving the player the ability in the first place and just have the script force its use, but that just throws an error about the player not having that ability.
26 May 2014, 11:21 AM
#9
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

It still works - it's just a complex procedure to unlock an ability. It is also possible to block them as well.

Basically you need:
Player_AddAbility to add the ability for the player
Player_CompleteUpgrade the upgrade the ability requires
Player_SetAbilityAvailabilityInternal for forcing it to be available (not necessary most of the time)

For blocking the ability:
use Player_SetAbilityAvailabilityInternal with ITEM_REMOVED
1 user is browsing this thread: 1 guest

Livestreams

unknown 50
unknown 37
United States 3

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

739 users are online: 739 guests
0 post in the last 24h
5 posts in the last week
33 posts in the last month
Registered members: 49143
Welcome our newest member, Spdcderry
Most online: 2043 users on 29 Oct 2023, 01:04 AM