Jump to content

Help with the frost effect


Recommended Posts

I think you're looking for widgets/iceover.lua, that seems to handle the on screen freeze effect. Unfortunately it seems to be hard coded to only work based on temperature, there doesn't seem to be an easy way to arbitrarily call the effect. You'll need to create your own identical effect I believe.

  • Health 1
Link to comment
Share on other sites

The iceover effect is just an image that is overlayed on top of the whole screen, with its transparency adjusted. You can easily make your own version by creating a new widget with this in its file (I called it mynewiceover.lua, can be whatever name you want):

 

local Widget = require "widgets/widget"
local Image = require "widgets/image"


local MyNewIceOver = Class(Widget, function(self, owner)
    self.owner = owner
    Widget._ctor(self, "MyNewIceOver")
    self:SetClickable(false)

    self.img = self:AddChild(Image("images/fx.xml", "ice_over.tex"))
    self.img:SetEffect( "shaders/uifade.ksh" )
    self.img:SetHAnchor(ANCHOR_MIDDLE)
    self.img:SetVAnchor(ANCHOR_MIDDLE)
    self.img:SetScaleMode(SCALEMODE_FILLSCREEN)

end)

return MyNewIceOver

You'll need to add it as a child to the overlayroot of the playerhud as well. If you want to dynamically control its transparency, when it shows up, or play the associated freeze sound, etc. then you'll have to do that using net variables. As it stands this code should just give you a permanent iceover effect. If you need more details on how to do this, feel free to ask.

Edited by Ziro2k
  • Health 1
Link to comment
Share on other sites

On 6/6/2022 at 3:13 AM, Ziro2k said:

You'll need to add it as a child to the overlayroot of the playerhud as well. If you want to dynamically control its transparency, when it shows up, or play the associated freeze sound, etc. then you'll have to do that using net variables. As it stands this code should just give you a permanent iceover effect. If you need more details on how to do this, feel free to ask.

Thank you so so much for the help up until now, I'd be glad for an explanation on how to do these things... thanks in advance 

Edited by mexican geek
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...