No message when a frigate is destroyed

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
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

No message when a frigate is destroyed

Post by Executer94 »

I added some more frigate to my space map but I am not sure whether I edited the lua right, because when I am playing ingame and a frigate is destroyed the game doesnt tell me like "We lost a frigate" you know...

Here is my lua guys maybe you can see what I did wrong:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("BOZc_cmn")

ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")
ScriptCB_DoFile("LinkedShields2")

myGameMode = "BOZ_CW-Assault"

function myScriptInit()

end

function ScriptPreInit()

SetMemoryPoolSize ("ClothData",150)



SetWorldExtents(5000)

end

function ScriptPostLoad()
SetupObjectives()

SetupShields()
SetupDestroyables()
SetupTurrets()
SetupShields2()

AddAIGoal(REP, "Deathmatch", 20)
AddAIGoal(CIS, "Deathmatch", 20)

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"TeleportNode")
end,
"TeleportRegion"
)
ActivateRegion("TeleportRegion")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Telenode")
end,
"port"
)
ActivateRegion("port")



end

function SetupObjectives()
assault = ObjectiveSpaceAssault:New{
teamATT = REP, teamDEF = CIS,
multiplayerRules = true
}

local repTargets = {
engines = { "cis_tank1", "cis_tank2", "cis_tank4", "cis_tank3", "cis_tank40", "cis_tank30" },
lifesupport = "cis-life-ext1",
bridge = "cis-bridge",
comm = {"cis-comms1", "cis-comms2", "cis-comms40", "cis-comms4", "cis-comms3"} ,
sensors = "cis-sensors",
frigates = {"cis_frigate1", "cis_frigate2", "cis_frigate21"},
internalSys = { "cis-life-int", "cis-engines" },
}

local cisTargets = {
engines = { "rep_tank41", "rep_tank42"},
lifesupport = "rep-life-ext", "rep_assultship_destruct_lifesupport_mini",
bridge = "rep-bridge",
comm = "cis-comms410", "cis-comms41" ,
sensors = "rep-sensors",
frigates = {"rep_frigate50", "blockaderunner", "rep_prop_consular2", "rep_prop_consular1", "rep_prop_consular", "pelta", "pelta0"} ,
internalSys = { "rep-life-int", "rep-engines" },
}


assault:SetupAllCriticalSystems( "rep", repTargets, true )
assault:SetupAllCriticalSystems( "cis", cisTargets, false )

assault:Start()
end

function SetupShields()
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1", "cis_ship_2", "cis_ship_3", "cis_ship_4",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end






-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate2", "cis-comms4", "cis_tank3", "cis_tank4"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator2"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end




-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate21", "cis-comms40", "cis_tank30", "cis_tank40"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator3"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end







-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate1", "cis-comms3", "cis_tank1", "cis_tank2"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator1"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end


function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end


end


function SetupShields2()

-- REP Shielded objects
local linkedShieldObjectsREP = { "pelta", "cis-comms41"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator2"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end

-- REP Shielded objects
local linkedShieldObjectsREP = { "rep_frigate50", "rep_assultship_destruct_lifesupport_mini", "rep_tank41", "rep_tank42"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end




-- REP Shielded objects
local linkedShieldObjectsREP = { "pelta0", "cis-comms410"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator20"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end



end

function SetupDestroyables()
--CIS destroyables
lifeSupportLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis-life-int"}, {"cis-life-ext"}} }
lifeSupportLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_bldg_frigateturretobj10", "cis_bldg_frigateturret760", "cis_bldg_frigateturretobj0", "cis_bldg_frigateturret750", "cis_bldg_frigateturret740", "cis_bldg_frigateturret710", "cis_bldg_frigateturret0", "cis_bldg_frigateturret770", "cis_bldg_frigateturretobj30", "cis_bldg_frigateturretobj20", "cis_bldg_frigateturretobj60", "cis_bldg_frigateturretobj50", "cis_bldg_frigateturretobj40", "muni_cp1", "muni_generator1", "cis-comms3", "cis_tank1", "cis_tank2", "cis_bldg_frigateturret20", "cis_bldg_frigateturret810"}, {"cis_frigate1"}} }
engineLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"muni_generator2", "cis-comms4", "cis_bldg_frigateturretx", "cis_tank4", "cis_tank3"}, {"cis_frigate2"}} }
engineLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"muni_generator3", "cis-comms40", "cis_bldg_frigateturretq", "cis_tank30", "cis_tank40"}, {"cis_frigate21"}} }
engineLinkageCIS:Init()


engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_bldg_frigateturret15", "cis_bldg_frigateturret16", "cis_bldg_frigateturret11", "cis_bldg_frigateturret10", "cis_bldg_frigateturret14", "cis_bldg_frigateturret13", "cis_bldg_frigateturret18", "cis_bldg_frigateturret12", "cis_bldg_frigateturret17", "cis_gen2"}, {"cis_frigate3"}, {"cis_frigate4"}} }
engineLinkageCIS:Init()


engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_frigate3"}, {"cis_frigate4"}} }
engineLinkageCIS:Init()



engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"shipturret_dam", "hoth_effect", "hoth_effect1", "hoth_effect2", "hoth_effect3", "hoth_effect4", "hoth_effect5", "hoth_effect6", "hoth_effect7", "venator_engine_right1", "venator_engine_left1", "shipturret_dam2", "shipturret_dam3", "shipturret_dam4", "shipturret_dam5", "shipturret_dam6", "shipturret_dam7", "shipturret8", "broken_comm"}, {"venator_lowrez_left"}, {"venator_lowrez_right"} } }
engineLinkageCIS:Init()


--REP destroyables
lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep-life-int"}, {"rep-life-ext"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular"}, {"spa3_prop_generator_corvette1"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular1"}, {"spa3_prop_generator_corvette2"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular2"}, {"spa3_prop_generator_corvette3"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_frigate50", "rep_bldg_moncal_roundturretz", "rep_generator", "rep_tank41", "rep_tank42", "rep_assultship_destruct_lifesupport_mini"} } }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"pelta"}, {"rep_bldg_moncal_roundturret_Pela", "rep_bldg_moncal_roundturret_Pela2", "rep_bldg_moncal_roundturret_Pela3", "cis-comms41", "rep_generator2"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"pelta0"}, {"rep_bldg_moncal_roundturretx1", "rep_bldg_moncal_roundturretx2", "rep_bldg_moncal_roundturretx3", "cis-comms410", "rep_generator20"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"venatorr1"}, {"venatorl1"}, {"corvette1", "gateway1", "gateway2", "gateway3", "gateway4","shipturret9", "shipturret10", "shipturret11", "shipturret12", "shipturret13", "shipturret14", "shipturret15", "shipturret16", "rep-comms1", "venator_engr1", "venator_engl1", "venator_ins1", "venator_ins2"} } }
lifeSupportLinkageREP:Init()







engineLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_drive_1"}, {"rep-engines"}} }
engineLinkageREP:Init()
end

function MoveEntityToNode(entIn,pathIn,nodeIn)
if not entIn then
print("Warning!: Entity not specified for move")
return false
elseif not pathIn then
print("Warning!: Path not specified for Entity " .. entIn .. " move")
return false
end

local node
if nodeIn then
node = nodeIn
else
node = 0
end

local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
if charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end[/code]
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: No message when a frigate is destroyed

Post by THEWULFMAN »

I'm pretty sure they will only ever say it once, after all frigates have been destroyed.
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: No message when a frigate is destroyed

Post by Executer94 »

Is there any way to make the voice say it every time when one frigate is destroyed?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: No message when a frigate is destroyed

Post by AQT »

I haven't worked with space maps before, but the following could work:

Code: Select all

variable = OnObjectKill(
   function(object, killer)
      if GetEntityName(object) == "[name-of-frigate]" then
	ShowMessageText("[message-string-location", team)
	BroadcastVoiceOver( "[message-sound-name]", team)
      end
   end
)
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: No message when a frigate is destroyed

Post by Executer94 »

I added it and it didn't work. Probably cuz I am not good with the lua.

The red lines are the ones I added.
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Assault File
--
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("BOZc_cmn")

ScriptCB_DoFile("ObjectiveSpaceAssault")
ScriptCB_DoFile("LinkedShields")
ScriptCB_DoFile("LinkedDestroyables")
ScriptCB_DoFile("LinkedShields2")

myGameMode = "BOZ_CW-Assault"

function myScriptInit()

end

function ScriptPreInit()

SetMemoryPoolSize ("ClothData",150)



SetWorldExtents(5000)

end

function ScriptPostLoad()
SetupObjectives()

SetupShields()
SetupDestroyables()
SetupTurrets()
SetupShields2()

AddAIGoal(REP, "Deathmatch", 20)
AddAIGoal(CIS, "Deathmatch", 20)

variable = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "blockaderunner" then
ShowMessageText("level.spa.objectives.rep.7", REP)
BroadcastVoiceOver( "COSMP_obj_04", REP)
end
end
)





OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"TeleportNode")
end,
"TeleportRegion"
)
ActivateRegion("TeleportRegion")

OnEnterRegion(
function(regIn,character)
MoveEntityToNode(character,"Telenode")
end,
"port"
)
ActivateRegion("port")



end

function SetupObjectives()
assault = ObjectiveSpaceAssault:New{
teamATT = REP, teamDEF = CIS,
multiplayerRules = true
}

local repTargets = {
engines = { "cis_tank1", "cis_tank2", "cis_tank40", "cis_tank30", "cis_tank4", "cis_tank3", },
lifesupport = "cis-life-ext1",
bridge = "cis-bridge",
comm = {"cis-comms1", "cis-comms2", "cis-comms40", "cis-comms4", "cis-comms3"} ,
sensors = {"cis-sensors", "cis_frigate21", "cis_frigate2", "cis_frigate1"},
internalSys = { "cis-life-int", "cis-engines" },
}

local cisTargets = {
engines = {"rep_tank41", "rep_tank42"},
lifesupport = "rep-life-ext",
bridge = "rep-bridge",
comm = {"cis-comms410", "cis-comms41"},
sensors = "rep-sensors",
frigates = {"rep_frigate50", "blockaderunner", "rep_prop_consular2", "rep_prop_consular1", "rep_prop_consular", "pelta", "pelta0"},
internalSys = { "rep-life-int", "rep-engines" },
}


assault:SetupAllCriticalSystems( "rep", repTargets, true )
assault:SetupAllCriticalSystems( "cis", cisTargets, false )

assault:Start()
end

function SetupShields()
-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_ship_1", "cis_ship_2", "cis_ship_3", "cis_ship_4",
"cis-bridge", "cis-comms", "cis-life-ext", "cis-sensors",
"cis_drive_1", "cis_drive_2"}
shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "cis-shield"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end






-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate2", "cis-comms4", "cis_tank3", "cis_tank4"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator2"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end




-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate21", "cis-comms40", "cis_tank30", "cis_tank40"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator3"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end
function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end







-- CIS Shielded objects
local linkedShieldObjectsCIS = { "cis_frigate1", "cis-comms3", "cis_tank1", "cis_tank2"}

shieldStuffCIS = LinkedShields:New{objs = linkedShieldObjectsCIS, controllerObject = "muni_generator1"}
shieldStuffCIS:Init()

function shieldStuffCIS:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", REP)
ShowMessageText("level.spa.hangar.shields.def.down", CIS)

BroadcastVoiceOver( "ROSMP_obj_16", REP )
BroadcastVoiceOver( "COSMP_obj_17", CIS )
end


function shieldStuffCIS:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", REP)
ShowMessageText("level.spa.hangar.shields.def.up", CIS)

BroadcastVoiceOver( "ROSMP_obj_18", REP )
BroadcastVoiceOver( "COSMP_obj_19", CIS )
end


end


function SetupShields2()

-- REP Shielded objects
local linkedShieldObjectsREP = { "pelta", "cis-comms41"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator2"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end

-- REP Shielded objects
local linkedShieldObjectsREP = { "rep_frigate50", "rep_tank41", "rep_tank42"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end




-- REP Shielded objects
local linkedShieldObjectsREP = { "pelta0", "cis-comms410"}

shieldStuffREP = LinkedShields:New{objs = linkedShieldObjectsREP, controllerObject = "rep_generator20"}
shieldStuffREP:Init()

function shieldStuffREP:OnAllShieldsDown()
ShowMessageText("level.spa.hangar.shields.atk.down", CIS)
ShowMessageText("level.spa.hangar.shields.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_17", REP )
BroadcastVoiceOver( "COSMP_obj_16", CIS )
end
function shieldStuffREP:OnAllShieldsUp()
ShowMessageText("level.spa.hangar.shields.atk.up", CIS)
ShowMessageText("level.spa.hangar.shields.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_19", REP )
BroadcastVoiceOver( "COSMP_obj_18", CIS )

end



end

function SetupDestroyables()
--CIS destroyables
lifeSupportLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis-life-int"}, {"cis-life-ext"}} }
lifeSupportLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_bldg_frigateturretobj10", "cis_bldg_frigateturret760", "cis_bldg_frigateturretobj0", "cis_bldg_frigateturret750", "cis_bldg_frigateturret740", "cis_bldg_frigateturret710", "cis_bldg_frigateturret0", "cis_bldg_frigateturret770", "cis_bldg_frigateturretobj30", "cis_bldg_frigateturretobj20", "cis_bldg_frigateturretobj60", "cis_bldg_frigateturretobj50", "cis_bldg_frigateturretobj40", "muni_cp1", "muni_generator1", "cis-comms3", "cis_tank1", "cis_tank2", "cis_bldg_frigateturret20", "cis_bldg_frigateturret810"}, {"cis_frigate1"}} }
engineLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"muni_generator2", "cis-comms4", "cis_bldg_frigateturretx", "cis_tank4", "cis_tank3"}, {"cis_frigate2"}} }
engineLinkageCIS:Init()

engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"muni_generator3", "cis-comms40", "cis_bldg_frigateturretq", "cis_tank30", "cis_tank40"}, {"cis_frigate21"}} }
engineLinkageCIS:Init()


engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_bldg_frigateturret15", "cis_bldg_frigateturret16", "cis_bldg_frigateturret11", "cis_bldg_frigateturret10", "cis_bldg_frigateturret14", "cis_bldg_frigateturret13", "cis_bldg_frigateturret18", "cis_bldg_frigateturret12", "cis_bldg_frigateturret17", "cis_gen2"}, {"cis_frigate3"}, {"cis_frigate4"}} }
engineLinkageCIS:Init()


engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"cis_frigate3"}, {"cis_frigate4"}} }
engineLinkageCIS:Init()



engineLinkageCIS = LinkedDestroyables:New{ objectSets = {{"shipturret_dam", "hoth_effect", "hoth_effect1", "hoth_effect2", "hoth_effect3", "hoth_effect4", "hoth_effect5", "hoth_effect6", "hoth_effect7", "venator_engine_right1", "venator_engine_left1", "shipturret_dam2", "shipturret_dam3", "shipturret_dam4", "shipturret_dam5", "shipturret_dam6", "shipturret_dam7", "shipturret8", "broken_comm"}, {"venator_lowrez_left"}, {"venator_lowrez_right"} } }
engineLinkageCIS:Init()


--REP destroyables
lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep-life-int"}, {"rep-life-ext"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular"}, {"spa3_prop_generator_corvette1"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular1"}, {"spa3_prop_generator_corvette2"}} }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_prop_consular2"}, {"spa3_prop_generator_corvette3"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_frigate50", "rep_bldg_moncal_roundturretz", "rep_generator", "rep_tank41", "rep_tank42", "rep_assultship_destruct_lifesupport_mini"} } }
lifeSupportLinkageREP:Init()

lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"pelta"}, {"rep_bldg_moncal_roundturret_Pela", "rep_bldg_moncal_roundturret_Pela2", "rep_bldg_moncal_roundturret_Pela3", "cis-comms41", "rep_generator2"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"pelta0"}, {"rep_bldg_moncal_roundturretx1", "rep_bldg_moncal_roundturretx2", "rep_bldg_moncal_roundturretx3", "cis-comms410", "rep_generator20"}} }
lifeSupportLinkageREP:Init()


lifeSupportLinkageREP = LinkedDestroyables:New{ objectSets = {{"venatorr1"}, {"venatorl1"}, {"corvette1", "gateway1", "gateway2", "gateway3", "gateway4","shipturret9", "shipturret10", "shipturret11", "shipturret12", "shipturret13", "shipturret14", "shipturret15", "shipturret16", "rep-comms1", "venator_engr1", "venator_engl1", "venator_ins1", "venator_ins2"} } }
lifeSupportLinkageREP:Init()







engineLinkageREP = LinkedDestroyables:New{ objectSets = {{"rep_drive_1"}, {"rep-engines"}} }
engineLinkageREP:Init()
end

function MoveEntityToNode(entIn,pathIn,nodeIn)
if not entIn then
print("Warning!: Entity not specified for move")
return false
elseif not pathIn then
print("Warning!: Path not specified for Entity " .. entIn .. " move")
return false
end

local node
if nodeIn then
node = nodeIn
else
node = 0
end

local locDest = GetPathPoint(pathIn,node)
local charUnit = GetCharacterUnit(entIn)
if charUnit then
SetEntityMatrix(charUnit,locDest)
return true
end
return false
end
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: No message when a frigate is destroyed

Post by CressAlbane »

ShowMessageText("[message-string-location", team)
OFF-topic: Does this line work anywhere? Such as an OnEnterRegion?
And team is 1 or 2, correct?
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: No message when a frigate is destroyed

Post by DarthD.U.C.K. »

pademic used "REP" and "CIS" for the team as you can see in the scrip above :wink:
and yes, you can use callbacks in combination with any event.
Executer94
Major
Major
Posts: 504
Joined: Fri May 01, 2009 7:45 am
Location: Chalmuns Cantina

Re: No message when a frigate is destroyed

Post by Executer94 »

It didn't work for me. Does my script ^ look any wrong?
Post Reply