Page 22 of 58

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Sun Jan 30, 2011 9:16 pm
by THEWULFMAN
Okay to clarify to everone.

My mod takes place in the first and second seasons of the show, and the first 3 episodes of season 3. I cant keep updating it forever or it will never get done.

Mini update, new icon for the republic, I modeled it mydself 100%
Hidden/Spoiler:
ImageImage
All modding will be dalayed for awhile, my ac adapter died and I am posting this with my last battery power.
Keep modding everyone, :plokoon: I will return.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Sun Jan 30, 2011 10:34 pm
by Firefang
Great Model. Keep up the good work!

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 10:02 am
by Anakin
It's great you're really good :thumbs:

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 11:26 am
by commander501stappo
Very cool :yes:

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 7:23 pm
by LO65
1 word AWESOME

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 10:56 pm
by THEWULFMAN
Thanks everyone :D

Okay, I repaired my ac adapter chord untill I can afford a new one.

I am going to be doing alot of lua work. I need to set up my random scripts so that I can have the heroes localized right. Now they are just Localized as Republic Hero, or CIS Hero. Why you ask?
Well, I am trying to have the heros randomized WITH the clone legions, not seperatly. Right now they are just rep_hero_all, so that no matter what it will always read the hero. but its kinda wierd. I am not great at lua so I need to work hard. :runaway: :faint:

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 11:01 pm
by Maveritchell
THEWULFMAN wrote:I am going to be doing alot of lua work. I need to set up my random scripts so that I can have the heroes localized right. Now they are just Localized as Republic Hero, or CIS Hero. Why you ask?
Well, I am trying to have the heros randomized WITH the clone legions, not seperatly. Right now they are just rep_hero_all, so that no matter what it will always read the hero. but its kinda wierd. I am not great at lua so I need to work hard. :runaway: :faint:
That's effectively nothing different from what is used in Dark Times. The scripts that are provided to help people add the era to their map can also be used as an example.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Jan 31, 2011 11:08 pm
by THEWULFMAN
I am trying to use your scripts to give me an idea what needs to be done. I just need to creat a string for each class, because I also have a team that doesnt have the same names. I am happy that you are trying to help me mav :yes: I always could use help from the master :D

this is what my randomlegion script looks like now
Hidden/Spoiler:
--
-- Random Sides Script for Star Wars Battlefront II Copyright (c) 2007 A.A.5. Productionzorz, All rights reserved.
-- Side Setup Script, Star Wars Battlefront II and Zero Engine Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
function RandomLegion()
if unexpected_condition then error() end
CloneLegion = math.random(1,18) --Pic a number between 1 and 10

if CloneLegion <4 then --if math.random results in 2 or three (and maybe 1) 187th
ReadDataFile("dc:SIDE\\187th.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_ponds")
end


if CloneLegion >3 and CloneLegion <7 then --if math.random results in 4 or 6 212th
ReadDataFile("dc:SIDE\\212th.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_cody")
end

if CloneLegion >6 and CloneLegion <10 then --if math.random results in 7 or 9 327th
ReadDataFile("dc:SIDE\\433rd.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_wolffe")
end

if CloneLegion >9 and CloneLegion <13 then --if math.random results in 10 or 12 501st
ReadDataFile("dc:SIDE\\501st.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_rex")
end
if CloneLegion >12 and CloneLegion <16 then --if math.random results in 13 or 15 91st
ReadDataFile("dc:SIDE\\327th.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_bly")
end
if CloneLegion >15 and CloneLegion <19 then --if math.random results in 16 or 18 Kota's Militia
ReadDataFile("dc:SIDE\\milita.lvl",
"rep_hero_all",
"rep_inf_tcw_rifleman",
"rep_inf_tcw_rocketeer_chaingun",
"rep_inf_tcw_sniper",
"rep_inf_tcw_medic",
"rep_inf_tcw_engineer",
"rep_inf_tcw_lightrifleman",
"rep_inf_tcw_jettrooper",
"rep_inf_tcw_specialist",
"rep_inf_tcw_gunny")
end
end

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Tue Feb 01, 2011 12:00 am
by Maveritchell
THEWULFMAN wrote:I am trying to use your scripts to give me an idea what needs to be done. I just need to creat a string for each class, because I also have a team that doesnt have the same names. I am happy that you are trying to help me mav :yes: I always could use help from the master :D
My point is that you can store string names as variables in the .lua. In the DT scripts, teams were loaded in like this:
Hidden/Spoiler:
[code] ReadDataFile("dc:SIDE\\dark.lvl",
"all_hero_bail",
allsoldier,
allheavy,
allmarksman,
"all_inf_moncaleng",
allsupport,
bothan,
impsoldier,
impmarksman,
impheavy,
"imp_inf_gunner",
impsupport,
"imp_inf_commando",
"imp_inf_jumptrooper",
supportstrAll,
supportstrEmp)

ReadDataFile("dc:SIDE\\lead.lvl",
herostrAll,
herostrEmp)

SetupTeams{
all = {
team = ALL,
units = 20,
reinforcements = 150,
soldier = { allsoldier,9, 25},
assault = { allheavy,1,4},
engineer = { "all_inf_moncaleng",1,4},
sniper = { allmarksman,1,4},
officer = { allsupport,1,4},
special = { bothan,1,4},

},
imp = {
team = IMP,
units = 20,
reinforcements = 150,
soldier = { impsoldier,9, 25},
assault = { impheavy,1,4},
engineer = { "imp_inf_gunner",1,4},
sniper = { impmarksman,1,4},
officer = { impsupport,1,4},
special = { "imp_inf_jumptrooper",1,4},
},

}

AddUnitClass(IMP, supportstrEmp, 1, 4)
AddUnitClass(ALL, supportstrAll, 1, 4)

if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end[/code]
All of those there not surrounded by quotation marks are variables, and they're selected based on a previously randomly generated number. You don't need to have each hero take the same name (nor do you necessarily need to have each grouping of units in a separate side), you can call your hero whatever, tell the .lua to load in a variable for the hero (SetHeroClass(REP, herovariable)) and in your random script assign a string value to that hero variable based on the results of your random number.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Tue Feb 01, 2011 3:05 pm
by THEWULFMAN
Okay, I spent 5 hours reworking everything. I tried my best but it doesnt work. This is my lua script.
Hidden/Spoiler:
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("AIHeroSupport")

function ScriptPostLoad()

local republiclegion = 0

local herosepertist = 0

hriflemanstrRep = 0
heavystrRep = 0
sniperstrRep = 0
engineerstrRep = 0
lriflemanstrRep = 0
sriflemanstrRep = 0
jettrooperstrRep = 0
specialstrRep = 0
commanderstrRep = 0
herostrRep = 0

herostrCis = 0

local anakinishere = 0

local republiclegionand = math.random(1, 6)


if republiclegionand == 1 then
hriflemanstrRep = "rep_inf_tcw_rifleman_187th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_187th"
sniperstrRep = "rep_inf_tcw_sniper_187th"
engineerstrRep = "rep_inf_tcw_engineer_187th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_187th"
sriflemanstrRep = "rep_inf_tcw_medic_187th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_187th"
specialstrRep = "rep_inf_tcw_specialist_187th"
commanderstrRep = "rep_inf_tcw_ponds"
herostrRep = "rep_inf_tcw_mace"

elseif republiclegionand == 2 then
hriflemanstrRep = "rep_inf_tcw_rifleman_212th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_212th"
sniperstrRep = "rep_inf_tcw_sniper_212th"
engineerstrRep = "rep_inf_tcw_engineer_212th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_212th"
sriflemanstrRep = "rep_inf_tcw_medic_212th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_212th"
specialstrRep = "rep_inf_tcw_specialist_212th"
commanderstrRep = "rep_inf_tcw_cody"
herostrRep = "rep_inf_tcw_obiwan"

elseif republiclegionand == 3 then
hriflemanstrRep = "rep_inf_tcw_rifleman_433rd"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_433rd"
sniperstrRep = "rep_inf_tcw_sniper_433rd"
engineerstrRep = "rep_inf_tcw_engineer_433rd"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_433rd"
sriflemanstrRep = "rep_inf_tcw_medic_433rd"
jettrooperstrRep = "rep_inf_tcw_jettrooper_433rd"
specialstrRep = "rep_inf_tcw_specialist_433rd"
commanderstrRep = "rep_inf_tcw_wolffe"
herostrRep = "rep_inf_tcw_plokoon"

elseif republiclegionand == 4 then
anakinishere = 1
hriflemanstrRep = "rep_inf_tcw_rifleman_501st"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_501st"
sniperstrRep = "rep_inf_tcw_sniper_501st"
engineerstrRep = "rep_inf_tcw_engineer_501st"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_501st"
sriflemanstrRep = "rep_inf_tcw_medic_501st"
jettrooperstrRep = "rep_inf_tcw_jettrooper_501st"
specialstrRep = "rep_inf_tcw_specialist_501st"
commanderstrRep = "rep_inf_tcw_rex"
herostrRep = "rep_inf_tcw_anakin"

elseif republiclegionand == 5 then
hriflemanstrRep = "rep_inf_tcw_rifleman_327th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_327th"
sniperstrRep = "rep_inf_tcw_sniper_327th"
engineerstrRep = "rep_inf_tcw_engineer_327th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_327th"
sriflemanstrRep = "rep_inf_tcw_medic_327th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_327th"
specialstrRep = "rep_inf_tcw_specialist_327th"
commanderstrRep = "rep_inf_tcw_bly"
herostrRep = "rep_inf_tcw_aayla"

elseif republiclegionand == 6 then
hriflemanstrRep = "rep_inf_tcw_rifleman_militia"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_militia"
sniperstrRep = "rep_inf_tcw_sniper_militia"
engineerstrRep = "rep_inf_tcw_engineer_militia"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_militia"
sriflemanstrRep = "rep_inf_tcw_medic_militia"
jettrooperstrRep = "rep_inf_tcw_jettrooper_militia"
specialstrRep = "rep_inf_tcw_specialist_militia"
commanderstrRep = "rep_inf_tcw_gunny"
herostrRep = "rep_inf_tcw_kota"

end


local herosepertistand = math.random(1, 6)


if herosepertistand == 1 then
herostrCis = "cis_hero_ventress"

elseif herosepertistand == 2 then
if anakinishere == 1 then
herostrCis = "cis_hero_ventress"
else
herostrCis = "cis_hero_grievous"
end

elseif herosepertistand == 3 then
herostrCis = "cis_hero_jedihunter"

elseif herosepertistand == 4 then
herostrCis = "cis_hero_bane"

elseif herosepertistand == 5 then
herostrCis = "cis_hero_magnaguard"

elseif herosepertistand == 6 then
herostrCis = "cis_hero_dooku"

end


WeatherMode = math.random(1,2)
weather()

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

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, 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(cp6)
conquest:AddCommandPost(cp7)
conquest:AddCommandPost(cp8)

conquest:Start()

SetUberMode(1);

AddAIGoal(1, "conquest", 1000)
AddAIGoal(2, "conquest", 1000)
AddAIGoal(3, "conquest", 1000)

EnableSPHeroRules()
if not ScriptCB_InMultiplayer() then
herosupport = AIHeroSupport:New{AIATTHeroHealth = 2500, AIDEFHeroHealth = 2500, gameMode = "NonConquest",}
herosupport:SetHeroClass(REP, herostrRep)
herosupport:SetHeroClass(CIS, herostrCis)
herosupport:AddSpawnCP("CP1","CP1_SpawnPath")
herosupport:AddSpawnCP("CP2","CP2_SpawnPath")
herosupport:AddSpawnCP("CP3","CP3_SpawnPath")
herosupport:AddSpawnCP("CP6","CP6_SpawnPath")
herosupport:AddSpawnCP("CP7","CP9SpawnPath")
herosupport:AddSpawnCP("CP8","CP8SpawnPath")
herosupport:Start()
else
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()
-- Designers, these two lines *MUST* be first!
StealArtistHeap(256*1024)
SetPS2ModelMemory(2097152 + 65536 * 10)

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


-- Republic Attacking (attacker is always #1)
DES = 3
-- These variables do not change
ATT = 1
DEF = 2


if not ScriptCB_InMultiplayer() then
CIS = math.random(1,2)
REP = (3 - CIS)
else
REP = 1
CIS = 2
end

SetMemoryPoolSize ("Music",200)

SetMemoryPoolSize ("SoldierAnimation", 800)
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

-- SetTeamAggressiveness(REP, 0.959)
-- SetTeamAggressiveness(CIS, 0.999)

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2cw")
ReadDataFile("dc:sound\\tcw.lvl;tcwcw")
ReadDataFile("dc:sound\\sws.lvl;swscw")

ReadDataFile("dc:SIDE\\tcwrep.lvl",
hriflemanstrRep,
heavystrRep,
sniperstrRep,
engineerstrRep,
lriflemanstrRep,
sriflemanstrRep,
jettrooperstrRep,
specialstrRep,
commanderstrRep,
herostrRep)

ReadDataFile("dc:SIDE\\cisheroes.lvl",
herostrCis)

ReadDataFile("dc:SIDE\\VEH.lvl",
"cis_hover_aat")
ReadDataFile("dc:SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_droideka",
"cis_inf_officer",
"cis_inf_pilot",
"cis_inf_airdroid",
"cis_inf_superairdroid",
"cis_inf_marine")

ReadDataFile("dc:SIDE\\criminal.lvl",
"all_inf_wookiee",
"all_inf_twilek_merc",
"all_inf_rocketeer",
"all_inf_nato",
"all_inf_marine",
"all_inf_engineer",
"all_inf_ithorianer",
"all_inf_rifleman")


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

SetAttackingTeam(ATT)

SetupTeams{
rep = {
team = REP,
units = 26,
reinforcements = 230,
soldier = { hriflemanstrRep,7, 18},
assault = { heavystrRep,1, 4},
engineer = { engineerstrRep,1, 4},
sniper = { sniperstrRep,1, 3},
officer = { lriflemanstrRep,4, 6},
special = { sriflemanstrRep,1, 4},

},
cis = {
team = CIS,
units = 50,
reinforcements = 300,
soldier = { "cis_inf_marine",22, 55},
assault = { "cis_inf_rifleman",4, 6},
engineer = { "cis_inf_engineer",1, 3},
sniper = { "cis_inf_sniper",1, 2},
officer = { "cis_inf_airdroid",1, 2},
special = { "cis_inf_pilot",1, 2},
}
}

-- Civilians --------------------------
SetTeamName (3, "locals")
SetTeamIcon(3, "com_icon_alliance")
AddUnitClass (3, "all_inf_wookiee", 1)
AddUnitClass (3, "all_inf_nato", 1)
AddUnitClass (3, "all_inf_marine", 1)
AddUnitClass (3, "all_inf_twilek_merc", 1)
AddUnitClass (3, "all_inf_rocketeer", 1)
AddUnitClass (3, "all_inf_ithorianer", 1)
AddUnitClass (3, "all_inf_engineer", 1)
AddUnitClass (3, "all_inf_rifleman", 1)
SetUnitCount (3, 8)
SetTeamAsEnemy(3,CIS)
SetTeamAsEnemy(3,CIS)
SetTeamAsEnemy(REP,3)
SetTeamAsEnemy(REP,3)
-----------------------------------

AddUnitClass(REP, jettrooperstrRep,1, 3)
AddUnitClass(REP, specialstrRep,1, 2)
AddUnitClass(REP, commanderstrRep,1, 1)
AddUnitClass(CIS, "cis_inf_superairdroid",1, 2)
AddUnitClass(CIS, "cis_inf_droideka",2, 4)
AddUnitClass(CIS, "cis_inf_officer",1, 2)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 4) -- 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 = 260
SetMemoryPoolSize("Aimer", 44)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 325)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 19)
SetMemoryPoolSize("EntityFlyer", 6) -- to account for rocket upgrade
SetMemoryPoolSize("EntityHover", 1)
SetMemoryPoolSize("SoldierAnimation", 500)
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntityLight", 300)
SetMemoryPoolSize("EntitySoundStatic", 43)
SetMemoryPoolSize("MountedTurret", 15)
SetMemoryPoolSize("Navigator", 70)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("PathFollower", 90)
SetMemoryPoolSize("PathNode", 316)
SetMemoryPoolSize("TreeGridStack", 325)
SetMemoryPoolSize("UnitAgent", 70)
SetMemoryPoolSize("UnitController", 70)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
function weather()
if WeatherMode == 1 then
ReadDataFile("TAT\\tat2.lvl", "tat2_con")
SetAIViewMultiplier(1.1)
SetDenseEnvironment("false")
elseif WeatherMode == 2 then
ReadDataFile("dc:TAT\\tat2.lvl", "tat2_con")
SetAIViewMultiplier(0.40)
SetDenseEnvironment("true")
end
end


-- Sound Stats

voiceSlow = OpenAudioStream("sound\\global.lvl", "rep_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "des_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\\tcw.lvl", "tcwcw_music");
OpenAudioStream("dc:sound\\tcw.lvl", "tcw");
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")

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_tcw_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_tcw_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_tcw_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "rep_tcw_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "rep_tcw_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "rep_tcw_amb_end", 2,1)

SetVictoryMusic(REP, "rep_tcw_amb_victory")
SetDefeatMusic (REP, "rep_tcw_amb_victory")
SetVictoryMusic(CIS, "rep_tcw_amb_victory")
SetDefeatMusic (CIS, "rep_tcw_amb_victory")

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


SetAttackingTeam(ATT)

-- Camera Stats
--Tat2 Mos Eisley
AddCameraShot(0.974338, -0.222180, 0.035172, 0.008020, -82.664650, 23.668301, 43.955681);
AddCameraShot(0.390197, -0.089729, -0.893040, -0.205362, 23.563562, 12.914885, -101.465561);
AddCameraShot(0.169759, 0.002225, -0.985398, 0.012916, 126.972809, 4.039628, -22.020613);
AddCameraShot(0.677453, -0.041535, 0.733016, 0.044942, 97.517807, 4.039628, 36.853477);
AddCameraShot(0.866029, -0.156506, 0.467299, 0.084449, 7.685640, 7.130688, -10.895234);
end
but I get this error
Hidden/Spoiler:
Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\LuaHelper.cpp(312)
CallProc failed: bad argument #2 to `RetailAddUnitClass' (string expected, got nil)
stack traceback:
[C]: in function `RetailAddUnitClass'
(none): in function `AddUnitClass'
(none): in function `SetupTeams'
(none): in function `ScriptInit'
I dont even know if am on the right track....

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Tue Feb 01, 2011 3:52 pm
by Maveritchell
Your problem is that you're not randomly selecting your units until after you've already loaded the level (all your random work is done in ScriptPostLoad). It's easiest to create a simple separate .lua file used for the random unit selection (just like the example "TFURandom.lua") and load that in at the beginning of ScriptInit.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Tue Feb 01, 2011 10:02 pm
by SAMofBIA
AHHH, the intelligent conversation hurts my brain :runaway: ....its also very intruiging.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Wed Feb 02, 2011 9:57 am
by skelltor
Sorry to bring this a bit offtopic but Mav are you saying that only one lua loaded in scriptpostload can do random units and all lua being used in a mod are not needed to be edited other than the scriptpostload?

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Wed Feb 02, 2011 10:37 pm
by THEWULFMAN
Maveritchell wrote:Your problem is that you're not randomly selecting your units until after you've already loaded the level (all your random work is done in ScriptPostLoad). It's easiest to create a simple separate .lua file used for the random unit selection (just like the example "TFURandom.lua") and load that in at the beginning of ScriptInit.

Thanks so much :D
I reveresed engineered your scripts and tried out a couple things and I got it working, beautifully. Even the extra bit about anakinishere = 1, preventing anakin and grievous to appear on the same map. Thanks again, you are a magician when it comes to lua scripting, no one is better.
Spira is evidence of that.

I set it up like this

TCWRandom.lua
Hidden/Spoiler:
--
-- by Maveritchell, edited by THEWULFMAN
--

function DecideUnits(mace, obiwan, plokoon, anakin, aayla, kota, yoda, ventress, grievous, jedihunter, bane, bossk, magnaguard, dooku)

local herorepublic = mace + obiwan + plokoon + anakin + aayla + kota + yoda
local herosepertist = ventress + grievous + jedihunter + bane + bossk + magnaguard + dooku

hriflemanstrRep = 0
heavystrRep = 0
sniperstrRep = 0
engineerstrRep = 0
lriflemanstrRep = 0
sriflemanstrRep = 0
jettrooperstrRep = 0
specialstrRep = 0
commanderstrRep = 0
herostrRep = 0

herostrCis = 0

local anakinishere = 0

local herorepublicand = math.random(1, herorepublic)


if herorepublicand <= mace then
hriflemanstrRep = "rep_inf_tcw_rifleman_187th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_187th"
sniperstrRep = "rep_inf_tcw_sniper_187th"
engineerstrRep = "rep_inf_tcw_engineer_187th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_187th"
sriflemanstrRep = "rep_inf_tcw_medic_187th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_187th"
specialstrRep = "rep_inf_tcw_specialist_187th"
commanderstrRep = "rep_inf_tcw_ponds"
herostrRep = "rep_inf_tcw_mace"

elseif herorepublicand <= (mace + obiwan) then
hriflemanstrRep = "rep_inf_tcw_rifleman_212th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_212th"
sniperstrRep = "rep_inf_tcw_sniper_212th"
engineerstrRep = "rep_inf_tcw_engineer_212th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_212th"
sriflemanstrRep = "rep_inf_tcw_medic_212th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_212th"
specialstrRep = "rep_inf_tcw_specialist_212th"
commanderstrRep = "rep_inf_tcw_cody"
herostrRep = "rep_inf_tcw_obiwan"

elseif herorepublicand <= (mace + obiwan + plokoon) then
hriflemanstrRep = "rep_inf_tcw_rifleman_433rd"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_433rd"
sniperstrRep = "rep_inf_tcw_sniper_433rd"
engineerstrRep = "rep_inf_tcw_engineer_433rd"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_433rd"
sriflemanstrRep = "rep_inf_tcw_medic_433rd"
jettrooperstrRep = "rep_inf_tcw_jettrooper_433rd"
specialstrRep = "rep_inf_tcw_specialist_433rd"
commanderstrRep = "rep_inf_tcw_wolffe"
herostrRep = "rep_inf_tcw_plokoon"

elseif herorepublicand <= (mace + obiwan + plokoon + anakin) then
anakinishere = 1
hriflemanstrRep = "rep_inf_tcw_rifleman_501st"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_501st"
sniperstrRep = "rep_inf_tcw_sniper_501st"
engineerstrRep = "rep_inf_tcw_engineer_501st"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_501st"
sriflemanstrRep = "rep_inf_tcw_medic_501st"
jettrooperstrRep = "rep_inf_tcw_jettrooper_501st"
specialstrRep = "rep_inf_tcw_specialist_501st"
commanderstrRep = "rep_inf_tcw_rex"
herostrRep = "rep_inf_tcw_anakin"

elseif herorepublicand <= (mace + obiwan + plokoon + anakin + aayla) then
hriflemanstrRep = "rep_inf_tcw_rifleman_327th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_327th"
sniperstrRep = "rep_inf_tcw_sniper_327th"
engineerstrRep = "rep_inf_tcw_engineer_327th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_327th"
sriflemanstrRep = "rep_inf_tcw_medic_327th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_327th"
specialstrRep = "rep_inf_tcw_specialist_327th"
commanderstrRep = "rep_inf_tcw_bly"
herostrRep = "rep_inf_tcw_aayla"

elseif herorepublicand <= (mace + obiwan + plokoon + anakin + aayla + kota) then
hriflemanstrRep = "rep_inf_tcw_rifleman_militia"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_militia"
sniperstrRep = "rep_inf_tcw_sniper_militia"
engineerstrRep = "rep_inf_tcw_engineer_militia"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_militia"
sriflemanstrRep = "rep_inf_tcw_medic_militia"
jettrooperstrRep = "rep_inf_tcw_jettrooper_militia"
specialstrRep = "rep_inf_tcw_specialist_militia"
commanderstrRep = "rep_inf_tcw_gunny"
herostrRep = "rep_inf_tcw_kota"


elseif herorepublicand <= (mace + obiwan + plokoon + anakin + aayla + kota + yoda) then
hriflemanstrRep = "rep_inf_tcw_rifleman_7th"
heavystrRep = "rep_inf_tcw_rocketeer_chaingun_7th"
sniperstrRep = "rep_inf_tcw_sniper_7th"
engineerstrRep = "rep_inf_tcw_engineer_7th"
lriflemanstrRep = "rep_inf_tcw_lightrifleman_7th"
sriflemanstrRep = "rep_inf_tcw_medic_7th"
jettrooperstrRep = "rep_inf_tcw_jettrooper_7th"
specialstrRep = "rep_inf_tcw_specialist_7th"
commanderstrRep = "rep_inf_tcw_thire"
herostrRep = "rep_inf_tcw_yoda"

end


local herosepertistand = math.random(1, herosepertist)

if herosepertistand <= ventress then
herostrCis = "cis_hero_ventress"

elseif herosepertistand <= (ventress + grievous) then
if anakinishere == 1 then
herostrCis = "cis_hero_ventress"
else
herostrCis = "cis_hero_grievous"
end

elseif herosepertistand <= (ventress + grievous + jedihunter) then
herostrCis = "cis_hero_jedihunter"

elseif herosepertistand <= (ventress + grievous + jedihunter + bane) then
herostrCis = "cis_hero_bane"

elseif herosepertistand <= (ventress + grievous + jedihunter + bane + bossk) then
herostrCis = "cis_hero_bossk"

elseif herosepertistand <= (ventress + grievous + jedihunter + bane + bossk + magnaguard) then
herostrCis = "cis_hero_magnaguard"

elseif herosepertistand <= (ventress + grievous + jedihunter + bane + bossk + magnaguard + dooku) then
herostrCis = "cis_hero_dooku"

end

end
Important section of ???w_con
Hidden/Spoiler:
tcwera = math.random(1,4)

if tcwera < 5 then
DecideUnits(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
end
I know part of that is redundant, but it works.
SAMofBIA wrote:AHHH, the intelligent conversation hurts my brain :runaway: ....its also very intruiging.
You and me both.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Sun Feb 06, 2011 6:15 pm
by Jendo7
How's it going WULFMAN! :)

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Sun Feb 06, 2011 7:31 pm
by Labj
IMO, the colored skins should have more battle damage, they dont look very real, just an advice.

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Sun Feb 06, 2011 8:57 pm
by agentsmith38
Wow, i'm looking forward to this map. Looks like you've put alot of effort in this map, i'm sure everyone will enjoy this.

Offtopic - Yaaay, i've been ranked to Private First Class

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Feb 07, 2011 5:56 pm
by THEWULFMAN
Jendo7 wrote:How's it going WULFMAN! :)
Good, working very hard to get this done. I am putting the finnishing touches on the rep side(s)
and working on some cool units for the CIS, I am having some randomized units for them too.
Labj wrote:IMO, the colored skins should have more battle damage, they dont look very real, just an advice.
Well, two things, no 2. 1:I at times have to restrain myself at how much dammage I WANT, and do how much they need.2: If you watch the show, most clones dont have much battle damage, or paint jobs, 90% of clone are unpainted.3: I love putting damage on them, but I also take into account, which clones will have the most damage. A sniper will not have as much as a Heavy Weapons specialist, etc.
4: snow troopers and camo troopers do not get battle damage. 5: Some clone legion will have more battle damage than others.
501st=Most
Wolfpack=Second most
212th=Close third
327th= forth
187th=fith
7th=least
etc

Thanks for the input.
agentsmith38 wrote:Wow, i'm looking forward to this mod.Looks like you've put alot of effort in this mod, i'm sure everyone will enjoy this.
-FixedThanks :D


Update: I decided to let the 7th legion be randomized with the rest of the legion. Why? Well, otherwise they are just an extra 90mb for just 2 maps, coruscant and death star. This way the payoff is higher, besides, the 7th left coruscant TWICE so far in the show. I will also add Leutenant Thire to the non coruscant maps instead of Fox, because heappeared in Season 1 Episode 1, Ambush. Yoda leeads the 7th into combat, that way you can play as yoda anywhere two.

Also, when I finally get Ahsoka into the mod thanks to Bamdur123, she will be randomized so that when you get the 501st, sometimes the hero is anakin, sometimes its Ahsoka.

Whew there are alot of clone skins to do , each clone may not have his own paint job, although most will, other than camo or snow troops, each has his own battle damage, like the Wolfpack.
Grand total nubmer of clone skins is
54+ :faint: And I spend alot of time making each one perfect, jeez, I spent 3 hours total on my commander cody skin alone:shock:

My timetable is been delayed abit thanks to school, computer failures, etc. So the planned release is March 2011. The beta should be out in Febuary 2011. can you guys believe its 2011 :shock:

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Feb 07, 2011 7:12 pm
by Jendo7
Great update! Looking forward to the randomized units :thumbs:

Re: {WIP}Star Wars: The Clone Wars Era

Posted: Mon Feb 07, 2011 8:26 pm
by Firefang
Great Update