Page 1 of 2

Problem with adding speeders on a map

Posted: Thu Oct 26, 2006 11:42 am
by odi-wan
hi I'm currently working on a map for speeders. but my problem is that the speeders dont spawn on the map^^ well i added a control zone and i wrote "imp_hover_speederbike" to classimpDEF.... thats my lua:

--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Mos Eisley Hero Deathmatch (uses Space Assault rules)
-- First team to reach 100 kills wins
--

ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("ObjectiveTDM")

---------------------------------------------------------------------------
-- ScriptPostLoad
---------------------------------------------------------------------------
function ScriptPostLoad()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()

AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
end


---------------------------------------------------------------------------
-- ScriptInit
---------------------------------------------------------------------------
function ScriptInit()


SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",70) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",850) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",850) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",750) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",8000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",140) -- should be ~1x #combo -- should be ~1x #combo

ReadDataFile("ingame.lvl")

ALL = 1
IMP = 2
-- These variables do not change
ATT = 1
DEF = 2

SetMaxFlyHeight(40)
SetMaxPlayerFlyHeight(40)

ReadDataFile("sound\\tat.lvl;tat2gcw")
ReadDataFile("SIDE\\all.lvl",
"all_hero_luke_jedi",
"all_hero_hansolo_tat",
"all_hero_leia",
"all_hero_chewbacca")

ReadDataFile("SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hero_emperor",
"imp_hover_speederbike",
"imp_hero_bobafett")

ReadDataFile("SIDE\\rep.lvl",
"rep_hero_yoda",
"rep_hero_macewindu",
"rep_hero_anakin",
"rep_hero_aalya",
"rep_hero_kiyadimundi",
"rep_hero_obiwan",)

ReadDataFile("SIDE\\cis.lvl",
"cis_hero_grievous",
"cis_hero_darthmaul",
"cis_hero_countdooku",
"cis_hero_jangofett")

--[[ Turrets disabled
ReadDataFile("SIDE\\tur.lvl",
"tur_bldg_chaingun_roof",
"tur_weap_built_gunturret")
SetMemoryPoolSize("MountedTurret", 15)
--]]

--ReadDataFile("SIDE\\snw.lvl", "snw_inf_wampa")

SetupTeams{
hero = {
team = ALL,
units = 12,
reinforcements = -1,
soldier = { "all_hero_hansolo_tat",1,2},
assault = { "all_hero_chewbacca", 1,2},
engineer= { "all_hero_luke_jedi", 1,2},
sniper = { "rep_hero_obiwan", 1,2},
officer = { "rep_hero_yoda", 1,2},
special = { "rep_hero_macewindu", 1,2},
},
}

AddUnitClass(ALL,"all_hero_leia", 1,2)
AddUnitClass(ALL,"rep_hero_aalya", 1,2)
AddUnitClass(ALL,"rep_hero_kiyadimundi",1,2)

SetupTeams{
villain = {
team = IMP,
units = 12,
reinforcements = -1,
soldier = { "imp_hero_bobafett", 1,2},
assault = { "imp_hero_darthvader",1,2},
engineer= { "cis_hero_darthmaul", 1,2},
sniper = { "cis_hero_jangofett", 1,2},
officer = { "cis_hero_grievous", 1,2},
special = { "imp_hero_emperor", 1,2},

},
}
AddUnitClass(IMP, "rep_hero_anakin",1,2)
AddUnitClass(IMP, "cis_hero_countdooku",1,2)

-- Level Stats
ClearWalkers()
AddWalkerType(0, 0) -- 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 = 96
SetMemoryPoolSize("Aimer", 1)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 320)
SetMemoryPoolSize("ConnectivityGraphFollower", 23)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth",41)
SetMemoryPoolSize("EntityDefenseGridTurret", 0)
SetMemoryPoolSize("EntityDroid", 0)
SetMemoryPoolSize("EntityFlyer", 5) -- to account for 5 chewbaccas
SetMemoryPoolSize("EntitHover", 90)
SetMemoryPoolSize("EntityLight", 80, 80) -- stupid trickery to actually set lights to 80
SetMemoryPoolSize("EntityPortableTurret", 0) -- nobody has autoturrets AFAIK - MZ
SetMemoryPoolSize("EntitySoundStream", 2)
SetMemoryPoolSize("EntitySoundStatic", 45)
SetMemoryPoolSize("FLEffectObject::OffsetMatrix", 120)
SetMemoryPoolSize("MountedTurret", 0)
SetMemoryPoolSize("Navigator", 23)
SetMemoryPoolSize("Obstacle", 667)
SetMemoryPoolSize("Ordnance", 80) -- not much ordnance going on in the level
SetMemoryPoolSize("ParticleEmitter", 512)
SetMemoryPoolSize("ParticleEmitterInfoData", 512)
SetMemoryPoolSize("PathFollower", 23)
SetMemoryPoolSize("PathNode", 128)
SetMemoryPoolSize("ShieldEffect", 0)
SetMemoryPoolSize("TentacleSimulator", 24)
SetMemoryPoolSize("TreeGridStack", 290)
SetMemoryPoolSize("UnitAgent", 23)
SetMemoryPoolSize("UnitController", 23)
SetMemoryPoolSize("Weapon", weaponCnt)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("dc:SPR\\SPR.lvl", "SPR_eli")
SetDenseEnvironment("false")

-- Sound Stats

ScriptCB_EnableHeroMusic(0)
ScriptCB_EnableHeroVO(0)

voiceSlow = OpenAudioStream("sound\\global.lvl", "all_unit_vo_slow")
AudioStreamAppendSegments("sound\\global.lvl", "imp_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)

OpenAudioStream("sound\\global.lvl", "gcw_music")
OpenAudioStream("sound\\tat.lvl", "tat2")
OpenAudioStream("sound\\tat.lvl", "tat2")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")

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(1, "Allleaving")
SetOutOfBoundsVoiceOver(2, "Impleaving")

SetAmbientMusic(ALL, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(ALL, 0.9, "all_tat_amb_middle", 1,1)
-- SetAmbientMusic(ALL, 0.1, "all_tat_amb_end", 2,1)
SetAmbientMusic(IMP, 1.0, "gen_amb_celebDeathmatch", 0,1)
-- SetAmbientMusic(IMP, 0.9, "imp_tat_amb_middle", 1,1)
-- SetAmbientMusic(IMP, 0.1, "imp_tat_amb_end", 2,1)

SetVictoryMusic(ALL, "all_tat_amb_victory")
SetDefeatMusic (ALL, "all_tat_amb_defeat")
SetVictoryMusic(IMP, "imp_tat_amb_victory")
SetDefeatMusic (IMP, "imp_tat_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")

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

Posted: Thu Oct 26, 2006 11:56 am
by Maveritchell
Assuming you set up a vehicle spawn point correctly (it sounds like you did, plus, it's fairly self-explanatory in the docs), your only problem is that you didn't call for them in the .lua.

Every time you add a new unit or new vehicle to your map, you need to call for them in the .lua under the side to which they belong and the .lua needs to be edited so that it calls a customized side. In this case,
SPR .lua wrote:ReadDataFile("SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hero_emperor",
"imp_hover_speederbike",
"imp_hero_bobafett")
Should be:
SPR .lua wrote:ReadDataFile("dc:SIDE\\imp.lvl",
"imp_hero_darthvader",
"imp_hero_emperor",
"imp_hover_speederbike",
"imp_hero_bobafett")
The "dc:" prefix calls for downloadable content. Any time you change a skin, add a vehicle, character, edit an .odf (?) (I'm not completely sure on that), you need to add the dc: before the side you modify.

Posted: Thu Oct 26, 2006 4:34 pm
by odi-wan
well i added the dc: but it still doesn't work

Posted: Thu Oct 26, 2006 4:42 pm
by Hebes24
Actually, Maveritchell, you only need to add "dc:" if you have a custom side. If he's using the shipped speederbike, then he doesn't need it. :wink:

@odi-wan - are the Vehicle spawns in the same layer as the CPs? (ususally conquest) If they aren't, delete them and remake them in the conquest layer. :D

Posted: Sat Oct 28, 2006 3:57 am
by odi-wan
I made them in the base layer cause there is just hero assault as game mode

Posted: Sat Oct 28, 2006 2:35 pm
by Xavious
Then put them in the assault layer.

Posted: Sun Oct 29, 2006 2:51 pm
by XXXNewbie666XXX
Make you sure that you set the vehicle spawn in the control zone of the CP and the category that you set the vehicle name (Class IMP ATK or Class IMP DEF).

Posted: Sun Oct 29, 2006 4:16 pm
by odi-wan
what does the imp atk or imp def mean?

Posted: Sun Oct 29, 2006 4:29 pm
by XXXNewbie666XXX
The ATK mean how team is the attacker and the DEF the team is the defender.

You can read more in the Getting Started file in the Mod tools.

Well in your LUA it say that the Alliance is the attacker so try to put the vehicle name on the Class ALL ATK.

Posted: Mon Oct 30, 2006 4:02 pm
by odi-wan
but its an imp vehicle

Posted: Mon Oct 30, 2006 4:19 pm
by Hebes24
It doesn't matter. ALLATK just referst to what team is in control of the cp the vehicle spawn is associated with. You would put the speederbike's odf in there to make it spawn when the rebels have that CP (if they are attacking)

All of this is explained in the getting started doc located in BF2_ModTools\documentation. Believe me, that doc will be your best friend. :D It explains how to create, munge, add CPs and vehicle spawns, and do many other basic things to your map.

Posted: Thu Nov 02, 2006 10:36 am
by odi-wan
so you mean when the cp belongs to the rebels i have to write it into the REBATK and when it belongs tot the imp i have to write it in the IMPATK or?

Posted: Thu Nov 02, 2006 11:30 am
by fusillade
Is imp_hover_speederbike added to your imp.req?
Do you have a imp_hover_speederbike.req file?
Are they correctly executed? Missing quotes? Brackets?

Side req's (imp.req located in your base imp sides folder) need "lvl" and then the listing of all the content your loading from that side.
Indivudual req's (imp_hover_speederbike.req located in /imp/req) need "class" and then the odf you assigned to it.

If you missed any of these, then your bikes will never spawn.
Nor will any log tell you that you messed this up.

Posted: Fri Nov 03, 2006 4:09 am
by odi-wan
well the imp_hover_speederbike is in the imp.req.... and i also wrote imp_hover_speederbike to classIMPATK cause the cp belongs to imp but the speeders still dont spawn... are there any special things with adding speeders on a hero assault map?

Posted: Sat Nov 04, 2006 6:13 am
by odi-wan
about the imp.req is it enough if it is in assets or does it have to be in my project

Posted: Sat Nov 04, 2006 8:32 am
by Pi314
if you don't have dc: in your lua file it can stay in the assats folder. That is if you didn't modify the bike like give it a new skin maybe.
If you did modify it you need the dc: in the lua file and you will have to have the imp folder copied to your project including the .req file.

My guess is you didn't modify the bikes so remove the dc: so the game reads the files from the original imp folder.

Posted: Sat Nov 04, 2006 7:30 pm
by odi-wan
well i removed the dc: but it still doesn't work

Posted: Sat Nov 04, 2006 8:30 pm
by somen00b
I don't know if this is a problem or not but are your 'readdatafile" lines out of order? The shipped maps always call things in a certain order (something like: units in order, heros, vehicles.) Someone correct me if I'm wrong. Thats all I can think of.

If someone can post a script to force the vehicle to spawn (create odf, or something) that would determine if the error was from the spawn point or the vehicle.

Wouldn't the dc: not matter, assuming he had a modded speeder bike, the old one would appear instead.

Posted: Sun Nov 05, 2006 9:45 pm
by XXXNewbie666XXX
Well i have a question:

The CP is from the layer conquest or is one create for you???

Posted: Mon Nov 06, 2006 9:03 am
by odi-wan
the cp is the base layer