Page 2 of 2

Re: 2 questions: Changing weapons and adding a class

Posted: Sun Jan 04, 2015 4:54 pm
by superimperial11
Anakin wrote:Looks good so far. your lua should look like that:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

ReadDataFile("dc:common.lvl")
ReadDataFile("common.lvl")

-- REP Attacking (attacker is always #1)
REP = 1
CIS = 2
GEONO = 3
CLONEDEA = 4
JEDI = 5
CLONECON = 6
-- These variables do not change
ATT = 1
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()
cp1 = CommandPost:New{name = "cp1"}
cp2 = CommandPost:New{name = "cp2"}
cp3 = CommandPost:New{name = "cp3"}
cp4 = CommandPost:New{name = "cp4"}
cp6 = CommandPost:New{name = "cp6"}
cp7 = CommandPost:New{name = "cp7"}
cp8 = CommandPost:New{name = "cp8"}

--This sets up the actual objective. This needs to happen after cp's are defined
conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "level.geo1.objectives.conquest", 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(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)

conquest:Start()
SetUberMode(1)
EnableSPHeroRules()

AddDeathRegion("deathregion")
AddDeathRegion("deathregion2")
AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")
AddDeathRegion("deathregion5")

SetProperty("cp1", "AllyPath", "cp1_spawn")
SetProperty("cp2", "AllyPath", "cp2_spawn")
SetProperty("cp3", "AllyPath", "cp3_spawn")
SetProperty("cp4", "AllyPath", "cp4_spawn")
SetProperty("cp6", "AllyPath", "cp6_spawn")
SetProperty("cp7", "AllyPath", "cp7_spawn")
SetProperty("cp8", "AllyPath", "cp8_spawn")

end

function ScriptInit()
ReadDataFile("dc:Load\\RCM_Load.lvl")

StealArtistHeap(800*1024)
-- Designers, these two lines *MUST* be first.
SetPS2ModelMemory(3500000)

SetMemoryPoolSize("ParticleTransformer::SizeTransf", 2500)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 2500)
SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo

local screenWidth, screenHeight = ScriptCB_GetScreenInfo()
local aspectRatio = screenWidth / screenHeight

ReadDataFile("dc:SIDE\\fpanimset.lvl")

if aspectRatio <= 1.4 then
print("RCM_loading: Aspect Ratio 4:3 detected")
ReadDataFile("dc:HUD\\hud43.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
print("RCM_loading: Aspect Ratio 16:10 detected")
ReadDataFile("dc:HUD\\hud1610.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
print("RCM_loading: Aspect Ratio 16:9 detected")
ReadDataFile("dc:HUD\\hud169.lvl")
ReadDataFile("ingame.lvl")
ReadDataFile("dc:HUD\\hudBmpKill.lvl")
else
print("RCM_loading: Aspect Ratio unkown. Loading stock HUD.")
ReadDataFile("dc:HUD\\hudUnknown.lvl")
ReadDataFile("ingame.lvl")
end



SetTeamAggressiveness(CIS, 1.0)
SetTeamAggressiveness(REP, 0.5)

SetMemoryPoolSize("Music", 40)
ReadDataFile("dc:sound\\rcm.lvl;comSnd")
ReadDataFile("dc:sound\\rcm.lvl")
ReadDataFile("sound\\geo.lvl;geo1cw")

ReadDataFile("SIDE\\jed.lvl",
"jed_knight_01",
"jed_knight_02",
"jed_knight_03",
"jed_master_01",
"jed_master_02")

ReadDataFile("SIDE\\cis.lvl",
"cis_fly_droidfighter_dome",
--"cis_fly_geofighter",
"cis_tread_hailfire",
"cis_hover_stap",
"cis_walk_spider")

ReadDataFile("SIDE\\rep.lvl",
"rep_fly_assault_dome",
"rep_fly_gunship_dome",
"rep_hover_fightertank",
--"rep_fly_gunship",
--"rep_bldg_forwardcenter",
"rep_fly_jedifighter_dome",
"rep_walk_atte")

ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_commando_01_rifleman",
"rep_inf_commando_02_roketeer",
"rep_inf_commando_03_sniper",
"rep_inf_commando_04_engineer",
"rep_inf_commando_05_electronic",
"rep_inf_commando_06_sergeant",
"rep_inf_commando_07_havoc",
"rep_inf_commando_08_elite")

ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_b1_rifleman",
"cis_inf_b1_rocketeer",
"cis_inf_b1_sniper",
"cis_inf_sbd",
"cis_inf_magnaguard",
"cis_inf_droideka")

ReadDataFile("dc:SIDE\\geo.lvl",
"geo_inf_geonosian",
"geo_inf_geonosian_elite")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_geoturret")

ReadDataFile("dc:SIDE\\rrl.lvl",
"rrl_inf_ep2_rifleman",
"rrl_inf_ep2_commander",
"rrl_inf_ep2_jettrooper")

-- GEOS ---------------------------
SetTeamName(3, "locals")
AddUnitClass(3, "geo_inf_geonosian", 7)
AddUnitClass(3, "geo_inf_geonosian_elite", 7)
SetUnitCount(3, 7)
AddAIGoal(GEONO, "Deathmatch", 100)
-----------------------------------

-- Jedi ---------------------------
SetTeamName (5, "jedi")
AddUnitClass(5, "jed_knight_01",4)
AddUnitClass(5, "jed_knight_02",4)
AddUnitClass(5, "jed_knight_03",4)
AddUnitClass(5, "jed_master_01",2)
AddUnitClass(5, "jed_master_02",2)
SetUnitCount (5, 10)
AddAIGoal(JEDI, "Deathmatch", 100)
-----------------------------------

-- Clones -------------------------
SetTeamName (4, "clone")
AddUnitClass (4, "rrl_inf_ep2_rifleman", 15)
AddUnitClass (4, "rrl_inf_ep2_jettrooper", 5)
AddUnitClass(4, "rrl_inf_ep2_commander",3)
SetUnitCount (4, 8)
AddAIGoal(CLONEDEA, "Deathmatch", 100)
-----------------------------------

-- Clones -------------------------
SetTeamName (6, "clone")
AddUnitClass (6, "rrl_inf_ep2_rifleman", 15)
AddUnitClass (6, "rrl_inf_ep2_jettrooper", 5)
AddUnitClass(6, "rrl_inf_ep2_commander",3)
SetUnitCount (6, 7)
AddAIGoal(CLONECON, "Conquest", 100)
-----------------------------------

-- Friends ------------------------
SetTeamAsFriend(REP,JEDI)
SetTeamAsFriend(JEDI,REP)

SetTeamAsFriend(REP,CLONECON)
SetTeamAsFriend(CLONECON,REP)

SetTeamAsFriend(REP,CLONEDEA)
SetTeamAsFriend(CLONEDEA,REP)

SetTeamAsFriend(JEDI,CLONECON)
SetTeamAsFriend(CLONECON,JEDI)

SetTeamAsFriend(JEDI,CLONEDEA)
SetTeamAsFriend(CLONEDEA,JEDI)

SetTeamAsFriend(CLONECON,CLONEDEA)
SetTeamAsFriend(CLONEDEA,CLONECON)

SetTeamAsFriend(CIS,GEONO)
SetTeamAsFriend(GEONO,CIS)
-----------------------------------

-- Enemys -------------------------
SetTeamAsEnemy(REP,GEONO)
SetTeamAsEnemy(GEONO,REP)

SetTeamAsEnemy(GEONO,JEDI)
SetTeamAsEnemy(JEDI,GEONO)

SetTeamAsEnemy(GEONO,CLONECON)
SetTeamAsEnemy(CLONECON,GEONO)

SetTeamAsEnemy(GEONO,CLONEDEA)
SetTeamAsEnemy(CLONEDEA,GEONO)

SetTeamAsEnemy(CIS,JEDI)
SetTeamAsEnemy(JEDI,CIS)

SetTeamAsEnemy(CIS,CLONECON)
SetTeamAsEnemy(CLONECON,CIS)

SetTeamAsEnemy(CIS,CLONEDEA)
SetTeamAsEnemy(CLONEDEA,CIS)
-----------------------------------

-- Level Stats

ClearWalkers()
SetMemoryPoolSize("EntityWalker", -1)
AddWalkerType(0, 3) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(2, 3) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponcnt = 300
SetMemoryPoolSize("Aimer", 100)
SetMemoryPoolSize("AmmoCounter", weaponcnt)
SetMemoryPoolSize("BaseHint", 100)
SetMemoryPoolSize("CommandWalker", 1)
SetMemoryPoolSize("EnergyBar", weaponcnt)
SetMemoryPoolSize("EntityFlyer", 6)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 50)
SetMemoryPoolSize("EntityCloth", 50)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("MountedTurret", 10)
SetMemoryPoolSize("Navigator", 70)
SetMemoryPoolSize("Obstacle", 450)
SetMemoryPoolSize("PathFollower", 70)
SetMemoryPoolSize("PathNode", 100)
SetMemoryPoolSize("TreeGridStack", 300)
SetMemoryPoolSize("UnitAgent", 70)
SetMemoryPoolSize("UnitController", 70)
SetMemoryPoolSize("Weapon", weaponcnt)
SetMemoryPoolSize("SoldierAnimation", 580)

SetSpawnDelay(10.0, 0.25)

SetupTeams{
rep = {
team = REP,
units = 16,
reinforcements = 150,
soldier = { "rep_inf_commando_01_rifleman",9, 25},
assault = { "rep_inf_commando_02_roketeer",1,4},
sniper = { "rep_inf_commando_03_sniper",1,4},
engineer= { "rep_inf_commando_04_engineer",1,4},
officer = { "rep_inf_commando_05_electronic",1,4},
special = { "rep_inf_commando_06_sergeant",1,4},
commander={ "rep_inf_commando_07_havoc", 1, 4},
general = { "rep_inf_commando_08_elite", 1, 2}
},
cis = {
team = CIS,
units = 32,
reinforcements = 300,
soldier = {"cis_inf_b1_rifleman",10, 30},
assault = {"cis_inf_b1_rocketeer",1, 4},
sniper = {"cis_inf_b1_sniper",1, 4},
engineer= {"geo_inf_geonosian",1, 6},
officer = {"cis_inf_sbd",1, 2},
special = {"geo_inf_geonosian_elite", 1, 2},
commander={"cis_inf_droideka", 1, 2},
general = {"cis_inf_magnaguard", 1, 2},
}
}




-- Attacker Stats

--teamATT = ConquestTeam:New{team = ATT}
--teamATT:AddBleedThreshold(21, 0.75)
--teamATT:AddBleedThreshold(11, 2.25)
--teamATT:AddBleedThreshold(1, 3.0)
--teamATT:Init()

-- Defender Stats

--teamDEF = ConquestTeam:New{team = DEF}
--teamDEF:AddBleedThreshold(21, 0.75)
--teamDEF:AddBleedThreshold(11, 2.25)
--teamDEF:AddBleedThreshold(1, 3.0)
--teamDEF:Init()

-- Local Stats

--SetTeamName(4, "locals")
--AddUnitClass(4, "rep_inf_jedimale",1)
--AddUnitClass(4, "rep_inf_jedimaleb",1)
--AddUnitClass(4, "rep_inf_jedimaley",1)
--SetUnitCount(4, 3)
--SetTeamAsFriend(4, ATT)

ReadDataFile("GEO\\geo1.lvl", "geo1_conquest")

SetDenseEnvironment("false")
SetMinFlyHeight(-65)
SetMaxFlyHeight(50)
SetMaxPlayerFlyHeight(50)



-- Birdies
--SetNumBirdTypes(1)
--SetBirdType(0.0,10.0,"dragon")
--SetBirdFlockMinHeight(90.0)

-- 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\\rcm.lvl", "rcm_music")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\geo.lvl", "geo1cw")
OpenAudioStream("sound\\geo.lvl", "geo1cw")

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_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_amb_end", 2,1)

SetVictoryMusic(REP, "rep_geo_amb_victory")
SetDefeatMusic (REP, "rep_geo_amb_defeat")
SetVictoryMusic(CIS, "cis_geo_amb_victory")
SetDefeatMusic (CIS, "cis_geo_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")


--ActivateBonus(CIS, "SNEAK_ATTACK")
--ActivateBonus(REP, "SNEAK_ATTACK")

SetAttackingTeam(ATT)

--Opening Satalite Shot
--Geo
--Mountain
AddCameraShot(0.996091, 0.085528, -0.022005, 0.001889, -6.942698, -59.197201, 26.136919)
--Wrecked Ship
AddCameraShot(0.906778, 0.081875, -0.411906, 0.037192, 26.373968, -59.937874, 122.553581)
--War Room
--AddCameraShot(0.994219, 0.074374, 0.077228, -0.005777, 90.939568, -49.293945, -69.571136)



if aspectRatio <= 1.4 then
ReadDataFile("dc:SIDE\\43.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.63 and aspectRatio >= 1.5 then
ReadDataFile("dc:SIDE\\1610.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
elseif aspectRatio <= 1.9 and aspectRatio >= 1.63 then
ReadDataFile("dc:SIDE\\169.lvl")
ReadDataFile("dc:HUD\\hudTxtKill.lvl")
else
ReadDataFile("dc:SIDE\\unkown.lvl")
end


end

[/code]

Code: Select all

ReadDataFile("sound\\geo.lvl;geo1cw")
This is the special line it need to be gcw. not cw. if you have something like that in your lua everything is ok. (i think you made a tat map, so it should be something like

Code: Select all

ReadDataFile("sound\\tat.lvl;tat2gcw")
For my current map I still have Yavin terrain and sky, so would it be:

Code: Select all

ReadDataFile(sound\\yav.lv;yav1gcw")
Or would I add another line to my lua that says:

Code: Select all

ReadDataFile("sound\\yav.lvl;yav1gcw")
Basically I am asking do I replace the line, or add the line?

Re: 2 questions: Changing weapons and adding a class

Posted: Sun Jan 04, 2015 5:36 pm
by Anakin
If there still is an gcw sound file loaded it should work fine. Can you post an error log again??

Re: 2 questions: Changing weapons and adding a class

Posted: Sun Jan 04, 2015 5:45 pm
by superimperial11
Is this what you are looking for?
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2015-01-04 1340
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy english 0
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: No custom_gc_5.lvl
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: No custom_gc_10.lvl[/code]
Wait, I forgot the sound file. Where do I get that? Yesterday I was searching for it but I couldn't find it.

Re: 2 questions: Changing weapons and adding a class

Posted: Mon Jan 05, 2015 11:17 am
by Anakin
This is just a part of the log. please have a look at this. you posted the most uninformative part of the log.

the sound files go to an own lvl file. if you want to learn more about it you can find answers here if you look at the entries under sound.
every map has for each era an own soundfile that contains it's sounds. so f you are using an gcw era stock sound make sure that in the lua any map's gcw soundfile is loaded. if you are using an cw stock sound you need to load an world's cw sound lvl. you needn't munge a new soundfile if you are only using stock sounds.

Re: 2 questions: Changing weapons and adding a class

Posted: Mon Jan 05, 2015 1:32 pm
by superimperial11
I've read both and I couldn't find answers there. What I was asking is where to find or place the sound file.

Re: 2 questions: Changing weapons and adding a class

Posted: Mon Jan 05, 2015 2:44 pm
by hunpeter12
Read this tutorial. I think it's what you're looking for.