ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Dynamic hud, open scopes, and zoom

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  23:41:24  17 March 2014
profilee-mailreply Message URLTo the Top
tsf00181
(Senior)
 
On forum: 07/20/2013
Messages: 60
Dynamic hud, open scopes, and zoom

Few questions. First I'm working with Rulix's hud.

Is there anyway to make it so an open scope doesn't appear inside the mask?

Second, I know the later versions of this script had a zoom feature that changed the dof so it looked like the iron site was in front of the right eye as it zoomed. It works fine for Pripyat, but CS apparently doesn't have SetTextureRect as a command. Anyone know what CS uses for this?


---QUOTATION---
local pre_fov = 0
local precf = 0
local ztime = time_global()
local zbias = Frect():set(0,0,1024,1024)
local zenc
function zoom_hud()
if not zoom_enable then
return
end
if current_suithud then
local hud = get_hud():GetCustomStatic(current_suithud)
if hud then
local cf = precf
local fov = math.floor((device().fov+0.02)*10)
local delta = time_global()-ztime
ztime = time_global()
if not zenc or fov > 35*10 and pre_fov < fov then
zenc = nil
if cf > 0 then
cf = cf-(delta/400)
if cf < 0 then
cf = 0
end
end
end
if zenc or fov < 53*10 and pre_fov > fov then
zenc = true
if cf < 1 then
cf = cf+(delta/400)
if cf > 1 then
cf = 1
end
end
end
if cf ~= precf then
local wpn = db.actor:active_item()
if wpn then
if wpn:section() == "wpn_binoc" then
zbias:set(100*cf,100*cf,1024-100*cf,1024-100*cf)
elseif rx_utils.addon_attached(wpn,"sc" then
zbias:set(350*cf,175*cf,1024,1024-175*cf)
else
zbias:set(200*cf,100*cf,1024,1024-100*cf)
end
hud:wnd():SetTextureRect(zbias)
elseif precf ~= 0 then
zbias:set(0,0,1024,1024)
hud:wnd():SetTextureRect(zbias)
end
precf = cf
end
pre_fov = fov
end
end
end
---END QUOTATION---

 
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.: Clear Sky Forum » Mod discussion
 

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


 

Copyright © 1995-2021 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.