Login

russian armor

SCAR Ability Help

21 Jan 2016, 20:39 PM
#1
avatar of oblivion8

Posts: 5

Hi!

After scouring the internet, I have found that looking for documentation on using SCAR script has been quite disappointing. Among my issues is the fact that, for example, I wasn't able to find any clear guide or list on how to implement the Player_AddAbility function. I wasn't sure whether to just take the name from the game or whether it required any special syntax.

So if anyone can please offer some guidance as to a clear and definitive way to do what I need to do, it would be much appreciated.

This is the script I have so far:



function OnInitID()

for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)

Player_CompleteUpgrade(player, BP_GetUpgradeBlueprint("Recon_Sweep"))
Player_AddAbility(player, BP_GetAbilityBlueprint("Recon_Sweep"))
Modify_AbilityMunitionsCost(player, BP_GetAbilityBlueprint("Recon_Sweep"), -60)

end

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end




I created this using a forum's content that I was able to find. However it doesn't quite do what I want.

1) When specifying a player, I realize I could use World_GetPlayerAt function to find the player at a certain spawn. However I am unsure whether that player spot needs to be filled or whether, for example, I can specify to give the ability to players 1, 2 and 3, whether or not those players are in the game or not.

2) I was able to implement Recon Sweep by just using the name, however when I tried to input "P47_Strafing_Run" instead, it came up as a critical SCAR error in the game. How am I supposed to type the name of the ability I wish to give?

3) I saw on the SCAR Documentation page that you can edit the munition costs, recharge and duration etc... of an ability, and while the above munition cost reduction works, I also would like to change the Command Point cost so it's available immediately. Is there a way to do this? And if so, is there a way to do it so that the only ability affected is the one I give the player and not, for example, someone who takes the Tactical Support Company (who comes with Recon Sweep)?

4) The next step, after figuring out the above is to allow the players who've received the ability the restriction to only use it once. A one time use kind of thing, given at the beginning of the match. Is this difficult or possible?


Thank you so much to whoever can help me, I'm working on a D-Day inspired beach assault map. I've placed mines on the beach head but want to give a one time use strafing run ability to even up the teams.

Cheers!
22 Jan 2016, 21:06 PM
#2
avatar of oblivion8

Posts: 5

Bump.

Anyone who can answer any of these questions, it would be much appreciated.

I've included what my script is now, trying to account for choosing certain players to give the ability to, but I'm more familiar with C# than Lua, and have no idea why it's not working...


function OnInitID()

if World_GetPlayerAt(4) != nil then
local player4 = World_GetPlayerAt(4)
Player_CompleteUpgrade(player4, BP_GetUpgradeBlueprint("Recon_Sweep"))
Player_AddAbility(player4, BP_GetAbilityBlueprint("Recon_Sweep"))
Modify_AbilityMunitionsCost(player4, BP_GetAbilityBlueprint("Recon_Sweep"), -60)

end

if World_GetPlayerAt(5) != nil then
local player5 = World_GetPlayerAt(5)
Player_CompleteUpgrade(player5, BP_GetUpgradeBlueprint("Recon_Sweep"))
Player_AddAbility(player5, BP_GetAbilityBlueprint("Recon_Sweep"))
Modify_AbilityMunitionsCost(player5, BP_GetAbilityBlueprint("Recon_Sweep"), -60)

end


if World_GetPlayerAt(6) != nil then
local player6 = World_GetPlayerAt(6)
Player_CompleteUpgrade(player6, BP_GetUpgradeBlueprint("Recon_Sweep"))
Player_AddAbility(player6, BP_GetAbilityBlueprint("Recon_Sweep"))
Modify_AbilityMunitionsCost(player6, BP_GetAbilityBlueprint("Recon_Sweep"), -60)

end

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]

end
1 user is browsing this thread: 1 guest

Livestreams

Germany 2

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

299 users are online: 1 member and 298 guests
Esxile
2 posts in the last 24h
34 posts in the last week
140 posts in the last month
Registered members: 45566
Welcome our newest member, Moutr391
Most online: 2043 users on 29 Oct 2023, 01:04 AM