Page 1 of 2

Is it possible to divide my lua into 2 parts?

Posted: Tue Sep 07, 2010 10:04 am
by Deviss
hi there :D i am using random model for all lua of my legions so when i want change one model i must modify 120 files :S , so i am searching a short way and for example i saw in stock scripts from space conquest they divide lua in 2, _Diet Dr. Pepper and _cmn :D i tried this:
fel1x_con.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("legion50x")
ScriptCB_DoFile("ObjectiveConquest")

---------------------------------------------------------------------------
-- 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 ScriptPostLoad()

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp1-1"}
cp2 = CommandPost:New{name = "cp2-1"}
cp3 = CommandPost:New{name = "cp3-1"}
cp4 = CommandPost:New{name = "cp4-1"}
cp5 = CommandPost:New{name = "cp5-1"}
cp6 = CommandPost:New{name = "cp6-1"}


--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()

onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
SetProperty(GetCharacterUnit(character), "AddHealth", 50)
end
end)

EnableSPHeroRules()

end

function ScriptInit()
StealArtistHeap(132*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(3200000)
SetUberMode(1);
ReadDataFile("ingame.lvl")

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

SetMemoryPoolSize("Music", 200)


ReadDataFile("sound\\fel.lvl;fel1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")
SetMaxFlyHeight(53)
SetMaxPlayerFlyHeight (53)
ReadDataFile("SIDE\\rep.lvl",
"rep_hero_aalya")

ReadDataFile("dc:SIDE\\Republic.lvl",
"Republic_1",
"Republic_2",
"Republic_3",
"Republic_4",
"Republic_5",
"Republic_6",
"Republic_7",
"Republic_8",
"Republic_9")

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

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

ReadDataFile("dc:SIDE\\veh.lvl",
"cis_tread_snailtank",
"rep_walk_oneman_atst")

SetAttackingTeam(ATT)
SetupTeams{
rep = {
team = REP,
units = 50,
reinforcements = 150,
soldier = { "rep_clone1",15, 20},
pilot = { "rep_clone2",4,5},
assault = { "rep_clone3",4,5},
sniper = { "rep_clone4",4,5},
marine = { "rep_clone5",4,5},
engineer = { "rep_clone6",4,5},
officer = { "rep_clone7",4,5},
special = { "rep_clone8",4,5},
commander = { "rep_clone9",2,3},

},
cis = {
team = CIS,
units = 50,
reinforcements = 150,
soldier = { "cis_droid1",10, 30},
pilot = { "cis_droid2",5,7},
assault = { "cis_droid3",5,7},
sniper = { "cis_droid4",5,7},
marine = { "cis_droid5",8,9},
engineer = { "cis_droid6",4,5},
officer = { "cis_droid7",4,5},
commander = { "cis_droid9",2,4},

},

}

SetHeroClass(REP, "rep_hero_aalya")
SetHeroClass(CIS, "cis_hero")


-- Level Stats
ClearWalkers()
-- AddWalkerType(0, 8)
--AddWalkerType(5, 2) -- 2 attes with 2 leg pairs each
--AddWalkerType(3, 1) -- 3 acklays with 3 leg pairs each
AddWalkerType(1, 2)
AddWalkerType(0, 4)
local weaponCnt = 1600
SetMemoryPoolSize("Aimer", 1024)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("EntityHover", 4)
SetMemoryPoolSize("EntityLight", 33)
SetMemoryPoolSize("EntitySoundStream", 100)
SetMemoryPoolSize("EntitySoundStatic", 200)
SetMemoryPoolSize("EntityWalker", 5)
SetMemoryPoolSize("MountedTurret", 100)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 1024)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("Weapon", 1024)
SetMemoryPoolSize("FlagItem", 5)
SetMemoryPoolSize("AcklayData", 6)
SetMemoryPoolSize("EntityFlyer", 6)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("fel\\fel1.lvl", "fel1_conquest")
SetDenseEnvironment("false")
SetAIViewMultiplier(0.65)
--AddDeathRegion("Sarlac01")

-- Birdies
SetNumBirdTypes(1)
SetBirdType(0,1.0,"bird")


-- 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\\fel.lvl", "fel1")
OpenAudioStream("sound\\fel.lvl", "fel1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\fel.lvl", "fel1_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)

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

SetAmbientMusic(REP, 1.0, "rep_fel_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_fel_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_fel_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_fel_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_fel_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_fel_amb_end", 2,1)

SetVictoryMusic(REP, "rep_fel_amb_victory")
SetDefeatMusic (REP, "rep_fel_amb_defeat")
SetVictoryMusic(CIS, "cis_fel_amb_victory")
SetDefeatMusic (CIS, "cis_fel_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
AddCameraShot(0.896307, -0.171348, -0.401716, -0.076796, -116.306931, 31.039505, 20.757469)
AddCameraShot(0.909343, -0.201967, -0.355083, -0.078865, -116.306931, 31.039505, 20.757469)
AddCameraShot(0.543199, 0.115521, -0.813428, 0.172990, -108.378189, 13.564240, -40.644150)
AddCameraShot(0.970610, 0.135659, 0.196866, -0.027515, -3.214346, 11.924586, -44.687294)
AddCameraShot(0.346130, 0.046311, -0.928766, 0.124267, 87.431061, 20.881388, 13.070729)
AddCameraShot(0.468084, 0.095611, -0.860724, 0.175812, 18.063482, 19.360580, 18.178158)



end
legion50x.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

---------------------------------------------------------------------------
-- 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 ScriptPostLoad()

------------------------------------------------------------
--This is code for cycling rifleman models
------------------------------------------------------------
--KinetosImpetus

SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
--this little part ^ was for debugging really, it isn't necessary

-- Timer for skins--

--interval is the number of seconds between model changes
--maxskin is the number of versions to use

interval = 3 --i had been testing this at 10 second waves, but it could be changed
--in MP, it will probably cause each 15 second spawn-wave to be the same model
skintimer = CreateTimer("timeout") -- i don't know what significance "timeout" has, copied from hoth campaign this way
SetTimerValue(skintimer , interval )
--ShowTimer(skintimer ) --uncomment this line to see the timer onscreen
skin = 1
maxskin = 2

OnTimerElapse(
function(timer)


if (skin == 1) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_ep3sniper")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_ep3sniper_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_ep3_Clone_Commander_Faie")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_ep3_Clone_Commander_Faie_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_Mandalorian_Soldier")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_Mandalorian_Soldier_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARC_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARC_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_WeStar_M5a")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_WeStar_M5s")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_wrist_caster")
SetClassProperty("rep_clone7", "GeometryName", "rep_inf_SandTrooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "rep_inf_SandTrooper_low1")
end
if (skin == 2) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
end



skin = skin + 1

if (skin > maxskin) then
skin = 1
end

--ShowTimer(nil)
--DestroyTimer(timer)



SetTimerValue(skintimer , interval )
StartTimer(skintimer)


end,
skintimer
)

-------------------------------------------------------------------------
--resume normal conquest script, or whatever gamemode...
--------------------------------------------------------------------------

StartTimer(skintimer) --starts the timer the first time, after it starts, it will restart itself one ending.

--------------wait start the timer first! ok, now go...
---------------------------------------------------------------------

ReadDataFile("dc:SIDE\\Republic.lvl",
"Republic_1",
"Republic_2",
"Republic_3",
"Republic_4",
"Republic_5",
"Republic_6",
"Republic_7",
"Republic_8",
"Republic_9")

ReadDataFile("dc:SIDE\\50X.lvl",
"rep_clone1",
"rep_clone2",
"rep_clone3",
"rep_clone4",
"rep_clone5",
"rep_clone6",
"rep_clone7",
"rep_clone8",
"rep_clone9")
but dont work :S as always
such as i am trying make an universal file for all my luas so when i change model i only must modify one file, any idea :D ?

thanks in advance

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 10:19 am
by skelltor
I had that idea too but i have not tried it it looks like its used a lot in space maps. One thing i noticed is the space maps in thier req it lists both scipts the _cmn and _Diet Dr. Pepper. Did you try that?

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 10:39 am
by Deviss
skelltor wrote:I had that idea too but i have not tried it it looks like its used a lot in space maps. One thing i noticed is the space maps in thier req it lists both scipts the cmn and Diet Dr. Pepper. Did you try that?
yeah i putted legion50x in my mission.req :P , and bfrontlog didnt say the game cant find the file so i added it right :)

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 10:43 am
by skelltor
hmm sorry man that was my only idea

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 11:04 am
by Deviss
skelltor wrote:hmm sorry man that was my only idea
many thanks anyway :wink:

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 12:41 pm
by DarthD.U.C.K.
hmmm, ive never really scripted lua, but i attempted some C# lately.

i suppose the problem is that you load the 50x.lua before the the map even starts, this could cause that its not being used in realtime-gameplay and/or that the timer cant even count rounds/frames/seconds whatever

my suggestion would be to put the timer in the actual missionlua and leave the definition of the units in the extrafile

Re: is possible divide my lua in 2 parts??

Posted: Tue Sep 07, 2010 11:07 pm
by Deviss
DarthD.U.C.K. wrote:hmmm, ive never really scripted lua, but i attempted some C# lately.

i suppose the problem is that you load the 50x.lua before the the map even starts, this could cause that its not being used in realtime-gameplay and/or that the timer cant even count rounds/frames/seconds whatever

my suggestion would be to put the timer in the actual missionlua and leave the definition of the units in the extrafile
cool idea i will try :D , and thanks for help me :wink: , but how i make the reference ? like this:

xxxc_con.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")

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

function ScriptPostLoad()

------------------------------------------------------------
--This is code for cycling rifleman models
------------------------------------------------------------
--KinetosImpetus
--this little part ^ was for debugging really, it isn't necessary

-- Timer for skins--

--interval is the number of seconds between model changes
--maxskin is the number of versions to use

interval = 3 --i had been testing this at 10 second waves, but it could be changed
--in MP, it will probably cause each 15 second spawn-wave to be the same model
skintimer = CreateTimer("timeout") -- i don't know what significance "timeout" has, copied from hoth campaign this way
SetTimerValue(skintimer , interval )
--ShowTimer(skintimer ) --uncomment this line to see the timer onscreen
skin = 1
maxskin = 2
)

-------------------------------------------------------------------------
--resume normal conquest script, or whatever gamemode...
--------------------------------------------------------------------------

StartTimer(skintimer) --starts the timer the first time, after it starts, it will restart itself one ending.

--------------wait start the timer first! ok, now go...
---------------------------------------------------------------------

--This defines the CPs. These need to happen first
cp1 = CommandPost:New{name = "cp12"}
cp2 = CommandPost:New{name = "cp15"}
cp3 = CommandPost:New{name = "cp16"}
cp4 = CommandPost:New{name = "cp17"}
cp5 = CommandPost:New{name = "cp18"}
cp6 = CommandPost:New{name = "cp19"}
cp7 = CommandPost:New{name = "cp9"}



--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:AddCommandPost(cp7)

conquest:Start()

onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
SetProperty(GetCharacterUnit(character), "AddHealth", 50)
end
end)


EnableSPHeroRules()

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")
ReadDataFile("dc:Load\\BS1screen.lvl")



SetMaxFlyHeight(225)
SetMaxPlayerFlyHeight (225)

SetMemoryPoolSize ("Combo",1000) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1000) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",1000) -- should be ~1x #combo
SetMemoryPoolSize ("ParticleTransformer::SizeTransf", 2000)
SetMemoryPoolSize ("ParticleTransformer::ColorTrans", 2000)
SetMemoryPoolSize ("ClothData",400)
SetMemoryPoolSize ("EntityCloth",400)
SetMemoryPoolSize ("Music", 200)

ReadDataFile("sound\\dea.lvl;dea1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")
ReadDataFile("dc:sound\\bes1.lvl;bes1cw")

ReadDataFile("SIDE\\rep.lvl",
"rep_fly_anakinstarfighter_sc",
"rep_fly_arc170fighter_sc",
"rep_fly_vwing",
"rep_hero_obiwan")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_sc",
"cis_fly_droidgunship",
"cis_fly_greviousfighter",
"cis_fly_tridroidfighter",
"cis_hero_jangofett")

ReadDataFile("dc:SIDE\\PloKoon.lvl",
"rep_hero_PloKoon")

ReadDataFile("dc:SIDE\\Republic.lvl",
"Republic_1",
"Republic_2",
"Republic_3",
"Republic_4",
"Republic_5",
"Republic_6",
"Republic_7",
"Republic_8",
"Republic_9")

ReadDataFile("dc:SIDE\\212nd.lvl",
"rep_212nd_clon1",
"rep_212nd_clon2",
"rep_212nd_clon3",
"rep_212nd_clon4",
"rep_212nd_clon5",
"rep_212nd_clon6",
"rep_212nd_clon7",
"rep_212nd_clon8",
"rep_212nd_clon9")

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

ReadDataFile("dc:SIDE\\veh.lvl",
"rep_fly_gunship",
"rep_fly_gunship_sc")

SetupTeams{
cis = {
team = CIS,
units = 50,
reinforcements = 150,
soldier = { "cis_droid1",10, 30},
pilot = { "cis_droid2",5,7},
assault = { "cis_droid3",5,7},
sniper = { "cis_droid4",5,7},
marine = { "cis_droid5",8,9},
engineer = { "cis_droid6",4,5},
officer = { "cis_droid7",4,5},
commander = { "cis_droid9",2,4},

},
rep = {
team = REP,
units = 50,
reinforcements = 150,
soldier = { "rep_212nd_clon1",18, 22},
pilot = { "rep_212nd_clon2",4,5},
assault = { "rep_212nd_clon3",4,5},
sniper = { "rep_212nd_clon4",4,5},
marine = { "rep_212nd_clon5",4,5},
engineer = { "rep_212nd_clon6",4,5},
officer = { "rep_212nd_clon7",4,5},
special = { "rep_212nd_clon8",4,5},
commander = { "rep_212nd_clon9",2,3},
}
}

SetHeroClass(REP, "rep_hero_obiwan")
SetHeroClass(CIS, "cis_hero")

-- Level Stats
AddWalkerType(0, 5) -- special -> droidekas
AddWalkerType(1, 2) -- 1x2 (1 pair of legs)
AddWalkerType(2, 0) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 0) -- 3x2 (3 pairs of legs)
SetMemoryPoolSize("EntityHover", 8)
local weaponCnt = 1204
SetMemoryPoolSize("Aimer", 200)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1000)
SetMemoryPoolSize("ConnectivityGraphFollower", 200)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 50)
SetMemoryPoolSize("EntityLight", 50)
SetMemoryPoolSize("EntitySoundStream", 40)
SetMemoryPoolSize("EntitySoundStatic", 200)
SetMemoryPoolSize("MountedTurret", 250)
SetMemoryPoolSize("Obstacle", 760)
SetMemoryPoolSize("PathNode", 512)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 1900)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1400)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1200)
SetMemoryPoolSize("SoldierAnimation", 740)
SetMemoryPoolSize("SoundSpaceRegion", 146)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("CommandFlyer", 14)
SetMemoryPoolSize("EntityCloth",241)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 20)
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("Navigator", 380) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 280)
SetMemoryPoolSize("RedShadingState", 32)
SetMemoryPoolSize("ShieldEffect", 10)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 440)
SetMemoryPoolSize("UnitAgent", 300)
SetMemoryPoolSize("UnitController", 310)

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

-- Birdies
--SetNumBirdTypes(2)
--SetBirdType(0,1.0,"bird")
--SetBirdType(1,1.5,"bird2")

-- Fishies
--SetNumFishTypes(1)
--SetFishType(0,0.8,"fish")

-- Sound

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\\dea.lvl", "dea1")
OpenAudioStream("sound\\dea.lvl", "dea1")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
--OpenAudioStream("sound\\dea.lvl", "dea1_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(1, "Repleaving")
SetOutOfBoundsVoiceOver(2, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_dea_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_dea_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2,"rep_dea_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_dea_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_dea_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2,"cis_dea_amb_end", 2,1)

SetVictoryMusic(REP, "rep_dea_amb_victory")
SetDefeatMusic (REP, "rep_dea_amb_defeat")
SetVictoryMusic(CIS, "cis_dea_amb_victory")
SetDefeatMusic (CIS, "cis_dea_amb_defeat")

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")
--SetSoundEffect("BirdScatter", "birdsFlySeq1")
--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")


--OpeningSateliteShot
--Platform Sky
AddCameraShot(0.793105, -0.062986, -0.603918, -0.047962, -170.583618, 118.981544, -150.443253);
--Control Room
AddCameraShot(0.189716, 0.000944, -0.981826, 0.004887, -27.594292, 100.583740, -176.478012);
--Extractor
AddCameraShot(0.492401, 0.010387, -0.870113, 0.018354, 19.590666, 100.493599, -47.846901);
end
legion50x.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

---------------------------------------------------------------------------
-- 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 ScriptPostLoad()

------------------------------------------------------------
--This is code for cycling rifleman models
------------------------------------------------------------
--KinetosImpetus

OnTimerElapse(
function(timer)


if (skin == 1) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_ep3sniper")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_ep3sniper_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_ep3_Clone_Commander_Faie")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_ep3_Clone_Commander_Faie_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_Mandalorian_Soldier")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_Mandalorian_Soldier_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARC_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARC_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_WeStar_M5a")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_WeStar_M5s")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_wrist_caster")
SetClassProperty("rep_clone7", "GeometryName", "rep_inf_SandTrooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "rep_inf_SandTrooper_low1")
end
if (skin == 2) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
end



skin = skin + 1

if (skin > maxskin) then
skin = 1
end

--ShowTimer(nil)
--DestroyTimer(timer)



SetTimerValue(skintimer , interval )
StartTimer(skintimer)


end,
skintimer
)

end
function ScriptInit()

ReadDataFile("dc:SIDE\\Republic.lvl",
"Republic_1",
"Republic_2",
"Republic_3",
"Republic_4",
"Republic_5",
"Republic_6",
"Republic_7",
"Republic_8",
"Republic_9")

ReadDataFile("dc:SIDE\\50X.lvl",
"rep_clone1",
"rep_clone2",
"rep_clone3",
"rep_clone4",
"rep_clone5",
"rep_clone6",
"rep_clone7",
"rep_clone8",
"rep_clone9")
end
EDIT
didnt work :S i dont know how divide timer and properties from it :S please help

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 2:21 am
by DarthD.U.C.K.
well i would put all the stuff regarding the timer into the x_con lua (maybe plus the loading of the units, dunno if that canbe don with seperate file) and the unitdefinitionparts (with if skin....) in the seperate one

btw wheredid you define maxskin?

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 9:16 am
by Deviss
DarthD.U.C.K. wrote:well i would put all the stuff regarding the timer into the x_con lua (maybe plus the loading of the units, dunno if that canbe don with seperate file) and the unitdefinitionparts (with if skin....) in the seperate one

btw wheredid you define maxskin?
i didnt understand rightly but you mean this :) :
xxxc_con
Hidden/Spoiler:
function ScriptPostLoad()

------------------------------------------------------------
--This is code for cycling rifleman models
------------------------------------------------------------
--KinetosImpetus
--this little part ^ was for debugging really, it isn't necessary

-- Timer for skins--

--interval is the number of seconds between model changes
--maxskin is the number of versions to use

interval = 3 --i had been testing this at 10 second waves, but it could be changed
--in MP, it will probably cause each 15 second spawn-wave to be the same model
skintimer = CreateTimer("timeout") -- i don't know what significance "timeout" has, copied from hoth campaign this way
SetTimerValue(skintimer , interval )
--ShowTimer(skintimer ) --uncomment this line to see the timer onscreen
skin = 1
maxskin = 2

OnTimerElapse(
function(timer)


end



skin = skin + 1

if (skin > maxskin) then
skin = 1
end

--ShowTimer(nil)
--DestroyTimer(timer)



SetTimerValue(skintimer , interval )
StartTimer(skintimer)


end,
skintimer
)

-------------------------------------------------------------------------
--resume normal conquest script, or whatever gamemode...
--------------------------------------------------------------------------

StartTimer(skintimer) --starts the timer the first time, after it starts, it will restart itself one ending.

--------------wait start the timer first! ok, now go...
---------------------------------------------------------------------
legion50x
Hidden/Spoiler:
OnTimerElapse(
function(timer)


if (skin == 1) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_ep3sniper")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_ep3sniper_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_ep3_Clone_Commander_Faie")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_ep3_Clone_Commander_Faie_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_Mandalorian_Soldier")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_Mandalorian_Soldier_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARC_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARC_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_WeStar_M5a")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_WeStar_M5s")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_wrist_caster")
SetClassProperty("rep_clone7", "GeometryName", "rep_inf_SandTrooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "rep_inf_SandTrooper_low1")
end
if (skin == 2) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
end



skin = skin + 1

if (skin > maxskin) then
skin = 1
end

--ShowTimer(nil)
--DestroyTimer(timer)



SetTimerValue(skintimer , interval )
StartTimer(skintimer)


end,
skintimer
)

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 11:27 am
by Ace_Azzameen_5
Did you forget ScriptCB_DoFile("50x") up at the top there, in XXXc.lua?

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 12:36 pm
by Deviss
Ace_Azzameen_5 wrote:Did you forget ScriptCB_DoFile("50x") up at the top there, in XXXc.lua?
i did it :S but dont work and in bfront2 log i got this now

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

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

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

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

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

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

legion50x_con.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

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

---------------------------------------------------------------------------
-- 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 ScriptPostLoad()

------------------------------------------------------------
--This is code for cycling rifleman models
------------------------------------------------------------
--KinetosImpetus

SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
--this little part ^ was for debugging really, it isn't necessary

-- Timer for skins--

--interval is the number of seconds between model changes
--maxskin is the number of versions to use

interval = 3 --i had been testing this at 10 second waves, but it could be changed
--in MP, it will probably cause each 15 second spawn-wave to be the same model
skintimer = CreateTimer("timeout") -- i don't know what significance "timeout" has, copied from hoth campaign this way
SetTimerValue(skintimer , interval )
--ShowTimer(skintimer ) --uncomment this line to see the timer onscreen
skin = 1
maxskin = 2

OnTimerElapse(
function(timer)


if (skin == 1) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_ep3sniper")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_ep3sniper_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_ep3_Clone_Commander_Faie")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_ep3_Clone_Commander_Faie_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_Mandalorian_Soldier")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_Mandalorian_Soldier_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARC_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARC_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_WeStar_M5a")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_WeStar_M5s")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_wrist_caster")
SetClassProperty("rep_clone7", "GeometryName", "rep_inf_SandTrooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "rep_inf_SandTrooper_low1")
end
if (skin == 2) then
SetClassProperty("rep_clone3", "GeometryName", "rep_inf_Death_Star_Gunner")
SetClassProperty("rep_clone3", "GeometryLowRes", "rep_inf_Death_Star_Gunner_low1")
SetClassProperty("rep_clone4", "GeometryName", "rep_inf_Clone_Marshall")
SetClassProperty("rep_clone4", "GeometryLowRes", "rep_inf_Clone_Marshall_low1")
SetClassProperty("rep_clone5", "GeometryName", "rep_inf_AT-RT_Driver")
SetClassProperty("rep_clone5", "GeometryLowRes", "rep_inf_AT-RT_Driver_low1")
SetClassProperty("rep_clone6", "GeometryName", "rep_inf_ARF_trooper")
SetClassProperty("rep_clone6", "GeometryLowRes", "rep_inf_ARF_trooper_low1")
SetClassProperty("rep_clone6", "WeaponName1", "rep_weap_inf_chaingun")
SetClassProperty("rep_clone6", "WeaponName2", "rep_weap_DC-15a_Carbine")
SetClassProperty("rep_clone6", "WeaponName4", "rep_weap_inf_fusioncutter")
SetClassProperty("rep_clone7", "GeometryName", "imp_inf_The_Force_Unleashed_EVO_Trooper")
SetClassProperty("rep_clone7", "GeometryLowRes", "imp_inf_The_Force_Unleashed_EVO_Trooper")
end



skin = skin + 1

if (skin > maxskin) then
skin = 1
end

--ShowTimer(nil)
--DestroyTimer(timer)



SetTimerValue(skintimer , interval )
StartTimer(skintimer)


end,
skintimer
)

end
-------------------------------------------------------------------------
--resume normal conquest script, or whatever gamemode...
--------------------------------------------------------------------------

StartTimer(skintimer) --starts the timer the first time, after it starts, it will restart itself one ending.

--------------wait start the timer first! ok, now go...
---------------------------------------------------------------------
xxxc_con.lua
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("legion50x_con")
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()

onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) then
SetProperty(GetCharacterUnit(character), "AddHealth", 50)
end
end)


MapAddClassMarker("cis_hero_jangofett", "hud_objective_icon_circle", 3.5, ATT, "YELLOW", true)
MapAddClassMarker("rep_hero_obiwan", "hud_objective_icon_circle", 3.5, DEF, "YELLOW", true)

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

playSound = OnCharacterSpawn(
function(player)
if GetEntityClass(player) == GetEntityClassPtr("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")
ReadDataFile("dc:Load\\BES2screen.lvl")


SetMaxFlyHeight(-5)
SetMaxPlayerFlyHeight (-5)

SetMemoryPoolSize ("Combo",1000) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1000) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",1000) -- should be ~1x #combo
SetMemoryPoolSize ("ClothData",400)
SetMemoryPoolSize ("EntityCloth",400)
SetMemoryPoolSize ("Music", 200)

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\\Republic.lvl",
"Republic_1",
"Republic_2",
"Republic_3",
"Republic_4",
"Republic_5",
"Republic_6",
"Republic_7",
"Republic_8",
"Republic_9")

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

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},
pilot = { "rep_clone2",3,4},
assault = { "rep_clone3",3,4},
sniper = { "rep_clone4",3,4},
marine = { "rep_clone5",3,4},
engineer = { "rep_clone6",3,4},
officer = { "rep_clone7",3,4},
special = { "rep_clone8",3,4},
commander = { "rep_clone9",1,2},

},
cis = {
team = CIS,
units = 40,
reinforcements = 150,
soldier = { "cis_droid1",8, 20},
pilot = { "cis_droid2",4,5},
assault = { "cis_droid3",4,5},
sniper = { "cis_droid4",4,5},
marine = { "cis_droid5",7,9},
engineer = { "cis_droid6",3,4},
officer = { "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, 9) -- 1x2 (1 pair of legs)
AddWalkerType(2, 9) -- 2x2 (2 pairs of legs)
AddWalkerType(3, 9) -- 3x2 (3 pairs of legs)
local weaponCnt = 1024
SetMemoryPoolSize("Aimer", 1024)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 40)
SetMemoryPoolSize("EntitySoundStatic", 320)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 1024)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoldierAnimation", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 640)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 1024)
SetMemoryPoolSize("UnitController", 1024)
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
:S any idea my father?

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 4:22 pm
by Aman/Pinguin
There's no need to load setup_teams.lua or setting team variables in your legion50x_con.lua, since it's already loaded&defined in xxxc_con.lua.
Don't know if that causes any problems, though.

EDIT: Just wondering, doesn't the ScriptPostLoad() function from xxxc_con.lua overwrite the one in legion50x_con.lua? So the legion50x_con.lua stuff doesn't get used at all? I'm doing alot PHP & mySQL stuff lately, so I might have mixed something wrong.

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 4:43 pm
by Deviss
Aman/Pinguin wrote:There's no need to load setup_teams.lua or setting team variables in your legion50x_con.lua, since it's already loaded&defined in xxxc_con.lua.
Don't know if that causes any problems, though.

EDIT: Just wondering, doesn't the ScriptPostLoad() function from xxxc_con.lua overwrite the one in legion50x_con.lua? So the legion50x_con.lua stuff doesn't get used at all? I'm doing alot PHP & mySQL stuff lately, so I might have mixed something wrong.
so i must put all in xxxc_con but how i put the description of properties in legion50x_con for this work using the one ScriptPostLoad() from xxxc_con ?? or i must remove that line from legion50x_con file ? :S

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 5:34 pm
by 501st_commander
Aman/Pinguin wrote:
EDIT: Just wondering, doesn't the ScriptPostLoad() function from xxxc_con.lua overwrite the one in legion50x_con.lua? So the legion50x_con.lua stuff doesn't get used at all? I'm doing alot PHP & mySQL stuff lately, so I might have mixed something wrong.

I would say yes. Same as php if you reference 2 classes, one gets bumped (aka. gives an error).
(i do a lot of php stuff also :D)

Re: is possible divide my lua in 2 parts??

Posted: Wed Sep 08, 2010 7:42 pm
by kinetosimpetus
Some of the space maps are split, with common scripts used by assault and ctf.

Re: is possible divide my lua in 2 parts??

Posted: Thu Sep 09, 2010 12:38 am
by Deviss
501st_commander wrote:
Aman/Pinguin wrote:
EDIT: Just wondering, doesn't the ScriptPostLoad() function from xxxc_con.lua overwrite the one in legion50x_con.lua? So the legion50x_con.lua stuff doesn't get used at all? I'm doing alot PHP & mySQL stuff lately, so I might have mixed something wrong.

I would say yes. Same as php if you reference 2 classes, one gets bumped (aka. gives an error).
(i do a lot of php stuff also :D)
so in legion50xc_con i only put random chunk and in xxxc_con whole complete but without setclassproperty lines ?? is very confuse for me sorry, for that reason i always ask xD

Re: is possible divide my lua in 2 parts??

Posted: Sun Sep 12, 2010 10:24 am
by 501st_commander
Well, i'll put it this way. ScriptPostLoad() is a class, and you can't have more than one. So if you merge ScriptPostLoad() with what you have in another lua, then remove that class, it may work.

Re: is possible divide my lua in 2 parts??

Posted: Sun Sep 12, 2010 11:36 am
by Deviss
501st_commander wrote:Well, i'll put it this way. ScriptPostLoad() is a class, and you can't have more than one. So if you merge ScriptPostLoad() with what you have in another lua, then remove that class, it may work.
i removed that line on legion50x_con.lua but anyway i have problems dividing random script chunk :S i am trying put timer on xxxc_con as darthduck said , and ontimerelapse with properties on legion50x_con but i cant, always error error and when no error, anyway dont work :S, please could anyone make the partition of files for me please :) ?

EDIT: or show me an example please :)

Re: is possible divide my lua in 2 parts??

Posted: Sun Sep 12, 2010 1:48 pm
by [RDH]Zerted
501st_commander wrote:...ScriptPostLoad() is a class, and you can't have more than one...
ScriptPostLoad is the name of the variable holding that function. If you load two script files with the variables in the same scope (if you don't know what scope is, ignore it) with the same names, the original ones get clobbered.

There are two main ways you do what you want:
1) Include your 50x script in each map. Each map will only have the models that you defined when you munged and released the map. You would keep an original version of the script and copy it into each map you make. Every time you update the original script, you would copy it into all the maps you want to have the updates.
2) Turn your models and 50x script into a lvl. Each map would reference this lvl. This allows you to update the lvl independently of the maps. Any of your shipped maps would get all the new random models whenever someone downloaded a new version of the lvl (which would be packaged with each new map). Depending on how you make the installer, you may or may not have to deal with people installing earlier versions of the lvl on top of newer ones.

Which one do you want?

Re: Is it possible to divide my lua into 2 parts?

Posted: Mon Sep 20, 2010 3:36 pm
by Deviss
[RDH]Zerted wrote:
501st_commander wrote:...ScriptPostLoad() is a class, and you can't have more than one...
ScriptPostLoad is the name of the variable holding that function. If you load two script files with the variables in the same scope (if you don't know what scope is, ignore it) with the same names, the original ones get clobbered.

There are two main ways you do what you want:
1) Include your 50x script in each map. Each map will only have the models that you defined when you munged and released the map. You would keep an original version of the script and copy it into each map you make. Every time you update the original script, you would copy it into all the maps you want to have the updates.
2) Turn your models and 50x script into a lvl. Each map would reference this lvl. This allows you to update the lvl independently of the maps. Any of your shipped maps would get all the new random models whenever someone downloaded a new version of the lvl (which would be packaged with each new map). Depending on how you make the installer, you may or may not have to deal with people installing earlier versions of the lvl on top of newer ones.

Which one do you want?
the second choice please please :D

Don't bump your topic if you're not adding anything. -Staff