Fix for Floating Weapon Icons

Releasing the source files for your mod or map? Post em' here. (Applies to both SWBF1 & SWBF2)

Moderator: Moderators

Post Reply
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:

Fix for Floating Weapon Icons

Post by FragMe! »

Good News:
I have managed to get Mike Z's code for moving floating weapon Icons to the proper place working.
What this allows for is the fixed weapon icon locations to be shipped with any modded side.
This works for shipped weapons as well as newly created ones.
Please take note this only works for modded sides it is not an overall game fix.
Please read the instuctions carefully.

The link below is for a zip of the tutorial and files required to do this.
As well there is the GAR side (Naboo Guards) as an example
If you have any questions please post them here.

Download Links:
Floating_Icon_Fix_Tutorial.zip


Edit: The required files and instructions, without the GAR example side, is now on Filetoast. It is called FloatingWeaponIconTutorial.zip and is only 6k compared to the 4.5 Mb of the other link.

Enjoy
FragMe!


Floating Weapons Fix for Vista/Windows 7

Dual Icon Fix
ARC_Commander
High General
High General
Posts: 838
Joined: Tue Feb 06, 2007 7:18 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Post by ARC_Commander »

Nice... very nice! Good work!
Darth_Z13
Jedi High Council
Jedi High Council
Posts: 2275
Joined: Sat Jun 17, 2006 9:51 am
xbox live or psn: Xanthius Wylon
Location: Canada

Post by Darth_Z13 »

Worked like a charm for me. Thanks! :D
Penguin
Jedi Admin
Jedi Admin
Posts: 2541
Joined: Sun Mar 05, 2006 12:00 am
Location: Australia

Post by Penguin »

worked like a charm for me as well xD
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:

Post by FragMe! »

It's great to hear that is working good for all.
My campaign to rid the world of floating weapon icons is proceeding as planned. :twisted:

This is probably a given but the modded side can be used on any map and the icons will be in the right place.

Cheers
Master Fionwë
Rebel Colonel
Rebel Colonel
Posts: 598
Joined: Wed May 30, 2007 3:33 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: At RCTC
Contact:

Post by Master Fionwë »

It didn't work for me. :(
I'm still trying to figure it out.
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:

Post by FragMe! »

I appologize for digging up an old topic but I have found something out that may help people that have been having problems, especially with termaldetonators for some reason.
Anyway you can use any msh as an Icon it doesn't necessarily have to be the weapons msh. This can be helpful esppecially with thermals as they use an HUD file that is not the easiest thing to change.

Here is what you need to do.
1. Create the Icon msh
2. Place it in your sides folder.
3. In you weapon odf put the msh name in on the HUDtag = line
4. Add the msh name to the sides .req file as shown below. (fake_icon is just the name I chose to use)

Code: Select all

   REQN
    {
    "model"
    "com_inv_mesh"
    "fake_icon"
    }
5. Add the lines in the extraweapons.hud file as you normally would using the name of the msh you created.
6. Munge the side and you see the Icon.

By way of prove this is a msh from the DeathStar that I renamed fake_icon and put into the side. An yes that is the icon it is not just sitting there.

Image

Hope this helps.
theITfactor
Chief Warrant Officer
Chief Warrant Officer
Posts: 327
Joined: Wed Jun 28, 2006 12:56 pm
Projects :: The Pwnfest and Games Complex
Games I'm Playing :: SWTOR
xbox live or psn: You and I Know
Location: The Old Republic
Contact:

Post by theITfactor »

Cool! This should help out a lot. :wink:
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Post by Eggman »

How convenient, I was just about to go hunting for this and here it is right at the top of the page, and better yet, with an update! :D
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:

Post by FragMe! »

One additional note, especially with regards to the exisiting thermal detonator icon, the msh is very two dimensional, if it looks like the icon is no longer floating but doesn't appear where it was supposed to be it might be 90 degrees to the screen. Try changing the middle number under rotation
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

Beautiful work, FragMe. Works, as previously mentioned, like a charm. Glad to finally be able to fix this problem.

EDIT: I may have overlooked something, but I'm not entirely sure this works with melee weapons.
-_-
Gametoast Staff
Gametoast Staff
Posts: 2678
Joined: Sat May 07, 2005 1:22 pm

Post by -_- »

Sometimes you'll need to reference the texture in the .req if your hud icon shows up white.
REQN
{
"texture"
"insert_texture_name_here"
}
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:

Post by FragMe! »

The melee weapons, especially light sabers, could be fun never tried one. They also use the 2D hud icon msh files.
Best I can suggest is find a similar weapon and chase back through the weapon hierarchy and find out what it uses. This is what I have done for things I have tried. BTW most of the Icon tga files can be found in the data/common/interface folder while the msh files (those nasty 2D ones) can be found in data/common/mshs folder
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Post by Maveritchell »

That was my problem, then. I tried using a 3D mesh for a melee weapon HUD. Oh wells.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: Fix for Floating Weapon Icons

Post by Sporadia »

I'm bumping this after many many years because I've found a glitch.
If you have 2 or more sides with extraweapons.hud, and you load units from both sides into the same mission, one of the hud files will work correctly, but the rest will be broken. And the code that will be broken is the code that removes the old floating weapon icons, not the code that repositions the new hud icon.

So for example I have a side called FIS, and a side called SEP. Both of these sides have a different extraweapons.hud. There's a bunch of missions where I'm loading a droid from SEP and Ventress from FIS. Sometimes Ventress will have a floating weapon icon in the middle of the screen, or sometimes the droid will have a floating weapon icon in the middle of the screen. The code that repositions the new hud icon always works for both units. If Ventress has floating weapon icons and the units in SEP don't, then I can remove the ReadDataFile() for SEP, and the hud for Ventress starts working. The same is true in reverse. The order of the ReadDataFile() in the lua determines which one is broken (the last ReadDataFile in a mission is the one that works correctly. The other ones have floating weapon icons. Not including sides which don't have an extraweapons.hud).

I also managed to break Ventress' hud by loading a Grievous from SEP which doesn't even use custom hud icons, because sep.req still contains extraweapons.hud so loading any unit from SEP or FIS will create this problem.

I'm trying to figure out the source of this conflict. It doesn't fix it if you rename com_inv_mesh.msh or extraweapons.hud or the names in TransformNameMesh() or Group(). But there's definitely something going on that you can't do/load multiple times in the same mission.

There are 2 workarounds I can think of but both are a pain. One is to make sure every extraweapons.hud is the same for every side. So if one overwrites the other it won't matter. But this means whenever you want to change something, you have to copy over every extraweapons.hud in every side folder.
The other is to handle it all in a single side called HUD. Where HUD only contains hud.req, com_inv_mesh.msh and extraweapons.hud. Then you can do all the hud changes in that one side, but you will have to add ReadDataFile("dc:SIDE\\hud.lvl") to every single mission lua you could possibly need it in (so basically all of them). And that's a nuisance too.
I haven't tested either of these yet because I'm hoping there'll be a way to stop the files conflicting.

Edit: I can see from searching the site that I'm not the first person to have this problem. It looks like most people avoid it by keeping just the one hud file in one side and then loading that side in every mission lua.
Post Reply