Hud icon switching for bow that fires 2 arrows

Post » Sun Dec 06, 2009 1:13 pm

I am working on a mod that lets the player fire 2 arrows at once.

I need the bow icon in the HUD to show a number 2 or two arrows in a cross on it.

I looked in my Oblivion folders for the bow icon but could not find the one that is used in the HUD.
(I drew a number 2 on the ones I thought were the right ones but the altered dds did not show in the game.)

My question is which icon is it that shows the bow in the HUD and how would I use SetIconPath OBSE command to switch this when needed?
(what are the details involved in doing this.)
User avatar
sas
 
Posts: 3435
Joined: Thu Aug 03, 2006 8:40 am

Post » Sun Dec 06, 2009 10:43 am

It's the icon used by the bow's record. You'll probably be able to change the HUD's render using OBSE's UI functions ( find the weapon icon's trait in the hud_rectile.xml file and then use setMenuString to change the icon path ). The advantage of this method - The bow's actual icon doesn't change.
User avatar
Amy Siebenhaar
 
Posts: 3426
Joined: Fri Aug 10, 2007 1:51 am

Post » Sun Dec 06, 2009 8:02 pm

YOU ARE THE MAN! :celebration:

THANK YOU THANK YOU THANK YOU!

But, how do I find the weapon icon's trait in the hud_rectile.xml file?


(you are a man...right?)
:unsure:

It's the icon used by the bow's record. You'll probably be able to change the HUD's render using OBSE's UI functions ( find the weapon icon's trait in the hud_rectile.xml file and then use setMenuString to change the icon path ). The advantage of this method - The bow's actual icon doesn't change.

User avatar
james reed
 
Posts: 3371
Joined: Tue Sep 18, 2007 12:18 am

Post » Sun Dec 06, 2009 9:54 pm

But, how do I find the weapon icon's trait in the hud_rectile.xml file?


(you are a man...right?)
:unsure:
Looks like the info is in the hud_main_menu.xml file. The component's name should be : hudmain_statusbars\hudmain_Weapon_Icon\filename. So the function call should be :
setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\filename|Textures\DP\SomeIcon.dds" 1004
You might have to call this every frame.

And yes, I believe my grammatical gender does say Masculine ;)
User avatar
Sarah Unwin
 
Posts: 3413
Joined: Tue Aug 01, 2006 10:31 pm

Post » Sun Dec 06, 2009 10:01 pm

To test this I put this in my quest script (it runs at speed .001 I.E. every frame):

setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\filename\Textures\DP\glassflask.dds" 1004


The glassflask.dds is from the vanilla folders but I put a copy in a new folder called DP.

Like this:

Data\Textures\DP\glassflask.dds

Nothing shows up in the game.Are you sure the "SetMenuStringValue" command is suppose to do this? I read the OBSE docs description on it but could not understand it from just command description. The sampe they show seems to be about text not icons.

:shrug:


How do you view the hud_main_menu.xml file? What program will view the file?
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Sun Dec 06, 2009 5:48 pm

How do you view the hud_main_menu.xml file? What program will view the file?
Use any normal text editor, don't try to open it as an XML (with Internet Explorer or something) cause that won't work.

Nothing shows up in the game.Are you sure the "SetMenuStringValue" command is suppose to do this? I read the OBSE docs description on it but could not understand it from just command description. The sampe they show seems to be about text not icons.

:shrug:
Oh wait, it could just be due to a typo, the function needs a | between the 'trait to set' and the 'new texture path'
setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\filename|Textures\DP\glassflask.dds" 1004
If it still won't work then the rest of my post (what I initially wanted to post) may be of interest. Or if you decide replacing the entire weapon icon isn't as nice as you had thought.

--------------------------------

I noticed something similar when I tried to dynamically change the HUD's spell icon, no matter what I did or how fast the code ran the icon would not be updated. I suspect it has something to do with the engine overriding any change immediately thus the icon remains unchanged.

But there are a few alternatives, perhaps even better than what you are doing right now.

Firstly you can try using the 'status icon' for the weapon (you know, is it stolen, enchanted, etc.) with something like this
setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user0" 1004 1                      ;This needs to be non-zero for the status icon to appearsetMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|YourArrowCross.dds" 1004

If it is good enough to show just a 2 for the ammo count you can try changing this (which is the trait that determines the amount of ammo left that will be displayed)
setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user3" 1004 2
Hope it helps, and good luck with the rest of the mod, I'm keeping my eyes on it. :)

-kyoma
User avatar
Chloe :)
 
Posts: 3386
Joined: Tue Jun 13, 2006 10:00 am

Post » Sun Dec 06, 2009 3:00 pm

errr...not working...
you mean like this right?

setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|Textures\DP\glassflask.dds" 1004

I have the copy of the test DDS (glassflask.dds) in

Data\Textuers\DP\


edit: maybe it is the DDS, so now I am trying a custom dds with two little arrows where the poison icon would go next to the bow. I used the poison DDS as my base for this so it should be the right size and format.

Edit2: errr...no still not showing in game. :huh:


setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user0" 1004 1                      ;This needs to be non-zero for the status icon to appearsetMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|YourArrowCross.dds" 1004


User avatar
Sarah Kim
 
Posts: 3407
Joined: Tue Aug 29, 2006 2:24 pm

Post » Sun Dec 06, 2009 10:59 am

You know those previously mentioned weirdities about Oblivion?

Check this one out: http://cs.elderscrolls.com/constwiki/index.php/Icons

Icons must go in the Icons folder, or a subfolder within the Icons folder. The Icons folder is found at

... \Oblivion\Data\Textures\Menus\Icons\


Ain't Oblivion programming a hoot?
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Sun Dec 06, 2009 11:30 am

well, I put the icon here:

C:\Program Files\Bethesda Softworks\Oblivion\Data\Textures\menus\iconsicon_2XArrows.dds

and I have this running each frame:

Begin gamemode

setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user0" 1004 1
setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|icon_2XArrows.dds" 1004

end

but still nothing.


wait: I see a mistake....

Textures\menus\iconsicon_2XArrows.dds


be back soon...


no I had it right in my folder I just typed it wrong here, here is the real one:

C:\Program Files\Bethesda Softworks\Oblivion\Data\Textures\menus\icons\icon_2XArrows.dds


So no it is still not working.
User avatar
Connor Wing
 
Posts: 3465
Joined: Wed Jun 20, 2007 1:22 am

Post » Sun Dec 06, 2009 1:56 pm

I will try this again using a standard poison icon.


nope:


setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user0" 1004 1
setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|icon_poisoned_weapon.dds" 1004


Still did not work.
User avatar
Spaceman
 
Posts: 3429
Joined: Wed May 23, 2007 10:09 am

Post » Sun Dec 06, 2009 7:20 am

Try changing it to a hammer icon from vanilla, in case your modified icon has a problem.

Also try adding more of the path to the icon in the command. How much is in the actual xml file? Looks like you need "Menus\Icons\icon_2XArrows.dds"
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Sun Dec 06, 2009 10:27 pm

uhhhggg....

I need to get dinner for my goddaughter and myself, I will be back to try again in an hour.

Thanks.
User avatar
Trey Johnson
 
Posts: 3295
Joined: Thu Oct 11, 2007 7:00 pm

Post » Sun Dec 06, 2009 3:01 pm

Off thought: Do you use DarNUI or anything else that might change the XML files?
User avatar
Margarita Diaz
 
Posts: 3511
Joined: Sun Aug 12, 2007 2:01 pm

Post » Sun Dec 06, 2009 3:46 pm

No UI or HUD or menu mods at all in my load order except for Map Maker Overhaul mod by TheNiceOne.

But I will try again with NO mods installed.

Do you happen to have this icon swapping command in your own game and it is working?
I mean do we know for a fact it works? Are there any mods that do this kind of thing already (dynamically add an icon to the hudmain_Weapon_Icon in the hud ?

Last thing I tried :

setMenuFloatValue "hudmain_statusbars\hudmain_Weapon_Icon\user0" 1004 1
setMenuStringValue "hudmain_statusbars\hudmain_Weapon_Icon\user1|Menus\Icons\icon_poisoned_weapon.dds" 1004


Off thought: Do you use DarNUI or anything else that might change the XML files?

User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Sun Dec 06, 2009 1:44 pm

Maybe the icon display in the hud is just too hard coded to change. It will always display the icon associated with the weapon.

In that case, maybe you could back-door it and use:

SetIconPath - sets the icon path for the type
(nothing) reference.SetIconPath iconPath:string objectID:ref

And change the weapons actual icon to a generic double shot one and then back again afterward?
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Sun Dec 06, 2009 6:20 am

No UI or HUD or menu mods at all in my load order except for Map Maker Overhaul mod by TheNiceOne.
I was using DarNUI when I looked up the XML file. I heavily doubt it, but there is a chance that the trait might not be valid with the vanillaUI. Try calling the function with DarNUI to confirm if this is indeed the case.
User avatar
Sakura Haruno
 
Posts: 3446
Joined: Sat Aug 26, 2006 7:23 pm

Post » Sun Dec 06, 2009 3:57 pm

yes, that is what I thought I was goining to do in the first place.
But I did not have the bow name of the icon to work with and was unsure of the pathway to plug into the command.
Then we kinda got off in another direction.


But I tired all 3 of the following (each frame and with a vanillia stabdard weapon icon) and yet no change.
(Are " " used or not?)

;set test to player.GetEquippedObject 9
;SetIconPath "Data\Textures\menus\icons\icon_inv_weapon_3.dds" test

;set test to player.GetEquippedObject 9
;SetIconPath Data\Textures\menus\icons\icon_inv_weapon_3.dds test

set test to player.GetEquippedObject 9
SetIconPath Textures\menus\icons\icon_inv_weapon_3.dds test


This is ridiculous.
Has anybody actually successfully done this?
Is it just me?
I just cannot believe the OBSE command was not tested, someone must have done what I am trying to do once before right?



Maybe the icon display in the hud is just too hard coded to change. It will always display the icon associated with the weapon.

In that case, maybe you could back-door it and use:

SetIconPath - sets the icon path for the type
(nothing) reference.SetIconPath iconPath:string objectID:ref

And change the weapons actual icon to a generic double shot one and then back again afterward?

User avatar
Rowena
 
Posts: 3471
Joined: Sun Nov 05, 2006 11:40 am

Post » Sun Dec 06, 2009 6:40 am

The last thing I tried:

set test to player.GetEquippedObject 16
SetIconPath Textures\menus\icons\icon_inv_weapon_3.dds test


I give up on this one. Instead I will throw up a no-collision object in front of the player (held in place relative to the player’s view off to the side) to “fake:” the needed HUD element. Thanks everyone for trying to help, this one was frustrating (not a fun script puzzle to work on) and it did make it better having help.


From the OBSE team:

Assuming the path is correct and the texture is usable by the game, it may simply be that the original texture remains cached so the game doesn't go and load the new texture. SetIconPath does nothing to try and get the game to reload assets. I have not played around with it to see if it's possible via script to coerce the game into reloading the texture.
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am


Return to IV - Oblivion