Horse Stamina Bar

Post » Sun May 18, 2014 1:58 am

After a solid week of Googling and messing around, I'm giving up and asking for help. I have a decent background in languages such as Java and C++, I just can't find the functions that I need to make this work.

The mod I have in mind is very simple. I want to have a horse stamina bar. The logic would be roughly as follows:

If(player.ismounted && horse.stamina < 100%){show stamina bar}else{hide stamina bar}

That's all I want to do.

I figure that the custom bar should be a relatively simple cut and paste of the player's stamina bar with the only necessary change being the stamina av would be from the horse instead of the player. It might even be possible to simply toggle the actor that the current bar is referencing based on the player being mounted or not instead of making a duplicate.

I'm not necessarily looking for someone to write this for me, I just can't figure out how to find the information that I need in order to put it together. Thank you very much for any help that is offered and please forgive me if I've managed to fail at searching the internet.

User avatar
chinadoll
 
Posts: 3401
Joined: Tue Aug 22, 2006 5:09 am

Post » Sun May 18, 2014 9:26 am

Now I could be wrong, but I'm about 99% sure that this is not possible via Papyrus or even through SKSE's extended library of functions. The UI as a whole is controlled by various .swf (Flash) files, and without editing those directly, I doubt you'll be able to replicate the behavior you're looking for. There are very few functions that control the UI in Papyrus (and even those disable it entirely), unfortunately.

User avatar
Lily
 
Posts: 3357
Joined: Mon Aug 28, 2006 10:32 am

Post » Sun May 18, 2014 6:45 am

Editing the Flash files or creating a widget for SkyUI is probably needed, but a quick look at the https://github.com/Mardoxx/skyrimui/blob/master/src/hudmenu/HUDMenu.as does reveal that there is a function called SetStaminaMeterPercent.

User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am

Post » Sun May 18, 2014 5:56 am

You'd need to create a SkyUI widget, you can edit the HUD itself but we don't recommend replacing any menus unless you intend to change the entire thing. If you want to make small changes we suggest making use of loadMovie and injecting your own swf into the target menu. When you inject a menu, that menu has access to the entire parent structure. Meaning you can edit the menu directly rather than replacing the whole thing.

As ElijahHouck pointed out, this is not possible without altering the flash menu as you would need to create a whole new stamina bar.

The existing stamina bar is tied directly to the player's stamina, your easier, less complicated alternative would be to constantly set the player's stamina to the horses stamina while you're riding the horse, then set it back to the player's when you dismount.

User avatar
Arnold Wet
 
Posts: 3353
Joined: Fri Jul 07, 2006 10:32 am

Post » Sat May 17, 2014 10:32 pm

PurpleLunchbox, would your alternative be doable in papyrus?

User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am


Return to V - Skyrim