Jump to content

Recommended Posts

Hi, made small changes to the bars I posted earlier if anyone is interested. If bar is full it doesn't show anymore and it starts to fade in when bar goes less, so at 100% bar is invisible and at 50% it's fully visible. Also added hygiene bar. But still I don't recommend using these to play, this is modder resource or an example only because it overwrites the ESP files. If anyone knows how to access gobal variables of other mods let me know and I can make aa better version of this. :)

needbars2.zip

Link to comment

Hi, it always bothered me that there was no mod for showing bars of RND in UI so I looked how it was done and made a simple mod that covers RND and PN.

It was simple? I was trying to do that for VT for like ever but I could never figure out how so I stopped trying! Please would you mind explaining how it's done? I'm totally out of ideas ._.
Link to comment

Sure, it was a bit complicated to learn because it's not documented anywhere for some reason, but you can use SkyUI and SKSE to add any widgets to HUD.

 

First create new script, call it "MyWidgetMeter", here is the contents:

 

 

Scriptname MyWidgetMeter Extends SKI_WidgetBase


; -------------------------------------------------------------------------------------------------
; PRIVATE VARIABLES -------------------------------------------------------------------------------


float	_width			= 292.8
float	_height			= 25.2
int		_primaryColor	= 4259840
int		_secondaryColor	= 3342336
int		_flashColor		= -1
string 	_fillDirection	= "both"
float	_percent		= 0.0


; -------------------------------------------------------------------------------------------------
; PROPERTIES --------------------------------------------------------------------------------------


float property Width
	{Width of the meter in pixels at a resolution of 1280x720. Default: 292.8}
	float function get()
		return _width
	endFunction

	function set(float a_val)
		_width = a_val
		if (Ready)
			UI.InvokeFloat(HUD_MENU, WidgetRoot + ".setWidth", _width)
		endIf
	endFunction
endProperty

float property Height
	{Height of the meter in pixels at a resolution of 1280x720. Default: 25.2}
	float function get()
		return _height
	endFunction

	function set(float a_val)
		_height = a_val
		if (Ready)
			UI.InvokeFloat(HUD_MENU, WidgetRoot + ".setHeight", _height)
		endIf
	endFunction
endProperty

int property PrimaryColor
	{Primary color of the meter gradient RRGGBB [0x000000, 0xFFFFFF]. Default: 0xFF0000. Convert to decimal when editing this in the CK}
	int function get()
		return _primaryColor
	endFunction

	function set(int a_val)
		_primaryColor = a_val
		if (Ready)
			UI.InvokeInt(HUD_MENU, WidgetRoot + ".setColor", _primaryColor)
		endIf
	endFunction
endProperty

int property SecondaryColor
	{Secondary color of the meter gradient, -1 = automatic. RRGGBB [0x000000, 0xFFFFFF]. Default: -1. Convert to decimal when editing this in the CK}
	int function get()
		return _secondaryColor
	endFunction

	function set(int a_val)
		SetColors(_primaryColor, a_val, _flashColor)
	endFunction
endProperty

int property FlashColor
	{Color of the meter warning flash, -1 = automatic. RRGGBB [0x000000, 0xFFFFFF]. Default: -1. Convert to decimal when editing this in the CK}
	int function get()
		return _flashColor
	endFunction

	function set(int a_val)
		_flashColor = a_val
		if (Ready)
			UI.InvokeInt(HUD_MENU, WidgetRoot + ".setFlashColor", _flashColor)
		endIf
	endFunction
endProperty

string property FillDirection
	{The position at which the meter fills from, ["left", "center", "right"] . Default: center}
	string function get()
		return _fillDirection
	endFunction

	function set(string a_val)
		_fillDirection = a_val
		if (Ready)
			UI.InvokeString(HUD_MENU, WidgetRoot + ".setFillDirection", _fillDirection)
		endIf
	endFunction
endProperty

float property Percent
	{Percent of the meter [0.0, 1.0]. Default: 0.0}
	float function get()
		return _percent
	endFunction

	function set(float a_val)
		_percent = a_val
		if (Ready)
			UI.InvokeFloat(HUD_MENU, WidgetRoot + ".setPercent", _percent)
		endIf
	endFunction
endProperty


; -------------------------------------------------------------------------------------------------
; EVENTS ------------------------------------------------------------------------------------------


; @override SKI_WidgetBase
event OnWidgetReset()

	parent.OnWidgetReset()

	; Init numbers
	float[] numberArgs = new float[6]
	numberArgs[0] = _width
	numberArgs[1] = _height
	numberArgs[2] = _primaryColor as float
	numberArgs[3] = _secondaryColor as float
	numberArgs[4] = _flashColor as float
	numberArgs[5] = _percent
	UI.InvokeFloatA(HUD_MENU, WidgetRoot + ".initNumbers", numberArgs)

	; Init strings
	string[] stringArgs = new string[1] ;This is an array because I want to add more to it later...
	stringArgs[0] = _fillDirection
	UI.InvokeStringA(HUD_MENU, WidgetRoot + ".initStrings", stringArgs)

	; Init commit
	UI.Invoke(HUD_MENU, WidgetRoot + ".initCommit")
	
endEvent


; -------------------------------------------------------------------------------------------------
; FUNCTIONS ---------------------------------------------------------------------------------------


; @overrides SKI_WidgetBase
string function GetWidgetSource()
	return "skyui/meter.swf"
endFunction

; @overrides SKI_WidgetBase
string function GetWidgetType()
 return "MyWidgetMeter"
endFunction

function SetPercent(float a_percent, bool a_force = false)
	{Sets the meter percent, a_force sets the meter percent without animation}
	_percent = a_percent
	if (Ready)
		float[] args = new float[2]
		args[0] = a_percent
		args[1] = a_force as float
		UI.InvokeFloatA(HUD_MENU, WidgetRoot + ".setPercent", args)
	endIf
endFunction

function ForcePercent(float a_percent)
	{Convenience function for SetPercent(a_percent, true)}
	SetPercent(a_percent, true)
endFunction


function StartFlash(bool a_force = false)
	{Starts meter flashing. a_force starts the meter flashing if it's already animating}
	if (Ready)
		UI.InvokeBool(HUD_MENU, WidgetRoot + ".startFlash", a_force)
	endIf
endFunction


function ForceFlash()
	{Convenience function for StartFlash(true)}
	StartFlash(true)
endFunction

function SetColors(int a_primaryColor, int a_secondaryColor = -1, int a_flashColor = -1)
	{Sets the meter percent, a_force sets the meter percent without animation}
	_primaryColor = a_primaryColor;
	_secondaryColor = a_secondaryColor;
	_flashColor = a_flashColor;

	if (Ready)
		int[] args = new int[3]
		args[0] = a_primaryColor
		args[1] = a_secondaryColor
		args[2] = a_flashColor
		UI.InvokeIntA(HUD_MENU, WidgetRoot + ".setColors", args)
	endIf
endFunction

function TransitionColors(int a_primaryColor, int a_secondaryColor = -1, int a_flashColor = -1, int a_duration = 1000)
	{Sets the meter percent, a_force sets the meter percent without animation}
	_primaryColor = a_primaryColor;
	_secondaryColor = a_secondaryColor;
	_flashColor = a_flashColor;

	if (Ready)
		int[] args = new int[4]
		args[0] = a_primaryColor
		args[1] = a_secondaryColor
		args[2] = a_flashColor
		args[3] = a_duration
		UI.InvokeIntA(HUD_MENU, WidgetRoot + ".transitionColors", args)
	endIf
endFunction

 

 

Notice the two "MyWidgetMeter" - this is in script name and the type under functions. This is the script you will extend later.

 

Then create next script, for example if you want to make hunger bar you could do this:

 

 

scriptname MyHungerBar extends MyWidgetMeter

String Function GetWidgetSource()

	Return "rndbars/meter.swf"
	
EndFunction

 

 

The source is how the widget looks like, it looks to be flash player file, I'm not sure how to edit these or what variables you'd have to set there. You can use the default skyrim health bar one that's in the mod archive I uploaded. This goes into "Data/Interface/Exported/Widgets/rndbars/meter.swf".

 

Now you have a bar script all set up, only thing to do is load script to game and add another script that controls the parameters of this bar (for example % filled).

 

So create another script:

 

 

scriptname HungerBarUpdate extends Quest

MyHungerBar property HungerBar auto
GlobalVariable property myGlobalValue auto

Event OnInit()
	HungerBar.HAnchor = "left"
	HungerBar.VAnchor = "bottom"
	HungerBar.X = 45
	HungerBar.Y = 40
	HungerBar.Alpha = 100.0
	HungerBar.SetPercent(1.0)
	HungerBar.FillDirection = "right"
	HungerBar.SetColors(0x99FF66, 0x336600)
; All these values of bar can be changed any time you like, so you can change color, move it around, change size etc. whatever you like.

	StartUpdating()
endEvent

Event OnGameReload()
	StartUpdating()
endEvent

Event OnUpdate()
	UpdateMeter()
	RegisterForSingleUpdate(2)
endEvent

function StartUpdating()
	RegisterForSingleUpdate(2)
endFunction

function UpdateMeter()
	HungerBar.SetPercent(myGlobalValue.GetValue() / 100.0)
; SetPercent(0) is empty and SetPercent(1) is full
; example how to fade bar into certain alpha value:
; HungerBar.FadeTo(0, 3.0) <- this would take 3 seconds to fade to 0 (not visible), 100 is fully visible
; you can also just set alpha if you want it instantly:
; HungerBar.Alpha = 0
endFunction

 

 

After that you have to compile the scripts. Now all you have to do is create a quest to start the scripts. Create new quest call it MyBarQuest. Click OK, then open the quest again and go to scripts, add MyHungerBar and HungerBarUpdate scripts. Click OK again and open quest again (CK problems :P) then edit properties of HungerBarUpdate script, set HungerBar property to the quest itself (it should be the only choice) and fill the global value property to whatever global value you want to use to control the bar per cent. Click OK and save plugin. Now the bar should appear when you go into game. You can also edit MyHungerBar script properties to see and set all the possible values of the bar (width, height, alpha etc.) but it can also be done in script, whichever you prefer.

 

If it says the SKI_* script is missing then https://github.com/schlangster/skyui here you can download source (Download ZIP) option and in dist/data/scripts/source are the SKI_* scripts, but I'm not sure if it's necessary or not.

 

If you have any problems let me know. :)

Link to comment

Sure, it was a bit complicated to learn because it's not documented anywhere for some reason, but you can use SkyUI and SKSE to add any widgets to HUD.

I could so kiss you to death right now!

 

I won't cuz I don't want you to die but I totally would! ^^ Thank youuuuu! I'll try this tomorrow!

Link to comment

when I could see latrines with doors?

 

Why would you want doors? What would be the point? Its already pretty dark in there as it is, if there was a door you wouldn't be able to see much of anything anyway. I simply want to go be able to go indoors purely because some dungeons do not allow you to.. thus you have to go and cannot but you can't leave because you are doing a dungeon and thus.. frustration when your stamina goes down and you wet yourself from holding it. Though I've generally been dealing with that. Being able to wash up from anywhere would be nice as well. Could make it so that you get dirtier quicker if you use the "wash up" option... hmm was a thought.

 

-C

 

My character can't seem to bath even thought they are very dirty.  Do I need soap or something?

 

You need to stand in water, about up to your thighs, though sometimes I've had it only up to my ankles and managed to bathe. use the bathe thingie in the powers menu, activate it, use it like a shout and voila! You bathe. Soap helps you keep cleaner longer, you're pretty much unkempt if you bathe with no soap. Hope that helps :)

 

-C

Link to comment

Was wondering if you could help the modder of Lakeview Avant Garden for Hearthfire and the modder for Lakeview Extended for Hearthfire.  Avant Garden already has the outhouse, but it does not work like the others that Private Needs is associated with.  The author of Avant Garden is considering adding the outhouses to his other two Hearthfire mods, specifically Heljarchen Pool and Hot Bath for Hearthfire and his Winstaad version. 

 Lakeview Extended is one that uses Lakeview Pool and Hot Bath by permission of the original author. 

 

Link to comment

Considering that:

 

With the latest release and plugins, this mod became a "must".

It's aboslutely stable, bugfree, and works fine into almost all situations.

Works perfectly along RealisticWater Two and RealisticNeedsAndDiseases.

 

Why not:

 

Integrate the "sperm cover" from SexLab inside the dirty/bathing system?

Link to comment

Considering that:

 

With the latest release and plugins, this mod became a "must".

It's aboslutely stable, bugfree, and works fine into almost all situations.

Works perfectly along RealisticWater Two and RealisticNeedsAndDiseases.

 

Why not:

 

Integrate the "sperm cover" from SexLab inside the dirty/bathing system?

 

To my knowledge and experience that's what the Sexlab plugin is supposed to do :)

 

-C

Link to comment

Deactivate the ESP from Strotis mod, if there is any, and only install the meshes and textures from it.

PN will then place outhouses behind inns. Go check behind the Sleeping Giant in Riverwood.

 

Excuse my idiocy... I have Outhouse of Skyrim installed, not Strotis; Sorry for wasting your time. Now all I have to do is wait for The Nexus' servers to cool down so I can go on the site.

Link to comment

Was wondering if you could help the modder of Lakeview Avant Garden for Hearthfire and the modder for Lakeview Extended for Hearthfire.  Avant Garden already has the outhouse, but it does not work like the others that Private Needs is associated with.  The author of Avant Garden is considering adding the outhouses to his other two Hearthfire mods, specifically Heljarchen Pool and Hot Bath for Hearthfire and his Winstaad version. 

 Lakeview Extended is one that uses Lakeview Pool and Hot Bath by permission of the original author. 

 

I know the guy personally through IM, but he had no idea Private Needs exists, and so he asks about how to make his mod compatible with Private Needs.

 

EDIT: He was concerned that trying to create a compatible version will require this mod and another, as PN attaches what appears to be a script to the outhouse.

Link to comment

Hi,

 

is this mod in further developement?

I haven't given up on the mod. It's just been on hold for quite awhile, RL is really busy. While I do have lots of time to type code, I don't actually have lots of time to think about how to code new features and hence the hiatus. I have fixed a few bugs so far and partially done preparing the new features, ie. setting up global values, adding in new messages and preparing the effects, I haven't actually scripted anything for the new features and I don't expect I'll have time until mid December to do anything.

Link to comment

 

Hi,

 

is this mod in further developement?

I haven't given up on the mod. It's just been on hold for quite awhile, RL is really busy. While I do have lots of time to type code, I don't actually have lots of time to think about how to code new features and hence the hiatus. I have fixed a few bugs so far and partially done preparing the new features, ie. setting up global values, adding in new messages and preparing the effects, I haven't actually scripted anything for the new features and I don't expect I'll have time until mid December to do anything.

 

 

Thank's for your reply. At least we can hope for an update ...

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use