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...

HUD Timer


InsanitySorrow
 Share

Recommended Posts

HUD Timer

This is a simple HUD element which adds a Timer to the HUD. There are two elements to be exact, one is the display of the Time Limit and the other is the actual time. When the Timer hits the limit (Which you set) the display will change and instead of a timer you get "Time is Up!" (in Red too :sick:). All can be edited in the script.

Notes:

Quest Script

Requires OBSE v18+

Pluggy v 125+

Script:


;===========================
;Name: HUD - Timer
;Version: 1.0
;Author: InsanitySorrow
;===========================

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

Scriptname aaISHUDTimerScript

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

Short Initialize

Float fQuestDelayTime
Float fTimer

Float PosX
Float PosY
Float Pos2X
Float Pos2Y
Float Pos3X
Float Pos3Y
Float Pos4X
Float Pos4Y

Int intLimit

Long Max
Long Limit
Long Timer
Long tTimer
Long HudTimer
Long HudtTimer
Long HudLimit
Long HudMax

Long font_style
Long font_height
Long font_width
Long font_weight
Long font_italic
Long font_r
Long font_g
Long font_b
Long font2_r
Long font2_g
Long font2_b

;===========================
;Script
;===========================
Begin GameMode
If (GetGameLoaded)
DelAllHudTs
let Initialize := 0
If (Initialize == 0)
let fQuestDelayTime := 0.001

let PosX := 90
let PosY := 100

let Pos2X := 20
let Pos2Y := 100

let Pos3X := 20
let Pos3Y := 90

let Pos4X := 90
let Pos4Y := 90

let intLimit := 30

Set Timer to CreateString -1 "%e"
Set tTimer to CreateString -1 "%e"
Set Limit to CreateString -1 "%e"
Set Max to CreateString -1 "%e"

Set font_style to CreateString -1 "Arial" 0 1
Set font_height to 14
Set font_width to 0
Set font_weight to 0
Set font_italic to 0
Set font_r to 200
Set font_g to 200
Set font_b to 200

Set HudTimer to NewHudT PosX PosY
SetHudT HudTimer Timer font_style 1 font_height font_width font_weight font_italic font_r font_g font_b 1

Set HudtTimer to NewHudT Pos2X Pos2Y
SetHudT HudtTimer tTimer font_style 1 font_height font_width font_weight font_italic font_r font_g font_b 1

Set HudLimit to NewHudT Pos3X Pos3Y
SetHudT HudLimit Limit font_style 1 font_height font_width font_weight font_italic font_r font_g font_b 1

Set HudMax to NewHudT Pos4X Pos4Y
SetHudT HudMax Max font_style 1 font_height font_width font_weight font_italic font_r font_g font_b 1

let Initialize := 1
Endif
Endif

Set fTimer to fTimer + GetSecondsPassed
SetString tTimer "Current Time: " 0
SetString Limit "Time Limit" 0
SetString Max "30 Secs" 0

If (fTimer < intLimit)
IntToString Timer fTimer 0
Else
Set font2_r to 209
Set font2_g to 3
Set font2_b to 13
SetHudT HudTimer Timer font_style 1 font_height font_width font_weight font_italic font2_r font2_g font2_b 1
SetString Timer "Time is Up!" 0
Endif

HudT_Text HudMax Max 0
HudT_Text HudLimit Limit 0
HudT_Text HudtTimer tTimer 0
HudT_Text HudTimer Timer 0
End
[/code]

[color=#FFA500][b]Changes:[/b][/color]

To set the Max limit change this:

[b]let intLimit := 30[/b]

Change the [b]30[/b] to your limit, the script will check to see if the current timer is under this, if not time is up.

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...