 |
 |
 |
|
 |
 |
 |
|
 |
 |
Adding the time to the HUD |
|
« Previous 10 events | 1 2 3 4 | Next 10 events »| All Messages |
|
|
17:25:39 14 March 2009 |
|
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 |
|
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 |
00:33:14 28 November 2014 |
|
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?
Windows 10 Pro
Intel Core i7-6820HK @ 2.70GHz
NVIDIA GeForce GTX 980M, 8GB
32GB DDR3 Ram
3GB GeForce GTX 770M
Samsung SSD 840 EVO 250GB
www.cardiff-computer-rescue.com
|
|
« Previous 10 events | 1 2 3 4 | Next 10 events »| All Messages |
|
|
|
» » |
|
All short dates are in Month-Day-Year format. |
 |
|
 |
|
|
|
 |
 |
 |