ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Adding the time to the HUD

1 2 3 4 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  18:22:45  8 March 2009
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
Messages: 1868
Adding the time to the HUD

Hi everyone,

Can anyone tell me if it is possible to add the in-game time (the same time that is shown on the PDA) to the HUD (and if so, how)?

Thanks.

CM
  18:32:16  8 March 2009
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
 

Message edited by:
bamah
03/08/2009 23:08:17
Messages: 911
Time display for hud no frame

Add to bind_stalker.script


--Time display for in game mini map
show_time()




--Time display for in game mini map
function show_time()
local hud = get_hud()
local cs = hud:GetCustomStatic("hud_show_time"
if cs == nil then
hud:AddCustomStatic("hud_show_time", true)
cs = hud:GetCustomStatic("hud_show_time"
end
local time_h = level.get_time_hours()
local time_m = level.get_time_minutes()
local msg
if time_m >= 10 then
msg = string.format(" d:d\\n", time_h, time_m)
else
msg = string.format(" d:d\\n", time_h, time_m)
end
if cs ~= nil then
cs:wnd():SetText(msg)
end
end



Add to ui_custom_msgs.xml

<hud_show_time x="90" y="204" width="900" height="100" complex_mode="1">
<text font="letterica18" r="255" g="255" b="255" a="255" align="l"/>
</hud_show_time>

edit
Parentheses for smiley

edit for BobQ
d: = percent zero two D colon
  22:21:56  8 March 2009
profilee-mailreply Message URLTo the Top
BobBQ
2007-2017
(Resident)

 

 
On forum: 07/30/2007
Messages: 3336
What is "" supposed to be? I'm getting an unsupported character there.
  04:18:55  9 March 2009
profilee-mailreply Message URLTo the Top
Storm Shadow
A machine, a Shadow Machine.
(Resident)

 

 
On forum: 11/14/2007
 

Message edited by:
Storm Shadow
03/09/2009 4:28:58
Messages: 1429
Bamah, bro if you put [ pre ] and [ /pre ] (without the spaces) headers around your code, it will display correctly. eg:


code:
(1 2 3 4")
d:
end code, etc.



edit: fucken forum software, nevermind my post, I don't seam to know what I'm talking about. lol.

edit2: the other way you can do it, is to put italic marks in between your code, eg:

%02d:

so, without spaces, it looks like this: %[ i ][ /i ]0[ i ][ /i ]2d:
  04:56:58  9 March 2009
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
Messages: 1868

---QUOTATION---
What is "" supposed to be? I'm getting an unsupported character there.
---END QUOTATION---



Yeah, I can't work out what those characters are meant to be either
  05:26:11  9 March 2009
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
Messages: 911
Romulous,

You have mail!
  05:46:37  9 March 2009
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
Messages: 1868

---QUOTATION---
Romulous,

You have mail!
---END QUOTATION---



That I do. Thank you very much, I will add the code to the relevant file, and will give it a try!

Regards.
  05:53:55  9 March 2009
profilee-mailreply Message URLTo the Top
Don Reba
Bishop and Councilor of War
(Moderator)

 

 
On forum: 12/04/2002
 

Message edited by:
Don Reba
03/09/2009 5:56:29
Messages: 11641
Just in case someone needs this code later:


--Time display for in game mini map
show_time()
 
--Time display for in game mini map
function show_time()
        local hud = get_hud()
        local cs = hud:GetCustomStatic("hud_show_time")
        if cs == nil then
                hud:AddCustomStatic("hud_show_time", true)
                cs = hud:GetCustomStatic("hud_show_time")
        end
        local time_h = level.get_time_hours()
        local time_m = level.get_time_minutes()
        local msg
        if time_m >= 10 then
                msg = string.format(" %02d:%02d\\n", time_h, time_m)
        else
                msg = string.format(" %02d:%02d\\n", time_h, time_m)
        end
        if cs ~= nil then
                cs:wnd():SetText(msg)
        end
end
  05:58:06  9 March 2009
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
Messages: 1868
Sigh. I must have done something wrong, it does not work for me. This is all I see after changing bind_stalker and ui_custom:
http://img26.imageshack.us/img26/4474/xr3da2009030914553064.jpg

Same old HUD
  06:59:18  9 March 2009
profilee-mailreply Message URLTo the Top
BobBQ
2007-2017
(Resident)

 

 
On forum: 07/30/2007
Messages: 3336
No luck for me either.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.