OnFinishNeutralize

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
ARCTroopaNate
Jedi
Jedi
Posts: 1161
Joined: Mon Mar 21, 2011 8:12 pm
Projects :: Star Wars Battlefront - Tides of War
Games I'm Playing :: SWBF2 RC EAW
xbox live or psn: I have ps4
Location: STALKER!
Contact:

OnFinishNeutralize

Post by ARCTroopaNate »

Hi folks. I'm trying to set up messages that display when a team captures a command post and when one is neutralized. The capture message works fine but nothing happens when a post is neutralized. What am I missing?? Thanks friends.
Hidden/Spoiler:
OnFinishNeutralizeTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_imp_lost") -- Show this string to all teams
end,
1 -- Team number for the strings (don't forget to change me)
)

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_all_cap") -- Show this string to all teams
end,
1 -- Team number for the strings (don't forget to change me)
)

OnFinishNeutralizeTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_all_lost") -- Show this string to all teams
end,
2 -- Team number for the strings (don't forget to change me)
)

OnFinishCaptureTeam(
function(cPost)
local pName = GetEntityName(cPost) -- Gets the name of the post that was captured

ShowMessageText("level.end1." .. pName .. "_imp_cap") -- Show this string to all teams
end,
2 -- Team number for the strings (don't forget to change me)
)
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: OnFinishNeutralize

Post by AnthonyBF2 »

I think you need to remove Team from the end of OnFinishNeutralize
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: OnFinishNeutralize

Post by Marth8880 »

AnthonyBF2 wrote:I think you need to remove Team from the end of OnFinishNeutralize
Yep. However, if you do want the callback to only be executed when a certain teams finishes neutralizing a CP, you'd change it to OnFinishNeutralizeTeam.
Post Reply