Using ACS scripting to activate/deactivate shaders in game?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Using ACS scripting to activate/deactivate shaders in game?
I downloaded theviewtopic.php?f=103&t=57352 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.
Re: Using ACS scripting to activate/deactivate shaders in ga
No, but 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:
ZScript:
ACS:
Code: Select all
//make sure the player is the script's activator.
script "ToggleShader" (bool on)
{
ScriptCall("MyActor", "ToggleShader", on);
}
Code: Select all
class MyActor: Actor
{
static void ToggleShader(Actor a, bool on)
{
if(a && a.player)
{
Shader.SetEnabled(a.player,"MyShader",on);
}
}
}
Re: Using ACS scripting to activate/deactivate shaders in ga
Forgive me for my ignorance, but I have no idea how to begin to set this up or were to put the zscript code or acs functions in a nice pk3 format structure. Never worked with zscript which makes things more convoluted.
Thanks for your reply Cherno!
Thanks for your reply Cherno!