Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Gunrock

Possible using ACS scripting to activate old video shader in a room?

Recommended Posts

I downloaded the Old video shader from the ZDoom forums and thought it would fit nicely in an upcoming horror style mod. However, Is it possible to use ACS scripting to activate this shader when the player enters a room like he is entering a nightmare scene and the old video shader activates only in that room then deactivates when leaving that same room? I dont want the old video shader to play out all through the map. Think of Silent Hill 3, when some parts of the game uses the film grain effect in some scenes to make it more eerie.

Share this post


Link to post

I'm pretty sure ACS can't even touch that, as ACS is on a per-map-scope basis, whereas a shader effect is global - it's either applied or it's not independent of the map's control. In other words, it can control stuff on the map, but it can't control stuff that wouldn't be considered to be "on the map," and I think shaders are not something that it can alter since it's not something "in" the map.

 

Of course, if I'm wrong, I'm sure someone will correct me.

Share this post


Link to post

 

Cherno from ZDoom forums posted this earlier:

You can use a static ZScript function which can be called from ACS via ScriptCall and in turn can enable or disable the shader."

 

 

ACS:

//make sure the player is the script's activator.
script "ToggleShader" (bool on)
{
    ScriptCall("MyActor", "ToggleShader", on);
}

 

ZScript:
class MyActor: Actor
{
     static void ToggleShader(Actor a, bool on)
     {
          if(a && a.player)
          {
               Shader.SetEnabled(a.player,"MyShader",on);
          }
     }
}

 

I can't even begin to know were to put all that as I'm not great when it comes to using zscript or any other complicated ACS functions. How and were do I put this in the old video shader pk3 structure or map? 

Share this post


Link to post

ZScript is an entirely different beast and I barely understand it myself.

 

Obviously, you'd need to put it in your mod's PK3, but where and how you'd make the shader, that's way out of my realm of expertise.

Share this post


Link to post

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
×