Would there be a way to set a DPanel’s SetVisible() boolean value outside of the cl_init.lua file without using a console command? Or i guess is there a way to make the Derma Panel variables accessible within a certain file within a game mode?
Yes, but why? What are you trying to do? Maybe there’s a better way.
Generally, in such cases I would make the panel global ( GM.Inventory = mypanel ) for example and access it from some other file.
Keep in mind that panels/Derma are CLIENTSIDE, you will not be able to access their variables from SERVERSIDE.
What I’m trying to do is modify a prophunt segment so that when the hunters are blinded, it sets a Derma Panel as their screen instead of a black box. The problem here is , the “screen blinding process” is hooked to an event that calls every tick. If I just have it open the menu, it opens it a million times a second and ultimately crashes. So my idea was to hook the Derma panel to initialize, and originally have the visibility set to false. And in the hunter blind hook basically do something along the lines of :
If the visibility of the frame is false, and if youre a hunter, set it to true.
If it’s anything else, end.
This was a solution I thought would work, but the variables for the dpanel can’t be accessed outside cl_init.lua. Any suggestions?
[lua]if !ply:GetNWBool(“BlindedByTheLight”) then
Yeah but this doesn’t take into account the original problem I had, which was not being able to use the derma variables. What exactly is “BlindBoxIsOpen”? That right there is my entire problem. I don’t know how to see if it is open or not.
check the round time, and check the blind time in config,
if blindTime > roundTime and ply:isHunter() then
there is better psuedocode then the one posted before, all you need to do is find the two variables, if blindTime is not configurable in prop hunt then just set it to the default time, else, there should be a global config. I’m sure there is a function to get the round time aswell, good luck.