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

« Previous 10 events | 1 2 3 4 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  20:29:50  12 March 2009
profilee-mailreply Message URLTo the Top
Darius6
The sound guy...
(Resident)

 

 
On forum: 04/05/2007
 

Message edited by:
Darius6
03/12/2009 20:30:48
Messages: 2131
Btw, this sort of relates to this: Anyone know how to set the "layering" in the hud elements? I managed to add the clock time to the minimap, but the time display is sort of under the minimap background texture, I'd like to have it on top of it. Not a big problem, but the color of the font sort of "fades" when it's under the other texture.

There must be a file with some sort of "priority", which elements are drawn on top of what.
  06:50:45  14 March 2009
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
Messages: 1868

---QUOTATION---
I wanted to ask, may I use this function in the upcoming version of 1154 hud? And if yes, who should I credit for it?
---END QUOTATION---



Hi Dairus6,

I posted in your other thread, but yes - you may use it. I would credit bamah. Don Reba should also get a mention for posting the version of the code with spaces for added clarity

Regards,

CM
  14:06:43  14 March 2009
profilee-mailreply Message URLTo the Top
Darius6
The sound guy...
(Resident)

 

 
On forum: 04/05/2007
Messages: 2131

---QUOTATION---
I wanted to ask, may I use this function in the upcoming version of 1154 hud? And if yes, who should I credit for it?

Hi Dairus6,

I posted in your other thread, but yes - you may use it. I would credit bamah. Don Reba should also get a mention for posting the version of the code with spaces for added clarity

Regards,

CM
---END QUOTATION---



Thanks! Well, I'll just go ahead and credit all of you.
  17:25:39  14 March 2009
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
Messages: 911
Credit for initial time script

Hi Darius,

Credit Antonium2027, I got the basics from his mod...he deserves the credit on the execution.
Bamah
  14:20:01  11 November 2010
profilee-mailreply Message URLTo the Top
kkk177
(Novice)
 
On forum: 02/21/2008
 

Message edited by:
kkk177
11/11/2010 14:37:47
Messages: 44

---QUOTATION---
You put the function call in the loop the way I said. The "function call" is the single line I quoted: show_time(). It is the call to the function show_time().

Just put that one line inside the loop block, as I'll show below.

The routine itself is is a separate function. You put it at the same "level" as the other "function xxx() ... end" routines.
__________
function show_time()
    -- ... the contents of the function are here
end

function actor_binder:update(delta)
       -- ... stuff
       if self.next_restrictors_update_time < time then
               bind_restrictor.actor_update(delta)
               show_time() -- put this line here
               -- ... more stuff
       end
       -- ... still more stuff
end

¯¯¯¯¯¯¯¯¯¯
If you declare a function A() inside another function B(), that A() function is not global, it is only accessible in the block where it is placed in B() -- if the language permits this.
---END QUOTATION---



Hi! I`m refreshing this post, can anyone help me? I just try to put this clock on HUD but it don`t work - there is game crash:

FATAL ERROR

[error]Expression : fatal error
[error]Function : CScriptEngine::lua_error
[error]File : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line : 73
[error]Description : <no expression>
[error]Arguments : LUA error: ...ow of chernobyl\gamedata\scripts\task_manager.script:210: attempt to index field '?' (a nil value)

All lines in these two files are ok, copied lines to proper place. I have 1.0006 version of the game.

ui_custom_msgs.xml:

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


bind_stalker.script:

.......

function actor_binder:__init (obj) super(obj)
self.bCheckStart = false
self.weather_manager = level_weathers.WeatherManager()
self.actor_detector = xr_detector.actor_detector()
end
----------------------------------------------------------------
function show_time()
local hud = get_hud()
...........
end
----------------------------------------------------------------
function actor_binder:net_spawn(data)

.........


function actor_binder:update(delta)
object_binder.update(self, delta)
............
if self.next_restrictors_update_time < time then
bind_restrictor.actor_update(delta)

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

self.next_restrictors_update_time = time + 200

task_manager.actor_update()
end

..........

Thanks
  12:35:17  12 November 2010
profilee-mailreply Message URLTo the Top
romulous
Senior Resident
 

 
On forum: 12/28/2007
 

Message edited by:
romulous
11/12/2010 12:46:49
Messages: 1868
Hi kkk177,

Could you zip up both ui_custom_msgs.xml and bind_stalker.script and upload them somewhere so I can take a look at them? When we did this originally, I found that the bind_stalker.script especially was very picky about where you added the extra lines. Add it in the slightly wrong spot, and game would crash every time. I have a working version here, but only for 1.0005, and I don't know if either of those files changed with the 1.0006 patch.

Edit: Here is a working version for 1.0005, you might want to try it. Apart from the time, the files are vanilla. I do have a 1920x1200 resolution on my monitor, so if you have something less, you may need to adjust the position in ui_custom_msgs.xml so it actually displays on your screen
http://www.sendspace.com/file/3v63ir
  00:33:14  28 November 2014
profilee-mailreply Message URLTo the Top
Hegel
(Novice)
 
On forum: 11/17/2013
Messages: 45

---QUOTATION---
Btw, this sort of relates to this: Anyone know how to set the "layering" in the hud elements? I managed to add the clock time to the minimap, but the time display is sort of under the minimap background texture, I'd like to have it on top of it. Not a big problem, but the color of the font sort of "fades" when it's under the other texture.

There must be a file with some sort of "priority", which elements are drawn on top of what.
---END QUOTATION---



Hi, did you ever sort this out?
  18:25:20  5 December 2014
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
 

Message edited by:
ThunderFreak
12/05/2014 18:29:21
Messages: 685
There is no need to change anything in the bind_stalker.script file.
This is the function I coded for the Invasion mod.
class "uhrzeit"
function uhrzeit:__init()
	self.time = show_ui("show_time"):wnd()
	show_ui("show_time_blink")
end

function uhrzeit:update()
	self.time:SetText(string.format("%02d %02d",level.get_time_hours(),level.get_time_minutes()))
end
local zeit = uhrzeit()

function show_ui(item)
	local hud = get_hud()
	local gcs = hud:GetCustomStatic(item)
	if gcs == nil then 
		hud:AddCustomStatic(item) 
		gcs = hud:GetCustomStatic(item)
	end
	return gcs
end

function show_time()
	zeit:update()
end

To show the time on the hud call the function show_time()

In the ui_custom_msgs.xml you have to add the following lines
	<show_time x="395" y="0" width="225" height="39">
		<texture x="750" y="0" width="225" height="39">ui\ui_hud</texture>
		<text font="graffiti32" x="87" y="6" r="240" g="217" b="52" a="255">00 00</text>
	</show_time>

	<show_time_blink x="405" y="0" light_anim="ui_slow_blinking_alpha" la_cyclic="1" la_texture="0" la_text="1" la_alpha="1">
		<text font="graffiti32" x="100" y="3" r="240" g="217" b="52" a="255">:</text>
	</show_time_blink>

This works for me and the Invasion mod.
  16:39:12  6 December 2014
profilee-mailreply Message URLTo the Top
olivius74
Senior Resident
 

 
On forum: 11/19/2010
Messages: 1975
Hello ,Sir

Thank you for all informations you give us.
I search a little to discover your mod Invasion,because I saw great screens and old videos.
But unfortunately,due the time ,seems no links ok actually for the mod.
I found a great discuss on Deutsh Forum,but all links fails.

http://www.computerbase.de/forum/showthread.php?t=409713

Can you have the desire and the possibility to share a link for

INVASION.MOD_v1.3.2.7z for example?

Thank to you.
Cheers
  22:09:09  7 December 2014
profilee-mailreply Message URLTo the Top
ThunderFreak
Senior Resident
 

 
On forum: 08/07/2009
Messages: 685
In my last post I was talking about the Invasion 2 mod and this one of the functions, but I am afraid to say that this mod will never be released because Atonium2027 disappeared without a trace.
Invasion mod 1.3.3 I can upload for you on my dropbox even the Project Invasion mod if you like. Project Invasion is the alpha state of Invasion 2.
 
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.