Page 1 of 1

g_con

Posted: Wed Mar 29, 2006 8:10 am
by Riser
How do i add more than 6 diiferent types of players on 1 side ?
I have added "cis_inf_pilot" etc into both ReadDataFile area & SetupTeams, but it just crashs my game when i try to start it.

Thanks

Posted: Wed Mar 29, 2006 8:21 am
by Dragonum
look at the tatooine assault mission lua.
C:\BF2_ModTools\assets\scripts\tat/tat2g_eli.lua

Posted: Wed Mar 29, 2006 10:26 am
by Teancum
Yes, but that requires isCelebrityDeathmatch to be set to true, which kills all conquest objectives.

Posted: Wed Mar 29, 2006 11:12 am
by DakkerDB
It does?
I'm pretty sure I successfully added extra units on my test map once.

Posted: Wed Mar 29, 2006 12:05 pm
by Teancum
The only other option would be possibly adding SetUberMode(1) -- dunno if that would work.

Dakker -- if you got it working, you must spill! I have some recon units ready to go for Kamino, but they don't work with AddUnitClass

Posted: Wed Mar 29, 2006 12:06 pm
by PR-0927
Teancum wrote:Yes, but that requires isCelebrityDeathmatch to be set to true, which kills all conquest objectives.

Not true. I used that method for my map and I now have seven soldier classes per side.

- Majin Revan

Posted: Wed Mar 29, 2006 12:07 pm
by Teancum
Cool -- maybe it was UberMode that killed them. I don't know it's been awhile.

Posted: Wed Mar 29, 2006 12:13 pm
by Murdocr
i added units to my map easy. i have setuber in there so it is probably that.

Posted: Wed Mar 29, 2006 12:18 pm
by Riser
Uber is for having 100's of bots on the battlefield at once, i want to put a 7 or 8 type of player on a team ?

Posted: Wed Mar 29, 2006 5:27 pm
by MercuryNoodles
Make sure the unit isn't being called from more than one lvl in the ReadDataFile lines. Either change the name of the unit, and anything that refers to it (reqs, odfs, and lua), or comment out one of the duplicate ReadDataFile lines so the lua calls up the unit only once.

Posted: Wed Mar 29, 2006 5:48 pm
by PR-0927
Here is my RE1g_con.lua file:

Code: Select all

--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

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

	--  Empire Attacking (attacker is always #1)
    local ALL = 2
    local IMP = 1
    --  These variables do not change
    local ATT = 1
    local DEF = 2
    
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"}
    
    
    
    --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: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("ingame.lvl")



    SetMaxFlyHeight(40)
	SetMaxPlayerFlyHeight(40)


    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  
    SetMemoryPoolSize ("FLEffectObject::OffsetMatrix",100)
    
    
    ReadDataFile("sound\\kas.lvl;kas2gcw")
    ReadDataFile("dc:sound\\RE1.lvl;RE1gcw")
    ReadDataFile("dc:SIDE\\all.lvl",
        "all_hover_combatspeeder",
        "all_inf_engineer",
        "all_inf_support",
        "all_inf_rifleman",
        "all_inf_rocketeer",
	"all_inf_infiltrator",
	"all_inf_medic",
        "all_inf_sniper")
                    
    ReadDataFile("dc:SIDE\\rep.lvl",
        "rep_hover_speederbike",
        "rep_hover_fightertank",
        "rep_inf_ep3_engineer",
        "rep_inf_ep3_support",
        "rep_inf_ep3_rifleman",
        "rep_inf_ep3_rocketeer",
        "rep_inf_ep3_sniper",
        "rep_inf_ep3_medic",
	"rep_inf_clone_commando",
        "rep_walk_oneman_atst")

	SetupTeams{
		all = {
			team = ALL,
			units = 64,
			reinforcements = 1000,
			soldier	= { "all_inf_rifleman",16, 25},
			assault	= { "all_inf_rocketeer",8,15},
			engineer = { "all_inf_engineer",8,15},
			sniper	= { "all_inf_sniper",8,15},
			officer	= { "all_inf_support",8,15},
			special	= { "all_inf_medic",8,15},
		},
	}

    AddUnitClass(ALL,"all_inf_infiltrator",  8,15)

	SetupTeams{
		imp = {
			team = IMP,
			units = 64,
			reinforcements = 1000,
			soldier	= { "rep_inf_ep3_rifleman",16, 25},
			assault	= { "rep_inf_ep3_rocketeer",8,15},
			engineer = { "rep_inf_ep3_engineer",8,15},
			sniper	= { "rep_inf_ep3_sniper",8,15},
			officer	= { "rep_inf_ep3_support",8,15},
			special	= { "rep_inf_ep3_medic",8,15},
		},
	}

    AddUnitClass(IMP, "rep_inf_clone_commando",8,15)
    
    --  Level Stats
    ClearWalkers()
    AddWalkerType(1, 8) -- 1x2 (1 pair of legs)

    local weaponCnt = 1024
    SetMemoryPoolSize("Aimer", 75)
    SetMemoryPoolSize("AmmoCounter", weaponCnt)
    SetMemoryPoolSize("BaseHint", 1024)
    SetMemoryPoolSize("EnergyBar", weaponCnt)
    SetMemoryPoolSize("EntityCloth", 32)
    SetMemoryPoolSize("EntityLight", 200)
    SetMemoryPoolSize("EntityHover", 16)
    SetMemoryPoolSize("EntitySoundStream", 4)
    SetMemoryPoolSize("EntitySoundStatic", 32)
    SetMemoryPoolSize("MountedTurret", 32)
    SetMemoryPoolSize("Navigator", 128)
    SetMemoryPoolSize("Obstacle", 1024)
    SetMemoryPoolSize("PathNode", 1024)
    SetMemoryPoolSize("SoldierAnimation", 500)
    SetMemoryPoolSize("SoundSpaceRegion", 64)
    SetMemoryPoolSize("TreeGridStack", 1024)
    SetMemoryPoolSize("UnitAgent", 128)
    SetMemoryPoolSize("UnitController", 128)
    SetMemoryPoolSize("Weapon", weaponCnt)

    SetSpawnDelay(8.0, 0.25)
    ReadDataFile("dc:RE1\\RE1.lvl", "RE1_conquest")
    SetDenseEnvironment("false")


    --  Sound Stats
    
    voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
    AudioStreamAppendSegments("sound\\global.lvl", "imp_unit_vo_slow", voiceSlow)
    AudioStreamAppendSegments("sound\\global.lvl", "wok_unit_vo_slow", voiceSlow)
    AudioStreamAppendSegments("sound\\global.lvl", "global_vo_slow", voiceSlow)
    
    voiceQuick = OpenAudioStream("sound\\global.lvl",  "all_unit_vo_quick")
    AudioStreamAppendSegments("sound\\global.lvl",  "imp_unit_vo_quick", voiceQuick) 
    AudioStreamAppendSegments("sound\\global.lvl", "wok_unit_vo_quick", voiceQuick)   
    
    OpenAudioStream("sound\\global.lvl",  "gcw_music")
    -- OpenAudioStream("sound\\global.lvl",  "global_vo_quick")
    -- OpenAudioStream("sound\\global.lvl",  "global_vo_slow")
    OpenAudioStream("sound\\kas.lvl",  "kas")
    OpenAudioStream("sound\\kas.lvl",  "kas")

    SetBleedingVoiceOver(ALL, ALL, "all_off_com_report_us_overwhelmed", 1)
    SetBleedingVoiceOver(ALL, IMP, "all_off_com_report_enemy_losing",   1)
    SetBleedingVoiceOver(IMP, ALL, "imp_off_com_report_enemy_losing",   1)
    SetBleedingVoiceOver(IMP, IMP, "imp_off_com_report_us_overwhelmed", 1)

    SetLowReinforcementsVoiceOver(ALL, ALL, "all_off_defeat_im", .1, 1)
    SetLowReinforcementsVoiceOver(ALL, IMP, "all_off_victory_im", .1, 1)
    SetLowReinforcementsVoiceOver(IMP, IMP, "imp_off_defeat_im", .1, 1)
    SetLowReinforcementsVoiceOver(IMP, ALL, "imp_off_victory_im", .1, 1)

    SetOutOfBoundsVoiceOver(2, "Allleaving")
    SetOutOfBoundsVoiceOver(1, "Impleaving")

    SetAmbientMusic(ALL, 1.0, "all_kas_amb_start",  0,1)
    SetAmbientMusic(ALL, 0.8, "all_kas_amb_middle", 1,1)
    SetAmbientMusic(ALL, 0.2,"all_kas_amb_end",    2,1)
    SetAmbientMusic(IMP, 1.0, "imp_kas_amb_start",  0,1)
    SetAmbientMusic(IMP, 0.8, "imp_kas_amb_middle", 1,1)
    SetAmbientMusic(IMP, 0.2,"imp_kas_amb_end",    2,1)

    SetVictoryMusic(ALL, "all_kas_amb_victory")
    SetDefeatMusic (ALL, "all_kas_amb_defeat")
    SetVictoryMusic(IMP, "imp_kas_amb_victory")
    SetDefeatMusic (IMP, "imp_kas_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.224778, -0.020660, -0.970102, -0.089167, -458.456573, 8.361650, -30.174923);
	AddCameraShot(0.356653, -0.008751, -0.933915, -0.022914, -56.596874, 7.499118, -65.540321);
	AddCameraShot(0.188190, 0.010266, -0.980621, 0.053495, 8.459979, 11.768010, -143.714508);
	AddCameraShot(0.973686, -0.038739, 0.224399, 0.008928, 464.670044, 11.768010, 39.809654);
end

Everything works fine too.

- Majin Revan

Posted: Wed Mar 29, 2006 5:53 pm
by Riser
Cheers Majin Revan

i wasnt doing this below
AddUnitClass(ALL,"all_inf_infiltrator", 8,15)
AddUnitClass(IMP, "rep_inf_clone_commando",8,15)

i was just adding extra
engineer = { "all_inf_engineer",8,15},
sniper = { "all_inf_sniper",8,15},
officer = { "all_inf_support",8,15},

i guess it doesnt like that

thanks again ill try it when i get home from work 2mor :D

Posted: Wed Mar 29, 2006 7:05 pm
by Teancum
Hmmm... Must've been an asset problem when I was doing the new units.