Custom Side CP/Spawn Icons?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Custom Side CP/Spawn Icons?

Post by ROCKET »

I'm hoping to make a custom icon for my side's spawn screen, cp's, etc. I've tried adding the following to my LUA:

SetTeamIcon (1, "my_icon_msh")

But do I also need to create a .req or do anything else?
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

* Listens to crickets chirping *

LOL. Okay, well, I figured out a little bit more. Hopefully sharing it will give somebody a good idea.

First, my thought about SetTeamIcon in the LUA was wrong. It has nothing to do with the floating CP mesh. It actually calls out a texture. I haven't quite figured out where it's used.

Second, the data/Common/mshs folder contains the four team icon meshes. They are:

com_icon_alliance
com_icon_cis
com_icon_imperial (actually in the PC folder)
com_icon_republic

Interestingly, the meshes don't appear to have ODF's. At least not in the mod tool assets. The one ODF I found was com_holo_controlzone. Which looked promising, but the icon mesh reference was commented out:
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "hologram"

[Properties]
Color = "0 0 0"
NeutralColor = "255 255 255"
FriendlyColor = "30 220 30"
EnemyColor = "240 30 30"
LocalsColor = "240 220 30"
HoloType = "aligned"
//HoloImageGeometry = "com_icon_alliance"
HoloVisibleDistance = 200.0
HoloHeight = 3.5
HoloSize = 2.5
HoloBeamIntensity = 1.0
HoloLightIntensity = 1.0
HoloImageIntensity = 0.5
HoloFlareIntensity = 1.0
HoloLightRadius = 8.0
HoloRotateRate = 0.2
HoloPopRate = 0.01
HoloFlickerRate = 0.01
HoloFlickerAlphaMin = 0.4
HoloFlickerAlphaMax = 0.8
HoloFadeInTime = 2.0
And finally, I found reference to the team icon meshes in data/Common/ingame.req. But I can't find any reference to them in any of the LUA's. So how are they called out?
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: Custom Side CP/Spawn Icons?

Post by trainmaster611 »

Fyi, the cp properties are hardcoded into the game so you can't modify them.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Custom Side CP/Spawn Icons?

Post by [RDH]Zerted »

I've never tried changing the team icons. In the docs, SetTeamIcon is
SetTeamIcon (team, icon)
This function sets the icon of the specified team to the specified texture.
However, there is another SetTeamIcon in setup_teams.lua

Code: Select all

SetTeamIcon(team, name .. "_icon", "hud_reinforcement_icon", "flag_icon")
When starting new things, start out small. Meaning figure out how to change the Rebels icon to the Imp's icon before adding in your own. Do one step at a time. Keep in mind that the icons in the team stats page (ifs_teamstats.lua) are hard coded. You can't change them unless you have a custom common.lvl
Hidden/Spoiler:
.[code] -- set the team icon textures
local team1 = ScriptCB_TeamStatsGetTeam1();
if(team1 == 1) then -- aliance
this.LeftList.TeamIcon.texture = "all_icon"
this.RightList.TeamIcon.texture = "imp_icon"
elseif(team1 == 2) then
this.LeftList.TeamIcon.texture = "imp_icon"
this.RightList.TeamIcon.texture = "all_icon"
elseif(team1 == 3) then
this.LeftList.TeamIcon.texture = "rep_icon"
this.RightList.TeamIcon.texture = "cis_icon"
else
this.LeftList.TeamIcon.texture = "cis_icon"
this.RightList.TeamIcon.texture = "rep_icon"
end[/code]
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

trainmaster611 wrote:Fyi, the cp properties are hardcoded into the game so you can't modify them.
Are you sure about that, trainmaster? In a hex editor, I can see the icon meshes in the ingame.lvl file. Maybe there's a way to re-munge or hex-edit to swap an existing icon mesh with a new one?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Custom Side CP/Spawn Icons?

Post by Teancum »

Actually, just the team colors are hard coded. So stuff like changing blue to green (like in SWBF1) is impossible. Other than that the only hard-coded problems I've encountered are the inability to prone and not being able to strafe in a flyer.
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Doh! *slaps forehead* I just realized an easy way to do it.

1) Delete ingame.lvl from ..\data_abc\lvl_pc\ and back-up your ingame.lvl from ..\GameData\Data\LVL_PC\

2) Name your new icon mesh the same as the one you want to replace (com_icon_cis, etc)

3) Replace the existing team icon mesh in ..\data_abc\Common\mshs\ with your new one.

4) Munge your map.

5) Copy your new ingame.lvl file from ..\data_abc\lvl_pc\ to ..\GameData\Data\lvl_pc\

And here's my Wookiee icon (12 Ryyk blades):

Image

Of course, this isn't the type of solution to ship with a map and it won't work if your LUA names a side something other than REP, CIS, REB, or IMP. But I'm happy anyway.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Custom Side CP/Spawn Icons?

Post by Teancum »

Sweet lovin! Hopefully we can crack the ability to do it for custom sides. Just out of curiosity, post the LUA you're using on this era, I want to see if it's looking for something that I think makes in IMP/ALL/REP/CIS
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Here's the LUA, Teancum. The new icon was actually given to the CIS side. No icons show up in-game for the RKW side. What are you thinking?
Hidden/Spoiler:
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")

-- REP Attacking (attacker is always #1)
RKW = 1;
CIS = 2;
-- These variables do not change
ATT = RKW;
DEF = CIS;


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



--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: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(300)
SetMaxPlayerFlyHeight (300)

SetMemoryPoolSize ("ClothData",75)
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\\kas.lvl;kas2cw")

ReadDataFile("dc:SIDE\\RKW.lvl",
"rkt_wok_warrior",
"rkt_wok_hvyassault",
"rkt_wok_elder",
"rkt_wok_mechanic",
"rkt_wok_commando",
"rkt_wok_chieftan",
"rkt_wok_tyvokka",
"rkt_wok_kirlocca")


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


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

SetupTeams{
rkw = {
team = RKW,
units = 32,
reinforcements = 150,
soldier = { "rkt_wok_warrior",10, 10},
assault = { "rkt_wok_hvyassault",4, 4},
engineer = { "rkt_wok_mechanic",6, 6},
sniper = { "rkt_wok_elder",4, 4},
officer = {"rkt_wok_commando",4, 4},
special = { "rkt_wok_chieftan",4, 4},
-- AddUnitClass(1,"rkt_wok_kirlocca",1,1)

},
cis = {
team = CIS,
units = 32,
reinforcements = 180,
soldier = { "cis_inf_rifleman",10, 10},
assault = { "cis_inf_rocketeer",4, 4},
engineer = { "cis_inf_engineer",6, 6},
sniper = { "cis_inf_sniper",4, 4},
officer = {"cis_inf_officer",4, 4},
special = { "cis_inf_droideka",4, 4},
}
}

SetHeroClass(CIS, "cis_hero_darthmaul")
SetHeroClass(RKW, "rkt_wok_tyvokka")
SetTeamName (1, "rkw")
-- SetTeamIcon (RKW, "com_icon_alliance")


-- 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", 500)
SetMemoryPoolSize("SoldierAnimation", 500)
SetMemoryPoolSize("AmmoCounter", weaponCnt)
SetMemoryPoolSize("BaseHint", 1024)
SetMemoryPoolSize("EnergyBar", weaponCnt)
SetMemoryPoolSize("EntityCloth", 75)
SetMemoryPoolSize("EntityFlyer", 32)
SetMemoryPoolSize("EntityHover", 32)
SetMemoryPoolSize("EntityLight", 200)
SetMemoryPoolSize("EntitySoundStream", 4)
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:GTM\\GTM.lvl", "GTM_conquest")
ReadDataFile("dc:GTM\\GTM.lvl", "GTM_conquest")
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(RKW, RKW, "rep_off_com_report_us_overwhelmed", 1)
SetBleedingVoiceOver(RKW, CIS, "rep_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, RKW, "cis_off_com_report_enemy_losing", 1)
SetBleedingVoiceOver(CIS, CIS, "cis_off_com_report_us_overwhelmed", 1)

SetOutOfBoundsVoiceOver(2, "cisleaving")
SetOutOfBoundsVoiceOver(1, "repleaving")

SetAmbientMusic(RKW, 1.0, "rep_yav_amb_start", 0,1)
SetAmbientMusic(RKW, 0.8, "rep_yav_amb_middle", 1,1)
SetAmbientMusic(RKW, 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(RKW, "rep_yav_amb_victory")
SetDefeatMusic (RKW, "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.908386, -0.209095, -0.352873, -0.081226, -45.922508, -19.114113, 77.022636);

AddCameraShot(-0.481173, 0.024248, -0.875181, -0.044103, 14.767292, -30.602322, -144.506851);
AddCameraShot(0.999914, -0.012495, -0.004416, -0.000055, 1.143253, -33.602314, -76.884430);
AddCameraShot(0.839161, 0.012048, -0.543698, 0.007806, 19.152437, -49.802273, 24.337317);
AddCameraShot(0.467324, 0.006709, -0.883972, 0.012691, 11.825212, -49.802273, -7.000720);
AddCameraShot(0.861797, 0.001786, -0.507253, 0.001051, -11.986043, -59.702248, 23.263165);
AddCameraShot(0.628546, -0.042609, -0.774831, -0.052525, 20.429928, -48.302277, 9.771714);
AddCameraShot(0.765213, -0.051873, 0.640215, 0.043400, 57.692474, -48.302277, 16.540724);
AddCameraShot(0.264032, -0.015285, -0.962782, -0.055734, -16.681797, -42.902290, 129.553268);
AddCameraShot(-0.382320, 0.022132, -0.922222, -0.053386, 20.670977, -42.902290, 135.513001);
end
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Custom Side CP/Spawn Icons?

Post by Caleb1117 »

Sweet Mama!

KotOR era icons here I come!
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Yup. Now if we can only figure out how to do it without changing the icons in every map...
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Custom Side CP/Spawn Icons?

Post by Caleb1117 »

ROCKET wrote:Yup. Now if we can only figure out how to do it without changing the icons in every map...
Oh, yea, there is that.
But this is still pretty sweet, good job!
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Custom Side CP/Spawn Icons?

Post by Maveritchell »

Go ahead and try creating duplicates of the icon files for whatever side, rename them, and add them to the ingame.req. As long as you're adding content and not replacing content, you shouldn't have to affect previous/stock maps. That would also allow for a standard KotOR/whatever icon to be created for use in whatever.
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Sure, you can add lines to the ingame.req. But how does the game then know to use that info for your side's icon? I haven't been able to find anything in any of the scripts that defines which icon meshes are assigned to which side. Any ideas, anyone?
FragMe!
Gametoast Staff
Gametoast Staff
Posts: 2244
Joined: Sat May 13, 2006 12:34 am
Projects :: Not sure keep changing my mind.
Games I'm Playing :: F1 and SWBF
xbox live or psn: No gamertag set
Location: Origin name GT_FragMe
Contact:

Re: Custom Side CP/Spawn Icons?

Post by FragMe! »

there is this from the setup_teams.lua

Code: Select all

 local name = string.lower(name)
        SetTeamName(team, name)
        SetTeamIcon(team, name .. "_icon", "hud_reinforcement_icon", "flag_icon")
        SetUnitCount(team, side.units)
        SetReinforcementCount(team, side.reinforcements)
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Yes, FragMe, the SetTeamIcon line is what I first thought of to play around with. But everything I've read and seen shows that it calls out a texture (for the HUD?) and not the icon mesh for CP's.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: Custom Side CP/Spawn Icons?

Post by [RDH]Zerted »

ROCKET wrote:Yup. Now if we can only figure out how to do it without changing the icons in every map...
Check out this topic for the answer: http://www.gametoast.com/forums/viewtop ... 27&t=12600
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Custom Side CP/Spawn Icons?

Post by ROCKET »

Very cool, [RDH]Zerted! Thanks!

I guess we still can't assign icon meshes to non-standard side names, but we can just use the standard names for custom sides to be able to ship maps with custom cp icons.
Post Reply