2 huds ?!?

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
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

2 huds ?!?

Post by philomen »

OK just a small question ...

Its not the first time i fix custom weapon icons, but this time something weird is happening...
The icon is at the right place in the hud alright but there is a second weapon icon that appears and floats on-screen so I now have 2 hud icons for each of my weapons, and thats for most of my maps ( the ones with my custom sides ) so I must've done something wrong... can any1 help me :P

this is the weapons's lua/req
Hidden/Spoiler:
[code]Code:

ViewPort("Transforms")
{
EventNameFilter("player%")

// First Weapons Section

TransformNameMesh("player1weapon1")
// add msh names of first weapons here and remove unused lines
{
NameMesh("weap_inf_dc17pistol", "com_inv_mesh")
NameMesh("rep_weap_inf_new_rifle", "com_inv_mesh")
NameMesh("rep_inf_underhand_chaingun2", "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("weap_inf_dc17pistol")
{
Position(-0.258881, 0.364262, 0.013887, "Viewport")
Rotation(0.804269, 90.747269, 359.999695)
Scale(0.720000, 0.720000, 0.720000)
}

MeshInfo("rep_weap_inf_new_rifle")
{
Position(-0.222832, 0.361293, 0.014590, "Viewport")
Rotation(0.804269, 90.747269, 359.999695)
}

MeshInfo("rep_inf_underhand_chaingun2")
{
Position(-0.222832, 0.361293, 0.014590, "Viewport")
Rotation(0.804269, 90.747269, 359.999695)
}
}
}
}

// Second Weapons Section

TransformNameMesh("player1weapon2")
// add names of second weapons here
{
NameMesh("hud_thermaldetonato2", "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_thermaldetonato2")
{
Position(-0.274201, 0.284023, 15.000000, "Viewport")
Rotation(0.000000, 0.000000, 359.999695)
Scale(1.750000, 1.750000, 1.750000)
}
}
}
}





[/code]

and this is an example of my weapon's odf
Hidden/Spoiler:
[code][WeaponClass]
ClassParent = "com_weap_inf_pistol"
GeometryName = "weap_inf_dc17pistol.msh"

[Properties]

GeometryName = "weap_inf_dc17pistol"
HighResGeometry = "weap_inf_dc17pistol"
OrdnanceName = "rep_weap_inf_pistol_ord"
HUDTag = "weap_inf_dc17pistol"[/code]
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

Re: 2 huds ?!?

Post by Deviss »

please post a screen :) i believe know which is the problem
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

Re: 2 huds ?!?

Post by philomen »

Hidden/Spoiler:
Image
and sorry for size of image ... Imageshack makes my pics bigger even if i tell him not too :P
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

Re: 2 huds ?!?

Post by Deviss »

philomen wrote:
Hidden/Spoiler:
Image
and sorry for size of image ... Imageshack makes my pics bigger even if i tell him not too :P
no problem sir :wink: , well i remove the HUDTag lines from your weapon odf and look if work, you modified the ingame file or added extraweaponsHUD??
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

Re: 2 huds ?!?

Post by philomen »

well the only thing i did was what the tutorial said ...
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

Re: 2 huds ?!?

Post by Deviss »

philomen wrote:well the only thing i did was what the tutorial said ...
well so only remove the line: HUDTag of your weapon's odf, this should work fine
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: 2 huds ?!?

Post by AQT »

RepSharpshooter incorporated the JKA DC-15A into the ingame.lvl as part of the Unofficial 1.2/1.3 patch. It was renamed from rep_weap_inf_new_rifle to the rep_weap_inf_rifle. If you also do this, you won't need to add the rifle to the extraweapons.hud file.
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

Re: 2 huds ?!?

Post by philomen »

well i tried removing the hud tags and everything but now as you said the rifle works ... but i still have the underhand chaingun and the dc-17 pistol and they won't appear where i want them to appear ... they are at 2 places like the rifle or they are floating around alone. I really have noooooo idea how to fix this.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: 2 huds ?!?

Post by AQT »

Try using these coordinates for the underhand chaingun
Hidden/Spoiler:
[code] Position(-0.239334, 0.328393, 0.007124, "Viewport")
Rotation(1.538445, 95.690582, 4.455857)
Scale(0.700000, 0.700000, 0.700000)[/code]
As for the DC-17 pistol, which version are you using?
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

Re: 2 huds ?!?

Post by philomen »

no no I've been using those coordinates but it's like the pic i posted with the rifle... there's 2 hud icons for each of my custom republic weapons
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

Re: 2 huds ?!?

Post by Deviss »

philomen wrote:no no I've been using those coordinates but it's like the pic i posted with the rifle... there's 2 hud icons for each of my custom republic weapons
MeshInfo("rep_weap_dc17pistol")
{
Position(-0.256269, 0.356366, -0.002834, "Viewport")
Rotation(0.804269, 90.747269, 359.999695)
}

for VF501's chaingun

MeshInfo("rep_weap_VF_chaingun")
{
Position(-0.239334, 0.328393, 0.007124, "Viewport")
Rotation(1.538445, 95.690582, 4.455857)
Scale(0.650000, 0.650000, 0.650000)
}
RepSharpshooter
Gametoast Staff
Gametoast Staff
Posts: 1351
Joined: Tue Jul 10, 2007 4:10 pm

Re: 2 huds ?!?

Post by RepSharpshooter »

philomen wrote:no no I've been using those coordinates but it's like the pic i posted with the rifle... there's 2 hud icons for each of my custom republic weapons
I appreciate the guys trying to help him with this, but the coordinates have nothing to do with the dual icon issue. Having two icons is a strange problem that for me, showed up and went away depending on which sides I read in first in the lua. I have no idea why. In any case, I abandoned the extraweapons in the side method as it never seemed to work right for me.

This is what I do:
  • Replace the code in common/hud/pc/1playerhud.hud with the code in your extraweapons.hud
  • Change the ingame.req as follows:
    Hidden/Spoiler:
    ucft
    {
    REQN
    {
    "model"
    "com_inv_mesh"

    }
    REQN
    {
    "config"
    "1playerhud"
    }
    }
    (make sure com_inv_mesh.msh is in the common/mshs folder)
  • In your LUA, add a new line like so:
    Hidden/Spoiler:
    ReadDataFile("ingame.lvl")
    ReadDataFile("dc:ingame.lvl")
  • Munge with common checked, and copy over the ingame.lvl from your data_ABC/_LVL_PC to your addon folder's similar directory.

Oh and at the top of your extraweapons.hud, theres this:
Code:
That is not a part of any syntax, I don't know why it's there...
philomen
Second Lance Corporal
Second Lance Corporal
Posts: 117
Joined: Tue Jul 08, 2008 8:25 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: Here

Re: 2 huds ?!?

Post by philomen »

thx alot for your help :D i'll try this ang give you news

hmmmm and in the hud/pc/1playerhud ... do i remove evrything and replace it completely or i just add what i had in the extraweapons ?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: 2 huds ?!?

Post by AQT »

philomen wrote:hmmmm and in the hud/pc/1playerhud ... do i remove evrything and replace it completely or i just add what i had in the extraweapons ?
You would replace it completely because the original ingame.lvl would still be read allowing you to keep the new HUD, etc.
User avatar
yukisuna
Rebel Sergeant
Rebel Sergeant
Posts: 210
Joined: Wed Jan 28, 2009 5:50 am
Projects :: My new PC hates the Mod Tools
Games I'm Playing :: See Interests
xbox live or psn: Samura Yukisuna
Location: Stuck in a place full of happy happiness known as Steam.

Re: 2 huds ?!?

Post by yukisuna »

philomen wrote:
Hidden/Spoiler:
Image
and sorry for size of image ... Imageshack makes my pics bigger even if i tell him not too :P


OFF-TOPIC: great map! and that clone skin/model fits very good in the map! you gonna release this any soon?
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: 2 huds ?!?

Post by AQT »

May I redirect you to this WIP topic? http://www.gametoast.com/forums/viewtop ... 29&t=16518
User avatar
hunting shadow
Private First Class
Posts: 79
Joined: Sun Jan 18, 2009 11:37 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Somewhere in the wilderness of Mandalore
Contact:

Re: 2 huds ?!?

Post by hunting shadow »

Ähm, guys, i think there's a simplier solution for his problem. I got that bug to, and onlything you have to do to fix it is adding this (only the red line) to the viewport section in your extraweapons.hud( direct at the beginjning) (in my case it's dc15marine, just change the name) Code:

ViewPort("Transforms")
{
EventNameFilter("player%")
TransformNameMesh("player1weapon1")
{
NameMesh("dc15marine", "com_inv_mesh")
And add this to your side's .req :

REQN
{
"model"
"com_inv_mesh"
}

This is of course only a fix for users of the extraweapons.hud-thing- fix
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

Re: 2 huds ?!?

Post by Deviss »

RepSharpshooter wrote:
philomen wrote:no no I've been using those coordinates but it's like the pic i posted with the rifle... there's 2 hud icons for each of my custom republic weapons
I appreciate the guys trying to help him with this, but the coordinates have nothing to do with the dual icon issue. Having two icons is a strange problem that for me, showed up and went away depending on which sides I read in first in the lua. I have no idea why. In any case, I abandoned the extraweapons in the side method as it never seemed to work right for me.

This is what I do:
  • Replace the code in common/hud/pc/1playerhud.hud with the code in your extraweapons.hud
  • Change the ingame.req as follows:
    Hidden/Spoiler:
    ucft
    {
    REQN
    {
    "model"
    "com_inv_mesh"

    }
    REQN
    {
    "config"
    "1playerhud"
    }
    }
    (make sure com_inv_mesh.msh is in the common/mshs folder)
  • In your LUA, add a new line like so:
    Hidden/Spoiler:
    ReadDataFile("ingame.lvl")
    ReadDataFile("dc:ingame.lvl")
  • Munge with common checked, and copy over the ingame.lvl from your data_ABC/_LVL_PC to your addon folder's similar directory.

Oh and at the top of your extraweapons.hud, theres this:
Code:
That is not a part of any syntax, I don't know why it's there...
that work for you? because i tried it, and appear 2 icons, one good localizated and one don't localizated xD, so i make a custom ingame always i suggest make the same :D
Post Reply