Page 1 of 1

2 huds ?!?

Posted: Mon Jun 29, 2009 7:46 pm
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]

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 7:48 pm
by Deviss
please post a screen :) i believe know which is the problem

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 7:57 pm
by philomen
Hidden/Spoiler:
Image
and sorry for size of image ... Imageshack makes my pics bigger even if i tell him not too :P

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 7:59 pm
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??

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 8:10 pm
by philomen
well the only thing i did was what the tutorial said ...

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 8:15 pm
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

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 9:20 pm
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.

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 10:08 pm
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.

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 10:14 pm
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?

Re: 2 huds ?!?

Posted: Mon Jun 29, 2009 10:25 pm
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

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 8:42 am
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)
}

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 9:05 am
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...

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 9:54 am
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 ?

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 12:31 pm
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.

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 12:52 pm
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?

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 1:06 pm
by AQT
May I redirect you to this WIP topic? http://www.gametoast.com/forums/viewtop ... 29&t=16518

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 2:27 pm
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

Re: 2 huds ?!?

Posted: Tue Jun 30, 2009 5:39 pm
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