Weapon and weapon ammo GUI display rendering issue
Katzenfleisch
Join Date: 2014-03-21 Member: 194881Members, Squad Five Blue, Squad Five Silver, NS2 Community Developer
in Modding
Hi,
I have successfully created new weapons for my mod, however I am stuck with an issue for a great amount of hours and can't figure out what this could be (as there isn't any errors at all, seem silently ignored).
In short, on the picture attached, the first one shows the ammo GUI not displayed, the second one how the weapon looks like (wrong) and the third one how it should really be.
I have been doing research on MyWeapon.kModelName, check twice TechData.lua, check MyWeapon:OnUpdateRender() (client side), read every NS2 weapons files, Check GetUIDisplaySettings(), etc. Now I am just running out of ideas.
So if someone has already solved this issue before feel free
Thank you
I have successfully created new weapons for my mod, however I am stuck with an issue for a great amount of hours and can't figure out what this could be (as there isn't any errors at all, seem silently ignored).
In short, on the picture attached, the first one shows the ammo GUI not displayed, the second one how the weapon looks like (wrong) and the third one how it should really be.
I have been doing research on MyWeapon.kModelName, check twice TechData.lua, check MyWeapon:OnUpdateRender() (client side), read every NS2 weapons files, Check GetUIDisplaySettings(), etc. Now I am just running out of ideas.
So if someone has already solved this issue before feel free
Thank you
Comments
You then need to create a GUIHeavyShotgunDisplay.lua based on GUIShotgundisplay.lua
Press ` to open the console and tell me what errors there are.
It's definitely a lua problem. It should be a copy of Shotgun.lua except for the changes that you made and the classname
You also don't need any of this
Edit: bad news, this do not seem to solve the problem (ammo display & third person view). The FadedHeavyShotgun.lua do not reference any "Shotgun" function (only a few globals) and I made a whole copy of GUIShotgunDisplay.lua. I can past you those files if needed but there are not much than the previous one except renaming and copy-pasting of missing function. I think the issue might be somewhere else.
Edit: I copy & past the NS2 Shotgun.lua and only replace Shotgun by HeavyShotgun and it works somehow... I will make test further until I reach the old weapon I tell you.
Except the clip size changed from 6 to 2 (in order to be sure we have the new weapon in hand) it has now the least amount of change possible after a full copy in order to make it works.
Little news: I managed to fix the ammo display on the weapon but the third person view is still wrong.
If anyone is stuck with this, the solution is pretty simple. (using "class 'HeavyShotgun' (Shotgun)" seems ok so far)
On the lua/Weapons/Weapon.lua there is a function "Weapon:OnUpdateRender" on
which there is a line: The ammo_display for my custom does not exist as I do not create any, but there was one for the shotgun. The HeavyRifle.lua from NS2 does the same in order to keep the ammo display GUI.
Searching now for the third view issue.
Just place those in the models/marine/shotgun folder of your mod
The world model never had an ammo display, I'll add it in vanilla sometime when I can, with a proper ammo display as well with numbers
I tried to change them but the result was not was I was expecting (seems not enough or I might changed it the wrong). If I correctly understand this will provide a better way to fix the ammo display than using the "textureNameOverride" ?