Page 3 of 3

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 7:41 pm
by myers73
try just playing a sound that is already loaded, like the emperor sound, just be sure you load a soundfile that contains it. also, more the block of code to under where you load your death regions.

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 7:58 pm
by Deviss
myers73 wrote:try just playing a sound that is already loaded, like the emperor sound, just be sure you load a soundfile that contains it. also, more the block of code to under where you load your death regions.
i am using coruscant sound so i used macewindu spawn sound but dont work
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


playSound = OnCharacterSpawn(
function(player)
if GetEnityClass(player) == FindEnityClass("rep_clone9") then
ScriptCB_SndPlaySound("hero_windu_spawn")
end
end
)


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
cp6 = CommandPost:New{name = "CP7"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 3000, gameMode = "conquest",}
herosupport:SetHeroClass(CIS, "cis_hero_jangofett")
herosupport:AddSpawnCP("cp1","cp1spawn")
herosupport:AddSpawnCP("cp2","cp2spawn")
herosupport:AddSpawnCP("cp3","cp3spawn")
herosupport:AddSpawnCP("cp4","cp4spawn")
herosupport:AddSpawnCP("cp5","cp5spawn")
herosupport:AddSpawnCP("cp7","cp7spawn")
herosupport:Start()

EnableSPHeroRules()

AddDeathRegion("DeathRegion")
AddDeathRegion("DeathRegion2")

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

SetUberMode(1);
ReadDataFile("ingame.lvl")


SetMaxFlyHeight(-5)
SetMaxPlayerFlyHeight (-5)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")

ReadDataFile("SIDE\\rep.lvl",
"rep_hero_obiwan")

ReadDataFile("SIDE\\cis.lvl",
"cis_hero_jangofett")

ReadDataFile("dc:SIDE\\dev.lvl",
"rep_clone1",
"rep_clone2",
"rep_clone3",
"rep_clone4",
"rep_clone5",
"rep_clone6",
"rep_clone7",
"rep_clone8",
"rep_clone9",
"rep_clone10")

ReadDataFile("dc:SIDE\\fed.lvl",
"cis_droid1",
"cis_droid2",
"cis_droid3",
"cis_droid4",
"cis_droid5",
"cis_droid6",
"cis_droid7",
"cis_droid8",
"cis_droid9",
"cis_hero")

ReadDataFile("SIDE\\tur.lvl",
"tur_weap_built_gunturret",
"tur_bldg_laser")

SetupTeams{
rep = {
team = REP,
units = 40,
reinforcements = 150,
soldier = { "rep_clone1",10, 15},
heavy = { "rep_clone2",3,4},
sniper = { "rep_clone3",3,4},
engineer = { "rep_clone4",3,4},
marine = { "rep_clone5",3,4},
recon = { "rep_clone6",3,4},
gunner = { "rep_clone7",3,4},
special = { "rep_clone8",3,4},
commando = { "rep_clone9",3,4},
commander = { "rep_clone10",1,2},

},
cis = {
team = CIS,
units = 40,
reinforcements = 150,
soldier = { "cis_droid1",8, 20},
heavy = { "cis_droid2",4,5},
sniper = { "cis_droid3",4,5},
engineer = { "cis_droid4",4,5},
marine = { "cis_droid5",7,9},
recon = { "cis_droid6",3,4},
gunner = { "cis_droid7",3,4},
special = { "cis_droid8",1,1},
commander = { "cis_droid9",2,3},
}
}

SetHeroClass(REP, "rep_hero_obiwan")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 20) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 370)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:ABC\\bes2.lvl", "bespin2_conquest")
SetDenseEnvironment("false")

-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("dc:sound\\ABC.lvl", "ABC_stream")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_cor_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_cor_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_cor_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_cor_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_cor_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_cor_amb_end", 2,1)

SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


-- Camera Stats
--Bespin 2
--Courtyard
AddCameraShot(0.364258, -0.004224, -0.931226, -0.010797, -206.270294, -44.204708, 88.837059);
--Carbon Chamber
AddCameraShot(0.327508, 0.002799, -0.944810, 0.008076, -184.781006, -59.802036, -28.118919);
--Wind Tunnel
AddCameraShot(0.572544, -0.013560, -0.819532, -0.019410, -244.788055, -61.541622, -44.260509);
end

you could post one lua as example of work :D please

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:06 pm
by myers73
Hidden/Spoiler:
[code]
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
cp6 = CommandPost:New{name = "CP7"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 3000, gameMode = "conquest",}
herosupport:SetHeroClass(CIS, "cis_hero_jangofett")
herosupport:AddSpawnCP("cp1","cp1spawn")
herosupport:AddSpawnCP("cp2","cp2spawn")
herosupport:AddSpawnCP("cp3","cp3spawn")
herosupport:AddSpawnCP("cp4","cp4spawn")
herosupport:AddSpawnCP("cp5","cp5spawn")
herosupport:AddSpawnCP("cp7","cp7spawn")
herosupport:Start()

EnableSPHeroRules()

AddDeathRegion("DeathRegion")
AddDeathRegion("DeathRegion2")

playSound = OnCharacterSpawn(
function(player)
if GetEnityClass(player) == FindEnityClass("rep_clone9") then
ScriptCB_SndPlaySound("hero_windu_spawn")
end
end
)

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------
function ScriptInit()

SetUberMode(1);
ReadDataFile("ingame.lvl")


SetMaxFlyHeight(-5)
SetMaxPlayerFlyHeight (-5)

SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",50) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",650) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",650) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",550) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",100) -- should be ~1x #combo

ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")

ReadDataFile("SIDE\\rep.lvl",
"rep_hero_obiwan",
"rep_hero_mace_windu")

ReadDataFile("SIDE\\cis.lvl",
"cis_hero_jangofett")

ReadDataFile("dc:SIDE\\dev.lvl",
"rep_clone1",
"rep_clone2",
"rep_clone3",
"rep_clone4",
"rep_clone5",
"rep_clone6",
"rep_clone7",
"rep_clone8",
"rep_clone9",
"rep_clone10")

ReadDataFile("dc:SIDE\\fed.lvl",
"cis_droid1",
"cis_droid2",
"cis_droid3",
"cis_droid4",
"cis_droid5",
"cis_droid6",
"cis_droid7",
"cis_droid8",
"cis_droid9",
"cis_hero")

ReadDataFile("SIDE\\tur.lvl",
"tur_weap_built_gunturret",
"tur_bldg_laser")

SetupTeams{
rep = {
team = REP,
units = 40,
reinforcements = 150,
soldier = { "rep_clone1",10, 15},
heavy = { "rep_clone2",3,4},
sniper = { "rep_clone3",3,4},
engineer = { "rep_clone4",3,4},
marine = { "rep_clone5",3,4},
recon = { "rep_clone6",3,4},
gunner = { "rep_clone7",3,4},
special = { "rep_clone8",3,4},
commando = { "rep_clone9",3,4},
commander = { "rep_clone10",1,2},

},
cis = {
team = CIS,
units = 40,
reinforcements = 150,
soldier = { "cis_droid1",8, 20},
heavy = { "cis_droid2",4,5},
sniper = { "cis_droid3",4,5},
engineer = { "cis_droid4",4,5},
marine = { "cis_droid5",7,9},
recon = { "cis_droid6",3,4},
gunner = { "cis_droid7",3,4},
special = { "cis_droid8",1,1},
commander = { "cis_droid9",2,3},
}
}

SetHeroClass(REP, "rep_hero_obiwan")


-- Level Stats
-- ClearWalkers()
AddWalkerType(0, 20) -- special -> droidekas
AddWalkerType(1, 0) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 370)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:ABC\\bes2.lvl", "bespin2_conquest")
SetDenseEnvironment("false")

-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

voiceQuick = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_quick")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_quick", voiceQuick)

OpenAudioStream("sound\\global.lvl", "cw_music")
OpenAudioStream("dc:sound\\ABC.lvl", "ABC_stream")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_emt")

SetBleedingVoiceOver(REP, REP, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(REP, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, REP, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetLowReinforcementsVoiceOver(REP, REP, "rep_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(REP, CIS, "rep_off_victory_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, CIS, "cis_off_defeat_im", .1, 1)
SetLowReinforcementsVoiceOver(CIS, REP, "cis_off_victory_im", .1, 1)

SetOutOfBoundsVoiceOver(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_cor_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_cor_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_cor_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_cor_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_cor_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_cor_amb_end", 2,1)

SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("WeaponUnableSelect", "com_weap_inf_weaponchange_null")
--SetSoundEffect("WeaponModeUnableSelect", "com_weap_inf_modechange_null")
SetSoundEffect("SpawnDisplayUnitChange", "shell_select_unit")
SetSoundEffect("SpawnDisplayUnitAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplaySpawnPointChange", "shell_select_change")
SetSoundEffect("SpawnDisplaySpawnPointAccept", "shell_menu_enter")
SetSoundEffect("SpawnDisplayBack", "shell_menu_exit")


-- Camera Stats
--Bespin 2
--Courtyard
AddCameraShot(0.364258, -0.004224, -0.931226, -0.010797, -206.270294, -44.204708, 88.837059);
--Carbon Chamber
AddCameraShot(0.327508, 0.002799, -0.944810, 0.008076, -184.781006, -59.802036, -28.118919);
--Wind Tunnel
AddCameraShot(0.572544, -0.013560, -0.819532, -0.019410, -244.788055, -61.541622, -44.260509);
end

[/code][/size]

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:16 pm
by Deviss
i tested it also changing sound file as spawn sound setted, with originals and with custom sounds but still dont work xD and this time i havent any crazy idea for try :S

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:21 pm
by myers73
Hidden/Spoiler:
[code]
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
cp6 = CommandPost:New{name = "CP7"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 3000, gameMode = "conquest",}
herosupport:SetHeroClass(CIS, "cis_hero_jangofett")
herosupport:AddSpawnCP("cp1","cp1spawn")
herosupport:AddSpawnCP("cp2","cp2spawn")
herosupport:AddSpawnCP("cp3","cp3spawn")
herosupport:AddSpawnCP("cp4","cp4spawn")
herosupport:AddSpawnCP("cp5","cp5spawn")
herosupport:AddSpawnCP("cp7","cp7spawn")
herosupport:Start()

EnableSPHeroRules()

AddDeathRegion("DeathRegion")
AddDeathRegion("DeathRegion2")

playSound = OnCharacterSpawn(
function(player)
if GetEnityClass(player) == FindEnityClass("rep_clone9") then
ScriptCB_SndPlaySound("hero_windu_spawn")
print("script ran")
end
end
)

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit
-- PURPOSE: This function is only run once
-- INPUT:
-- OUTPUT:
-- NOTES: The name, 'ScriptInit' is a chosen convention, and each
-- mission script must contain a version of this function, as
-- it is called from C to start the mission.
---------------------------------------------------------------------------

[/code][/size]

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:30 pm
by Deviss
new one but still dont work xD
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("AIHeroSupport")

-- REP Attacking (attacker is always #1)
REP = 1;
CIS = 2;
-- These variables do not change
ATT = REP;
DEF = CIS;


function ScriptPostLoad()


--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "CP1"}
cp2 = CommandPost:New{name = "CP2"}
cp3 = CommandPost:New{name = "CP3"}
cp4 = CommandPost:New{name = "CP4"}
cp5 = CommandPost:New{name = "CP5"}
cp6 = CommandPost:New{name = "CP7"}



--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
textATT = "game.modes.con",
textDEF = "game.modes.con2",
multiplayerRules = true}

--This adds the CPs to the objective. This needs to happen after the objective is set up
conquest:AddCommandPost(cp1)
conquest:AddCommandPost(cp2)
conquest:AddCommandPost(cp3)
conquest:AddCommandPost(cp4)
conquest:AddCommandPost(cp5)
conquest:AddCommandPost(cp6)

conquest:Start()

herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 3000, gameMode = "conquest",}
herosupport:SetHeroClass(CIS, "cis_hero_jangofett")
herosupport:AddSpawnCP("cp1","cp1spawn")
herosupport:AddSpawnCP("cp2","cp2spawn")
herosupport:AddSpawnCP("cp3","cp3spawn")
herosupport:AddSpawnCP("cp4","cp4spawn")
herosupport:AddSpawnCP("cp5","cp5spawn")
herosupport:AddSpawnCP("cp7","cp7spawn")
herosupport:Start()

EnableSPHeroRules()

AddDeathRegion("DeathRegion")
AddDeathRegion("DeathRegion2")

playSound = OnCharacterSpawn(
function(player)
if GetEnityClass(player) == FindEnityClass("rep_clone9") then
ScriptCB_SndPlaySound("hero_windu_spawn")
print("script ran")
end
end
)

end


---------------------------------------------------------------------------
-- FUNCTION: ScriptInit[/code]

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:37 pm
by myers73
run the map with BF2_modtools.exe and check the BFront2.log and see if the print statement shows up

Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:43 pm
by Deviss
myers73 wrote:run the map with BF2_modtools.exe and check the BFront2.log and see if the print statement shows up
sir yes sir :D
Hidden/Spoiler:

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>
[C]: in function `SpawnCharacter'
(none): in function <(none):254>
(none): in function <(none):323>
(none): in function <(none):494>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: (none):0: attempt to call global `GetEnityClass' (a nil value)
stack traceback:
(none): in function <(none):63>


Re: Player spawn sound (no hero)

Posted: Mon May 24, 2010 8:59 pm
by myers73
there is a typo, its GetEntityClass()just copy and paste this:

Code: Select all



    playSound = OnCharacterSpawn(
        function(player)
        if IsCharacterHuman(player) == true then
            print("spawned unit is human")
            if GetEntityClass(player) == FindEntityClass("rep_clone9") then
                ScriptCB_SndPlaySound("hero_windu_spawn")
                print("script ran")
                end
            end
        end
    )

[/size]

Re: Player spawn sound (no hero)

Posted: Sat Jun 05, 2010 8:24 pm
by Deviss
dont work but new strange log error :P
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\dev\dev.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\dev\dev.lvl

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Platform\PC\pcFirstPerson.cpp(69)
FirstPerson::LoadLVLFile: Could not open FPM\FED\FED.lvl
spawned unit is human

Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\LuaCallbacks_Mission.cpp(635)
Entity "0" not found

EDIT
well watching, rewatching and rewatching campaigns scripts i got make this my self

Code: Select all

    playSound = OnCharacterSpawn(
        function(player, unit)
            if IsCharacterHuman(player) and GetEntityClass(unit) == GetEntityClassPtr("rep_clone9") then
                ScriptCB_SndPlaySound("hero_windu_spawn")
            end
        end
    )
and this

Code: Select all

    onfirstspawn = OnCharacterSpawn(
        function(player)
            if IsCharacterHuman(player) and GetEntityClass(player) == "rep_212nd_clon8" then
                ScriptCB_SndPlaySound("hero_windu_spawn")
            end
        end
    )
but dont work :S any idea ? this is the original line totally work
if IsCharacterHuman(player) and GetEntityClass(vehicle) == GetEntityClassPtr("rep_hover_barcspeeder") then