Page 1 of 1

Mimban CTD+No name or Description

Posted: Wed May 12, 2010 2:57 pm
by StarkillerMarek
Alright, when I start SWBF2, my maps name and description in the list shows up as MI1%_%. When I try to play conquest mode on all eras(CW, GCW, DT) it works like it always has. However, when I try to play 2 Flag CTF, on any era, it crashes with a FATAL error. This all happened when I manually tried to add CTF modes, so most likely this is where the problem is. I have checked everything needed for this mode a bazillion times, but with no luck. I have also tried a clean and manual clean of everything. My next is going to have to be working backwards, removing the ctf modes, unless anyone else can think of any thing.


My CW 2 Flag CTF Lua:
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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


--Switch the flag appearance(s) for CW vs GCW
SetProperty("ctf_flag1", "GeometryName", "com_icon_republic_flag")
SetProperty("ctf_flag1", "CarriedGeometryName", "com_icon_republic_flag_carried")

SetProperty("ctf_flag2", "GeometryName", "com_icon_cis_flag")
SetProperty("ctf_flag2", "CarriedGeometryName", "com_icon_cis_flag_carried")

SetProperty ("flag2_effect","Team",2) -- Kludge because the effect objects are shared with 1flag
SetProperty ("flag1_effect","Team",1) -- Kludge because the effect objects are shared with 1flag

--This is all the actual ctf objective setup
ctf = ObjectiveCTF:New{teamATT = ATT, teamDEF = DEF, captureLimit = 5, textATT = "game.modes.CTF", textDEF = "game.modes.CTF2", hideCPs = true, multiplayerRules = true}
ctf:AddFlag{name = "ctf_flag1", homeRegion = "flag1_home", captureRegion = "flag2_home",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}
ctf:AddFlag{name = "ctf_flag2", homeRegion = "flag2_home", captureRegion = "flag1_home",
capRegionMarker = "hud_objective_icon_circle", capRegionMarkerScale = 3.0,
icon = "", mapIcon = "flag_icon", mapIconScale = 3.0}

SoundEvent_SetupTeams( 1, 'rep', 2, 'cis' )

ctf:Start()

herosupport = AIHeroSupport:New{AIATTHeroHealth = 5000, AIDEFHeroHealth = 3000, gameMode = "nonconquest",}
herosupport:SetHeroClass(REP, "rep_hero_fisto")
herosupport:SetHeroClass(CIS, "cis_hero_jangofett")
herosupport:AddSpawnCP("CP1","CP1_SPAWN")
herosupport:AddSpawnCP("CP2","CP2_SPAWN")
herosupport:AddSpawnCP("CP3","CP3_SPAWN")
herosupport:AddSpawnCP("CP4","CP4_SPAWN")
herosupport:AddSpawnCP("CP5","CP5_SPAWN")
herosupport:Start()


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

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



ReadDataFile("ingame.lvl")


SetMaxFlyHeight(30)
SetMaxPlayerFlyHeight (30)

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

ReadDataFile("sound\\yav.lvl;yav1cw")
ReadDataFile("dc:SIDE\\kit.lvl","rep_hero_fisto")
ReadDataFile("dc:SIDE\\rep41st.lvl",
"rep_inf_ep3_rifleman",
"rep_inf_ep3_rocketeer",
"rep_inf_ep3_engineer",
"rep_inf_ep3_sniper",
"rep_inf_ep3_officer",
"rep_inf_ep3_jettrooper")

ReadDataFile("SIDE\\cis.lvl",
"cis_inf_rifleman",
"cis_inf_rocketeer",
"cis_inf_engineer",
"cis_inf_sniper",
"cis_inf_officer",
"cis_inf_droideka",
"cis_hero_jangofett",
"cis_hover_aat")


ReadDataFile("dc:SIDE\\tur.lvl",
"tur_bldg_laser",
"tur_bldg_tower")



SetupTeams{
rep = {
team = REP,
units = 20,
reinforcements = 150,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",1, 4},
engineer = { "rep_inf_ep3_engineer",1, 4},
sniper = { "rep_inf_ep3_sniper",1, 4},
officer = {"rep_inf_ep3_officer",1, 4},
special = { "rep_inf_ep3_jettrooper",1, 4},

},
cis = {
team = CIS,
units = 20,
reinforcements = 150,
soldier = { "cis_inf_rifleman",9, 25},
assault = { "cis_inf_rocketeer",1, 4},
engineer = { "cis_inf_engineer",1, 4},
sniper = { "cis_inf_sniper",1, 4},
officer = {"cis_inf_officer",1, 4},
special = { "cis_inf_droideka",1, 4},
}
}



-- 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 = 1024
SetMemoryPoolSize("Aimer", 75)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 32)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
SetMemoryPoolSize("SoldierAnimation", 500)
SetMemoryPoolSize("EntitySoundStatic", 32)
SetMemoryPoolSize("MountedTurret", 32)
SetMemoryPoolSize("Navigator", 128)
SetMemoryPoolSize("Obstacle", 1024)
SetMemoryPoolSize("PathNode", 1024)
SetMemoryPoolSize("SoundSpaceRegion", 64)
SetMemoryPoolSize("TreeGridStack", 1024)
SetMemoryPoolSize("UnitAgent", 128)
SetMemoryPoolSize("UnitController", 128)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
--ReadDataFile("dc:MI1\\MI1.lvl", "MI1_conquest")
ReadDataFile("dc:MI1\\MI1.lvl", "MI1_ctf")
SetDenseEnvironment("false")




-- Sound

SetSoundEffect("ScopeDisplayZoomIn", "binocularzoomin")
SetSoundEffect("ScopeDisplayZoomOut", "binocularzoomout")

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("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1")
OpenAudioStream("sound\\yav.lvl", "yav1_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(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(REP, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_yav_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_yav_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_yav_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_yav_amb_end", 2,1)

SetVictoryMusic(REP, "rep_yav_amb_victory")
SetDefeatMusic (REP, "rep_yav_amb_defeat")
SetVictoryMusic(CIS, "cis_yav_amb_victory")
SetDefeatMusic (CIS, "cis_yav_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
AddCameraShot(0.173623, -0.037013, -0.962489, -0.205184, -231.336563, 3.800790, 137.311600);


end
My addme.lua :
Hidden/Spoiler:
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\dtshell.lvl")


--insert totally new maps here:
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)

sp_missionselect_listbox_contents[sp_n+1] = { red = 0, blue = 255, green = 100, isModLevel = 1, mapluafile = "MI1%s_%s", era_1 = 1, era_g = 1, era_c = 1, mode_con_1 = 1, mode_con_g = 1, mode_con_c = 1, mode_ctf_1 = 1, mode_ctf_c = 1, mode_ctf_g = 1, change = {
era_1 = { name="Dark Times", icon2="darktimes_icon" },
},}
mp_n = table.getn(mp_missionselect_listbox_contents)
mp_missionselect_listbox_contents[mp_n+1] = sp_missionselect_listbox_contents[sp_n+1]

-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)

AddDownloadableContent("MI1","MI1g_con",4)
AddDownloadableContent("MI1","MI1c_con",4)
AddDownloadableContent("MI1","MI11_con",4)
AddDownLoadableContent("MI1","MI1g_ctf",4)
AddDownLoadableContent("MI1","MI1c_ctf",4)
AddDownLoadableContent("MI1","MI11_ctf",4)

-- all done
newEntry = nil
n = nil

-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\MI1\\data\\_LVL_PC\\core.lvl")
If anyone needs to see any more scripts, I will be happy to post them.

Re: Mimban CTD+No name or Description

Posted: Wed May 12, 2010 4:51 pm
by CressAlbane
Well, for the name, do you currently have the 1.1 patch installed?

Re: Mimban CTD+No name or Description

Posted: Wed May 12, 2010 4:58 pm
by StarkillerMarek
Yes. This is not the first map I have made, I have been succesful in manually adding game modes to maps.

Re: Mimban CTD+No name or Description

Posted: Thu May 13, 2010 8:39 am
by lucasfart
Did you add it to the mission.req and create a .req for your mode in common/mission?

If its a fatal error it means it can't find the right file, so i'm pretty sure its not your lua stuffing up here...

And with the unlocalized descriptions, i'm not really sure how that hapens, but it has happened to me once or twice before and i just ignored it :)

Re: Mimban CTD+No name or Description

Posted: Thu May 13, 2010 9:18 am
by StarkillerMarek
Yes I did, to both of those, but you can see them anyway:


Mission.req :
Hidden/Spoiler:
ucft
{
REQN
{
"config"
"ingame_movies"
}

REQN
{
"script"
"setup_teams"
"gametype_conquest"
"gametype_capture"
"Objective"
"MultiObjectiveContainer"
"ObjectiveCTF"
"ObjectiveAssault"
"ObjectiveSpaceAssault"
"ObjectiveConquest"
"ObjectiveTDM"
"ObjectiveOneFlagCTF"
"SoundEvent_ctf"
"ObjectiveGoto"
"LinkedShields"
"LinkedDestroyables"
"LinkedTurrets"
"Ambush"
"PlayMovieWithTransition"
"AIHeroSupport"
"TFURandom"
}

REQN
{
"lvl"
"MI1g_con"
"MI1c_con"
"MI11_con"
"MI1g_ctf"
"MI1c_ctf"
"MI11_ctf"
}
}

MI11_ctf.req(Dark Times) in data_MI1/Common/mission:
Hidden/Spoiler:
ucft
{
REQN
{

"config"
"cor_movies"

}

REQN
{
"script"
"MI11_ctf"
}
}

I think maybe the missing name might have something to do with it not being able to find the ctf files. I can't really ignore it, it won't look right if I release it.


Edit-Could loading the DT localizations cause the missing description+name?

Re: Mimban CTD+No name or Description

Posted: Thu May 20, 2010 4:09 pm
by fasty
Try making a new test map and adding the CTF mode the same way, and see if you have the same problem.

Re: Mimban CTD+No name or Description

Posted: Thu May 20, 2010 7:44 pm
by StarkillerMarek
fasty wrote:Try making a new test map and adding the CTF mode the same way, and see if you have the same problem.
I might, but I have succesfully added CTF modes in the past.

Re: Mimban CTD+No name or Description

Posted: Thu May 20, 2010 9:19 pm
by myers73
you most likely forgot a step or two. Are you loading the right layer?

Re: Mimban CTD+No name or Description

Posted: Thu May 20, 2010 9:20 pm
by StarkillerMarek

Code: Select all

ReadDataFile("dc:MI1\\MI1.lvl", "MI1_ctf")
There is a Gamemode in ZE called "ctf". It loads the conquest layer and the ctf layer.

Re: Mimban CTD+No name or Description

Posted: Fri May 21, 2010 7:55 am
by Teancum
You said you got a FATAL -- did you get any munge errors?

Re: Mimban CTD+No name or Description

Posted: Fri May 21, 2010 12:08 pm
by StarkillerMarek
Teancum wrote:You said you got a FATAL -- did you get any munge errors?
Nope.