Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Companion Health Display


InsanitySorrow
 Share

Recommended Posts

Companion Health Display

A little while ago myself and Joben were randomly chatting about companion mods, namely our own creations. I had a quick idea that I thought would be nice to have where when your crosshair is over the companion you'll see it's health in the HUD, well Joben had some interest too :P. After thinking about it I decided to have a go and see what I could conjour up and this is my result.

Notes:

Quest Script

Requires OBSE v18+

Script:

;===========================
;Name: Companion Health Script
;Version: 1.0
;Author: InsanitySorrow
;===========================

;===========================
;Scriptname
;===========================

Scriptname aaISCompHealthScript

;===========================
;Variables
;===========================

Ref Target
Float fQuestDelayTime

Int CurrentHealth
Int BaseHealth

String_var Text

Short Initialize

;===========================
;Script
;===========================

Begin GameMode
If (GetGameLoaded)
If (Initialize)
let fQuestDelayTime := 0.005
let Initialize := 1
Endif
Endif

let Target := GetCrosshairRef

If (Target == 0)
Return
Else
If (Target.GetFactionRank PlayerFaction >= 0)
let CurrentHealth := Target.GetAv Health
let BaseHealth := Target.GetBaseAv Health
let Text := "Health: " + $CurrentHealth + "/" + $BaseHealth

SetMenuFloatValue "visible" 1005 2
SetMenuFloatValue "hudinfo_dest\visible" 1005 2
SetMenuStringValue "hudinfo_dest\string|%z", Text 1005
Endif
Endif
End[/code]

The main idea a behind this is that it will work on companions, Now after some research I noticed that about 90% of companions I looked at were all apart of the [b]PlayerFaction[/b], so I thought this would be the best thing to check for, though you could see if the companion is following you, but that may not be so good with some enemy NPCs.

Now with a simple edit to this rather simple script you can change when the health shows up by altering this line:

[b]If (Target.GetFactionRank PlayerFaction >= 0)[/b]

What you could do here is make the script require a specific reference which would limit it to your own Companions, incase it you don't want it on all companions. Or you could alter it so it shows on everyone.

[color=#FFA500]Example:[/color]

[b]If (Target == YourCompRef)[/b]

This will make the script only run when the Reference in the player's crosshair is this.

[b]If (Target > 0)[/b]

This will make it work on any ref (NPC/Creature) in the Crosshair.

Link to comment
Share on other sites

What a fantastic script and idea. :noway: IS does it again!

Thanks Grond :hugs:

Luckily, Fallout 3 already has this functionality against ALL NPC's and creatures.

I'm guessing Beth realised it would be a helpful addition since it was present in MW (with one of the expanions) but missing from OB :P

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...