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.
Adding commander abilities
10 Mar 2014, 19:26 PM
#1
Posts: 4
10 Mar 2014, 19:29 PM
#2
5
Posts: 3421 | Subs: 11
Player_AddAbility(player, abp)
10 Mar 2014, 19:47 PM
#3
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
5
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
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
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
5
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
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
5
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
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
PAGES (1)
1 user is browsing this thread:
1 guest
Livestreams
50 | |||||
37 | |||||
3 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.35057.860+15
- 3.1110614.644+11
- 4.620224.735-2
- 5.276108.719+27
- 6.306114.729+2
- 7.919405.694+3
- 8.262137.657+3
- 9.722440.621+4
- 10.1041674.607-2
Replay highlight
VS
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Einhoven Country
Honor it
9
Download
1236
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
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
Welcome our newest member, Spdcderry
Most online: 2043 users on 29 Oct 2023, 01:04 AM