Page 1 of 1

Evil republic side not working right... (SOLVED)

Posted: Wed Sep 24, 2008 11:01 am
by jedimoose32
I created a side called re2 (republic vs republic) and just copied all the republic assets into it
i've fixed the lua and req
here is the lua:
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
-- SPAX - Clone Wars Template Common File
-- Common script that shares all setup information
--

ScriptCB_DoFile("setup_teams")

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

EnableSPHeroRules()

function SetupUnits()
ReadDataFile("dc:SIDE\\rep.lvl",
"rep_inf_ep3_pilot",
"rep_inf_ep3_marine",
"rep_inf_xmarine",
"rep_fly_anakinstarfighter_sc",
"rep_fly_arc170fighter_sc",
"rep_veh_remote_terminal",
"rep_fly_gunship_sc",
"rep_fly_vwing",
"rep_fly_cwing",
"rep_hero_obiwan")

ReadDataFile("dc:SIDE\\re2.lvl",
"rep_inf_ep3_pilot",
"rep_inf_ep3_marine",
"rep_fly_anakinstarfighter_sc",
"rep_fly_arc170fighter_sc",
"rep_veh_remote_terminal",
"rep_fly_vwing",
"re2_fly_zwing",
"rep_hero_obiwan")

ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_spa_cis_beam",
"tur_bldg_spa_cis_chaingun",
"tur_bldg_spa_rep_beam",
"tur_bldg_spa_rep_chaingun",
"tur_bldg_chaingun_roof"
)
end

myTeamConfig = {
rep = {
team = REP,
units = 32,
reinforcements = -1,
pilot = { "rep_inf_ep3_pilot",26},
marine = { "rep_inf_ep3_marine",6},
uber = { "rep_inf_xmarine",6},
engineer = { "rep_hero_obiwan",6},
},
re2 = {
team = RE2,
units = 32,
reinforcements = -1,
pilot = { "rep_inf_ep3_pilot",26},
marine = { "rep_inf_ep3_marine",6},
}
}

ScriptCB_DoFile("LinkedTurrets")
function SetupTurrets()
--CIS turrets
turretLinkageCIS = LinkedTurrets:New{ team = RE2, mainframe = "cis-defense",
turrets = {"cis_turr_1", "cis_turr_2", "cis_turr_3", "cis_turr_4", "cis_turr_5", "cis_turr_6"} }
turretLinkageCIS:Init()

function turretLinkageCIS:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", REP)
ShowMessageText("level.spa.hangar.mainframe.def.down", RE2)

BroadcastVoiceOver( "ROSMP_obj_20", REP )
BroadcastVoiceOver( "COSMP_obj_21", RE2 )
end
function turretLinkageCIS:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", REP)
ShowMessageText("level.spa.hangar.mainframe.def.up", RE2)

BroadcastVoiceOver( "ROSMP_obj_22", REP )
BroadcastVoiceOver( "COSMP_obj_23", RE2 )
end

--REP turrets
turretLinkageREP = LinkedTurrets:New{ team = REP, mainframe = "rep-defense",
turrets = {"rep_turr_1", "rep_turr_2", "rep_turr_3", "rep_turr_4", "rep_turr_5", "rep_turr_6"} }
turretLinkageREP:Init()

function turretLinkageREP:OnDisableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.down", RE2)
ShowMessageText("level.spa.hangar.mainframe.def.down", REP)

BroadcastVoiceOver( "ROSMP_obj_21", REP )
BroadcastVoiceOver( "COSMP_obj_20", RE2 )
end
function turretLinkageREP:OnEnableMainframe()
ShowMessageText("level.spa.hangar.mainframe.atk.up", RE2)
ShowMessageText("level.spa.hangar.mainframe.def.up", REP)

BroadcastVoiceOver( "ROSMP_obj_23", REP )
BroadcastVoiceOver( "COSMP_obj_22", RE2 )
end
end

function ScriptPreInit()
SetWorldExtents(2500)
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, this line *MUST* be first!
ReadDataFile("ingame.lvl")

SetMinFlyHeight(-1800)
SetMaxFlyHeight(1800)
SetMinPlayerFlyHeight(-1800)
SetMaxPlayerFlyHeight(1800)
SetAIVehicleNotifyRadius(100)

ReadDataFile("sound\\spa.lvl;spa2cw")
ScriptCB_SetDopplerFactor(0.4)
ScaleSoundParameter("tur_weapons", "MinDistance", 3.0);
ScaleSoundParameter("tur_weapons", "MaxDistance", 3.0);
ScaleSoundParameter("tur_weapons", "MuteDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MinDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MaxDistance", 3.0);
ScaleSoundParameter("Ordnance_Large", "MuteDistance", 3.0);
ScaleSoundParameter("explosion", "MaxDistance", 5.0);
ScaleSoundParameter("explosion", "MuteDistance", 5.0);

SetupUnits()
SetupTeams(myTeamConfig)

-- Level Stats
ClearWalkers()
local weaponCnt = 250
local guyCnt = 32
local units = 72
SetMemoryPoolSize("Aimer", 200)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 73)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 0)
SetMemoryPoolSize("EntityDroideka",0)
SetMemoryPoolSize("EntityDroid",0)
SetMemoryPoolSize("EntityHover", 0)
SetMemoryPoolSize("EntityFlyer", 36)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1500)
SetMemoryPoolSize("ParticleTransformer::ColorTrans" , 1784)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 1500)
SetMemoryPoolSize("EntityLight", 100)
SetMemoryPoolSize("EntityRemoteTerminal", 12)
SetMemoryPoolSize("EntitySoldier",guyCnt)
SetMemoryPoolSize("SoldierAnimation", 200)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 70)
SetMemoryPoolSize("Navigator", guyCnt)
SetMemoryPoolSize("Obstacle", 150)
SetMemoryPoolSize("PassengerSlot", 0)
SetMemoryPoolSize("PathNode", 92)
SetMemoryPoolSize("UnitAgent", units)
SetMemoryPoolSize("UnitController", units)
SetMemoryPoolSize("Weapon", weaponCnt)
SetMemoryPoolSize("TentacleSimulator", 0)
SetMemoryPoolSize("Combo::DamageSample", 0)

SetSpawnDelay(10.0, 0.25)

-- do any pool allocations, custom loading here
if myScriptInit then
myScriptInit()
myScriptInit = nil
end

ReadDataFile("dc:USB\\spa_sky.lvl", "tat")

ReadDataFile("dc:USB\\USB.lvl", myGameMode)

SetDenseEnvironment("false")

SetParticleLODBias(15000)

-- Sound Stats
local voiceSlow = OpenAudioStream("sound\\global.lvl", "spa1_objective_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "rep_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "cis_unit_vo_slow", voiceSlow)
AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)

local 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("sound\\spa.lvl", "spa")
OpenAudioStream("sound\\spa.lvl", "spa")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
-- OpenAudioStream("sound\\tat.lvl", "tat1_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(REP, "Repleaving")
SetOutOfBoundsVoiceOver(CIS, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_spa_amb_start", 0,1)
SetAmbientMusic(REP, 0.99, "rep_spa_amb_middle", 1,1)
SetAmbientMusic(REP, 0.1,"rep_spa_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_spa_amb_start", 0,1)
SetAmbientMusic(CIS, 0.99, "cis_spa_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.1,"cis_spa_amb_end", 2,1)

SetVictoryMusic(REP, "rep_spa_amb_victory")
SetDefeatMusic (REP, "rep_spa_amb_defeat")
SetVictoryMusic(CIS, "cis_spa_amb_victory")
SetDefeatMusic (CIS, "cis_spa_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 Battle over Felucia
-- Rep ship from behind
AddCameraShot(0.998795, -0.041143, -0.026739, -0.001101, -720.435303, 809.024963, 2779.057129);
-- CIS ship from behind
AddCameraShot(0.028389, -0.001117, -0.998823, -0.039312, -629.853760, 809.024963, -2050.946289);
-- Overall from right side of map
AddCameraShot(-0.335210, 0.057062, -0.927078, -0.157814, 1372.964233, 1940.014038, -2266.423828);
-- Overall from left side of map
AddCameraShot(0.911880, -0.246677, -0.316680, -0.085667, -2183.282471, 1940.014038, 2760.666748);


AddDeathRegion("deathregion3")
AddDeathRegion("deathregion4")
AddLandingRegion("rep-CP1Con")
AddLandingRegion("cis-CP1Con")

end




[/code]
And here is the req:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"lvl"
"rep_bldg_forwardcenter"
"rep_fly_anakinstarfighter_sc"
"re2_fly_zwing"
"rep_fly_arc170fighter_dome"
"rep_fly_arc170fighter_sc"
"rep_fly_assault_dome"
"rep_fly_cat_dome"
"rep_fly_gunship"
"kam_fly_ride_gunship"
"rep_fly_gunship_sc"
"rep_fly_gunship_dome"
"rep_fly_jedifighter_dome"
"rep_fly_jedifighter_sc"
"rep_fly_ride_gunship"
"rep_fly_vwing"
"rep_hero_obiwan"
"rep_inf_ep3_pilot"
"rep_inf_ep3_marine"
"uta_fly_ride_gunship"
"uta_fly_ride_gunshipmyg"

}
}
[/code]
What happens is the side is in the game, but no vehicles, and I can spawn, but nobody else does. I change the zeroedit spawn points. Turrets are working. But no units, no vehicles.

Re: Evil republic side not working right...

Posted: Wed Sep 24, 2008 11:04 am
by Teancum
You removed all references to the CP's in your lua. Nobody will spawn until you put those back in.

Re: Evil republic side not working right...

Posted: Wed Sep 24, 2008 11:51 am
by MercuryNoodles
That's a space map's cmn lua. It shouldn't need CP references for either lua, unless it's necessary to make it like Conquest.

Btw, "uber" is not a valid unit type unless you defined it in your scripts somewhere. You can't just make up names and throw them into that portion of the lua. You're better off using pilot, marine, soldier, assault, sniper, engineer, officer, or special. Beyond those, you can use AddUnitClass as an alternative. Really, you shouldn't need more than what's listed, because the screen only fits something like 9 classes.


That's your rep.req, I'm guessing, by the files listed. Your xmarine isn't even listed. Enter it into that req and remunge the side.


You should've posted an error log first, but in this case, it's probably better that you showed us these.

Also, before anyone else mentions this :P, don't copy a whole side to change just a few units. Those marines, for example, if they're exactly the same, you only need to load the unit once. What side the unit plays for is determined by the myteamconfig part of the lua, not which level file it's loaded from. That's the lazy way to make a side, and you really won't want to do the work involved in cutting files out later, because the side will be rediculously huge. It's much better to copy only the files you need.

Re: Evil republic side not working right...

Posted: Wed Sep 24, 2008 12:04 pm
by Teancum
MercuryNoodles wrote:That's a space map's cmn lua. It shouldn't need CP references for either lua, unless it's necessary to make it like Conquest.
Whoops. Missed that. :lol:

Re: Evil republic side not working right...

Posted: Wed Sep 24, 2008 12:16 pm
by MercuryNoodles
:lol: That's understandable. I've been focused on space, so I recognized it shortly after scanning it.

Re: Evil republic side not working right...

Posted: Wed Sep 24, 2008 1:48 pm
by Maveritchell
Everything mentioned above should be corrected, but it's worth mentioning these.

Code: Select all

re2 = {
        team = RE2,
You tried to define a team name that doesn't exist. The lowercase "re2" there is not a variable, like all the uppercase "RE2"s in the .lua. "re2" defines the name and it has no value as "re2." I would change it back to "cis" and localize the CIS's team name in your localize tool.

Also, you didn't change any of the "CIS" variables in the sound setup to "RE2." That means that you're going to have a lot of missing ambient sound on team "RE2."

Re: Evil republic side not working right... (solved, thx)

Posted: Wed Sep 24, 2008 10:48 pm
by jedimoose32
okay, so i just need to change everything that is RE2 back to CIS?
also, good call on the space map
hopefully i won't have to ask for any more help
i've already given too much away with the whole EVIL REPUBLIC thing

thx for quick replies!!
:funny2: :runaway:
EDIT: @MercuryNoodles: i am aware that xmarine is not there, this map and granted this side is in the earliest stages, i just started the other day. also, i changed setup_teams.lua so yes now there is a unit type called uber
thanks for the advice though
i may be Private Second Class but i am not a total n00b :)

Re: Evil republic side not working right... (SOLVED)

Posted: Thu Sep 25, 2008 7:07 am
by MercuryNoodles
Don't worry, it's not like people scour help threads to see what you have in the works. :P

So, what changes did you make to your CPs? I should've asked earlier, but I got distracted by the other problems.

Re: Evil republic side not working right... (SOLVED)

Posted: Sun Sep 28, 2008 6:16 pm
by jedimoose32
no changes to cps mercury
fixed the side name, but map still crashes
i believe due to a model i recently imported
in any case i believe this topic has served its purpose so...
**LOCK PLEASE**