Another weapon floating icon

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
Deviss
Master of the Force
Master of the Force
Posts: 3772
Joined: Tue Aug 12, 2008 7:59 pm
Projects :: Clone Wars Extended
Games I'm Playing :: BF2

Another weapon floating icon

Post by Deviss »

hello to everybody, i am trying improve my mod, and yes i read every post about floating icons, but anyway i am getting duplicate icon for weapon :S, one on right place and one on middle of screen xD.
my mission .lua file(cor1x_con) :
Hidden/Spoiler:
[code]--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
Conquest = ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
ScriptCB_DoFile("legion501st_con")

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

-- Empire Attacking (attacker is always #1)
CIS = ATT
REP = DEF

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

if setup_legion501st ~= nil then
setup_legion501st()
else
print("Oops, legion501st_con.lua wasn't loaded. Something's wrong with my map setup...")
end
--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"}
cp6 = CommandPost:New{name = "cp6"}

--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:AddCommandPost(cp6)

conquest:Start()


end

function ScriptInit()
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 2000)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 3000)
SetMemoryPoolSize("ParticleTransformer::PositionTr", 2000)

-- Designers, these two lines *MUST* be first.

SetPS2ModelMemory(4056000)

SetMapNorthAngle(180, 1)
SetMaxFlyHeight(25)
SetMaxPlayerFlyHeight (25)
AISnipeSuitabilityDist(30)

SetUberMode(1);
ReadDataFile("dc:ingame.lvl")
ReadDataFile("ingame.lvl")

SetMemoryPoolSize ("Combo",1000) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",1000) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",1000) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",1000) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",6000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",1000) -- should be ~1x #combo
SetMemoryPoolSize ("ClothData",400)
SetMemoryPoolSize ("EntityCloth",400)
SetMemoryPoolSize ("Music", 200)

ReadDataFile("sound\\cor.lvl;cor1cw")
ReadDataFile("dc:sound\\ABC.lvl;ABCcw")

ReadDataFile("dc:SIDE\\501st.lvl",
"rep_501st_clon1",

ReadDataFile("dc:SIDE\\Confederacy.lvl",
"cis_inf_battledroid",

ReadDataFile("dc:SIDE\\Force.lvl",
"cis_hero_grievous",
"rep_hero_anakin_cloaked")

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


SetupTeams{
rep = {
team = REP,
units = 40,
reinforcements = 150,
soldier = { "rep_501st_clon1",18, 20},

},
cis = {
team = CIS,
units = 40,
reinforcements = 150,
soldier = { "cis_inf_battledroid",8, 20},
}
}

SetHeroClass(REP, "rep_hero_anakin_cloaked")
SetHeroClass(CIS, "cis_hero_grievous")



-- Level Stats
ClearWalkers()
AddWalkerType(0, 5) -- 8 droidekas (special case: 0 leg pairs)
AddWalkerType(1, 0) --
AddWalkerType(2, 0) -- 2 spider walkers with 2 leg pairs each
AddWalkerType(3, 0) -- 2 attes with 3 leg pairs each
local weaponCnt = 1410
SetMemoryPoolSize ("Aimer", 1024)
SetMemoryPoolSize ("AmmoCounter", weaponCnt)
SetMemoryPoolSize ("BaseHint", 1024)
SetMemoryPoolSize ("ConnectivityGraphFollower", 700)
SetMemoryPoolSize ("EnergyBar", weaponCnt)
SetMemoryPoolSize ("EntityHover", 20)
SetMemoryPoolSize ("EntityFlyer", 20)
SetMemoryPoolSize ("EntityLight", 300)
SetMemoryPoolSize ("EntityRemoteTerminal", 32)
SetMemoryPoolSize ("EntitySoundStatic", 400)
SetMemoryPoolSize ("EntitySoundStream", 500)
SetMemoryPoolSize ("MountedTurret", 200)
SetMemoryPoolSize ("Navigator", 1024)
SetMemoryPoolSize ("Obstacle", 1800)
SetMemoryPoolSize ("PathFollower", 1024)
SetMemoryPoolSize ("PathNode", 1024)
SetMemoryPoolSize ("SoldierAnimation", 1024)
SetMemoryPoolSize ("TreeGridStack", 1024)
SetMemoryPoolSize ("UnitAgent", 1024)
SetMemoryPoolSize ("UnitController", 1024)
SetMemoryPoolSize ("Weapon", weaponCnt)
SetMemoryPoolSize ("SoundSpaceRegion", 100)
SetMemoryPoolSize ("RedOmniLight", 200)
SetMemoryPoolSize ("RedShadingState", 200)

SetSpawnDelay(10.0, 0.25)
ReadDataFile("cor\\cor1.lvl","cor1_Conquest")
SetDenseEnvironment("True")
-- SetMaxFlyHeight(25)
--SetMaxPlayerFlyHeight (25)
AddDeathRegion("DeathRegion1")

-- Sound Stats

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("dc:sound\\ABC.lvl", "ABC_stream")
-- OpenAudioStream("sound\\global.lvl", "global_vo_quick")
-- OpenAudioStream("sound\\global.lvl", "global_vo_slow")
OpenAudioStream("sound\\cor.lvl", "cor1")
OpenAudioStream("sound\\cor.lvl", "cor1")
-- OpenAudioStream("sound\\cor.lvl", "cor1_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(2, "Repleaving")
SetOutOfBoundsVoiceOver(1, "Cisleaving")

SetAmbientMusic(REP, 1.0, "rep_cor_amb_start", 0,1)
SetAmbientMusic(REP, 0.8, "rep_cor_amb_middle", 1,1)
SetAmbientMusic(REP, 0.2, "rep_cor_amb_end", 2,1)
SetAmbientMusic(CIS, 1.0, "cis_cor_amb_start", 0,1)
SetAmbientMusic(CIS, 0.8, "cis_cor_amb_middle", 1,1)
SetAmbientMusic(CIS, 0.2, "cis_cor_amb_end", 2,1)

SetVictoryMusic(REP, "rep_cor_amb_victory")
SetDefeatMusic (REP, "rep_cor_amb_defeat")
SetVictoryMusic(CIS, "cis_cor_amb_victory")
SetDefeatMusic (CIS, "cis_cor_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
--Tat 1 - Dune Sea
AddCameraShot(0.419938, 0.002235, -0.907537, 0.004830, -15.639358, 5.499980, -176.911179);
AddCameraShot(0.994506, 0.104463, -0.006739, 0.000708, 1.745251, 5.499980, -118.700668);
AddCameraShot(0.008929, -0.001103, -0.992423, -0.122538, 1.366768, 16.818106, -114.422173);
AddCameraShot(0.761751, -0.117873, -0.629565, -0.097419, 59.861904, 16.818106, -81.607773);
AddCameraShot(0.717110, -0.013583, 0.696703, 0.013197, 98.053314, 11.354497, -85.857857);
AddCameraShot(0.360958, -0.001053, -0.932577, -0.002721, 69.017578, 18.145807, -56.992413);
AddCameraShot(-0.385976, 0.014031, -0.921793, -0.033508, 93.111061, 18.145807, -20.164375);
AddCameraShot(0.695468, -0.129569, -0.694823, -0.129448, 27.284357, 18.145807, -12.377695);
AddCameraShot(0.009002, -0.000795, -0.996084, -0.087945, 1.931320, 13.356332, -16.410583);
AddCameraShot(0.947720, -0.145318, 0.280814, 0.043058, 11.650738, 16.955814, 28.359180);
AddCameraShot(0.686380, -0.127550, 0.703919, 0.130810, -30.096384, 11.152356, -63.235146);
AddCameraShot(0.937945, -0.108408, 0.327224, 0.037821, -43.701199, 8.756138, -49.974789);
AddCameraShot(0.531236, -0.079466, -0.834207, -0.124787, -62.491230, 10.305247, -120.102989);
AddCameraShot(0.452286, -0.179031, -0.812390, -0.321572, -50.015198, 15.394646, -114.879379);
AddCameraShot(0.927563, -0.243751, 0.273918, 0.071982, 26.149965, 26.947924, -46.834148);

end


[/code]
my custom ingame.req:
Hidden/Spoiler:
[code]ucft
{
REQN
{
"model"
"com_inv_mesh"

}

REQN
{
"config"
"1playerhud"
"com_sfx_buffed_defense"
"com_sfx_buffed_offense"
}
REQN
{
"script"
"points"
}

REQN
{
"class"
"com_item_powerup_ammo"
"com_item_powerup_health100"
"com_item_powerup_health25"
"com_item_powerup_dual"
}
}
[/code]
my 1playerhud.hud:
Hidden/Spoiler:
[code]ViewPort("Transforms")
{
EventNameFilter("player%")

// First Weapons Section

TransformNameMesh("player1weapon1")
// add msh names of first weapons here and remove unused lines
{
NameMesh("com_weap_DC-17m_Anti_Armor_A", "com_inv_mesh")
NameMesh("com_weap_DC-17m_Anti_Armor_B", "com_inv_mesh")
NameMesh("com_weap_DC-17m_Blast_A", "com_inv_mesh")
NameMesh("com_weap_DC-17m_Blast_B", "com_inv_mesh")
NameMesh("com_weap_DC-17m_Sniper_Rifle_A", "com_inv_mesh")
NameMesh("com_weap_DC-17m_Sniper_Rifle_B", "com_inv_mesh")
NameMesh("com_weap_DC-15m_Side_Arm_A", "com_inv_mesh")
NameMesh("com_weap_DC-15m_Side_Arm_B", "com_inv_mesh")


EventInput("player1.weapon1.change")
EventOutput("player1.weapon1.mesh")
}
}

Group("extraWeaponDisplay")
{
PropagateAlpha(1)
Viewport(1)
Position(0.0000000, 1.000000, 0.000000, "Viewport")
ZOrder(255)
EventEnable("player1.weaponsEnable")
EventDisable("player1.weaponsDisable")

Group("extraWeaponIcon")
{
Viewport(1)
Position(0.346161, -0.450412, 0.000000, "Viewport")
EventEnable("initialize")

Model3D("player1.weapon1mesh")
{
EventMesh("player1.weapon1.change")
Viewport(1)
ZOrder(5)
EventEnable("player1.weapon1.mesh")
EventDisable("player1.weapon1.disable")
Position(500.000000, 500.000000, 500.000000, "Viewport")
Rotation(0.804269, 359.994110, 359.999695)
Scale(0.000000, 0.000000, 0.000000)

//change position, rotation and scale of first weapon here, remove unused lines

MeshInfo("com_weap_DC-17m_Anti_Armor_A")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
Scale(0.770000, 0.770000, 0.770000)
}

MeshInfo("com_weap_DC-17m_Anti_Armor_B")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
}

MeshInfo("com_weap_DC-17m_Blast_A")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
Scale(0.950000, 0.950000, 0.950000)
}

MeshInfo("com_weap_DC-17m_Blast_B")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
}

MeshInfo("com_weap_DC-17m_Sniper_Rifle_A")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
Scale(0.950000, 0.950000, 0.950000)
}

MeshInfo("com_weap_DC-17m_Sniper_Rifle_B")
{
Position(-0.243000, 0.360000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
}

MeshInfo("com_weap_DC-15m_Side_Arm_A")
{
Position(-0.260000, 0.350000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
}

MeshInfo("com_weap_DC-15m_Side_Arm_B")
{
Position(-0.260000, 0.350000, 0.007000, "Viewport")
Rotation(0.800000, 90.000000, 360.000000)
}



}
}
}

// Second Weapons Section

TransformNameMesh("player1weapon2")
// add names of second weapons here
{
NameMesh("hud_grenade", "com_inv_mesh")
NameMesh("com_weap_fusioncutter", "com_inv_mesh")
NameMesh("hud_haywiredetonator", "com_inv_mesh")
NameMesh("hud_yellow_grenade", "com_inv_mesh")
NameMesh("hud_stealt", "com_inv_mesh")
NameMesh("com_weap_inf_ecd", "com_inv_mesh")
NameMesh("com_weap_inf_sonicdetonator", "com_inv_mesh")
NameMesh("frag", "com_inv_mesh")
NameMesh("glop", "com_inv_mesh")
NameMesh("rep_weap_Demolition_Charges", "com_inv_mesh")

EventInput("player1.weapon2.change")
EventOutput("player1.weapon2.mesh")
}

Group("extraWeaponDisplay")
{
PropagateAlpha(1)
Viewport(1)
Position(0.0000000, 1.000000, 0.000000, "Viewport")
ZOrder(255)
EventEnable("player1.weaponsEnable")
EventDisable("player1.weaponsDisable")

Group("extraWeaponIcon")
{
Viewport(1)
Position(0.346161, -0.450412, 0.000000, "Viewport")
EventEnable("initialize")

Model3D("player1.weapon2mesh")
{
EventMesh("player1.weapon2.change")
Viewport(1)
ZOrder(5)
EventEnable("player1.weapon2.mesh")
EventDisable("player1.weapon2.disable")
Position(500.000000, 500.000000, 500.000000, "Viewport")
Rotation(0.804269, 359.994110, 359.999695)
Scale(0.000000, 0.000000, 0.000000)

// adjust position, rotation and scale of second weapon here

MeshInfo("hud_grenade")
{
Position(-0.290000, 0.248431, 0.000000, "Viewport")
Scale(0.350000, 0.350000, 0.350000)
}

MeshInfo("hud_yellow_grenade")
{
Position(-0.284209, 0.250243, 0.006280, "Viewport")
Rotation(0.056783, 359.996582, 359.999695)
Scale(0.610000, 0.610000, 0.610000)
}

MeshInfo("hud_stealth1")
{
Position(-0.269500, 0.250000, 1.800601, "Viewport")
Rotation(0.002055, 90.580322, 0.000000)
Scale(0.270000, 0.270000, 0.270000)
}

MeshInfo("weap_inf_ECdetonator")
{
Position(-0.274201, 0.265000, 1.000000, "Viewport")
Rotation(0.000000, 0.000000, 360.000000)
Scale(1.700000, 1.700000, 1.700000)
}

MeshInfo("weap_inf_protoncharge")
{
Position(-0.274201, 0.265000, 1.000000, "Viewport")
Rotation(0.000000, 0.000000, 359.999695)
Scale(1.600000, 1.600000, 1.600000)
}

MeshInfo("com_weap_Grenade_Thermaldetonator")
{
Position(-0.274201, 0.265000, 1.000000, "Viewport")
Rotation(80.000000, -120.000000, 359.999695)
Scale(1.600000, 1.600000, 1.600000)
}

MeshInfo("weap_inf_sonicdetonator")
{
Position(-0.274000, 0.270000, 1.000000, "Viewport")
Rotation(0.000000, 0.000000, 360.000000)
Scale(1.400000, 1.400000, 1.400000)
}

MeshInfo("com_weap_vibroblade_fp")
{
Position(-0.220000, 0.325000, 30.000000, "Viewport")
Scale(0.900000, 0.900000, 0.900000)
}

MeshInfo("rep_weap_Demolition_Charges")
{
Position(-0.250000, 0.244000, 0.000000, "Viewport")
Rotation(90.000000, 180.000000, 360.000000)
Scale(0.800000, 0.800000, 0.800000)
}

MeshInfo("com_weap_inf_frag")
{
Position(-0.260000, 0.260000, 0.000000, "Viewport")
Rotation(0.000000, 90.747269, 360.000000)
Scale(1.800000, 1.800000, 1.800000)
}

MeshInfo("V1_det")
{
Position(-0.260000, 0.260000, 0.000000, "Viewport")
Rotation(0.000000, 90.747269, 360.000000)
Scale(1.400000, 1.400000, 1.400000)
}

MeshInfo("weap_inf_glopdetonator")
{
Position(-0.280000, 0.247000, 0.000000, "Viewport")
Rotation(110.000000, 20.000000, 0.000000)
Scale(1.700000, 1.700000, 1.700000)
}

MeshInfo("weap_inf_detonator_arranged")
{
Position(-0.280000, 0.247000, 0.000000, "Viewport")
Rotation(110.000000, 20.000000, 0.000000)
Scale(1.700000, 1.700000, 1.700000)
}

MeshInfo("rep_weap_tripodturret")
{
Position(-0.280000, 0.275000, -0.000330, "Viewport")
Rotation(0.000000, 130.000000, 0.000000)
Scale(0.200000, 0.200000, 0.200000)
}

MeshInfo("com_weap_fusioncutter")
{
Position(-0.250000, 0.250000, -0.000330, "Viewport")
Rotation(355.836060, 135.827820, 69.479843)
Scale(0.900000, 0.900000, 0.900000)
}

MeshInfo("hud_haywiredetonator")
{
Position(-0.284209, 0.250243, 0.006280, "Viewport")
Rotation(0.056783, 359.996582, 359.999695)
Scale(0.610000, 0.610000, 0.610000)
}
}
}
}[/code]
whats wrong :S ?? thanks in advance!!
Post Reply