Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Sign in to follow this  
Aeryes

Issue with SetParam() on materials?

Recommended Posts

Hey modders!!!

 

I am having an issue setting params for materials found in the graphics folder. I keep getting an error when I try to load my script ingame that says "materialColors is an incompatible parameter".

 

static float VIGNETTE = 0.0;	

Material materialColors = GetGame().GetWorld().GetMaterial("graphics/materials/postprocess/glow");

// Function used to change the strength of the vignette effect.
// Intensity value between 0-100. 0 been least instense, 100 most intense.
void changeVignette(int intensity) {
	VIGNETTE = ((intensity * 0.01) - 5.0);
	materialColors.SetParam("Vignette", VIGNETTE);
}

 

Here is a sample from my code. The basic layout looks like this, where I define my materials and create my functions to change param values. However it will not work as expected and keeps giving me the error I mentioned above.

 

All help is much appreciated.

Share this post


Link to post
Share on other sites

I found this example in the Files:

	Material matColors = GetGame().GetWorld().GetMaterial("postprocess/glow");
	SetMaterialParam(matColors, "Saturation", 0.8);
	float color[4];
	color[0] = 0.5;
	color[1] = 0.8;
	color[2] = 0.7;
	color[3] = 0.6;
	SetMaterialParam(matColors, "OverlayColor", color);

Try to use this method

Share this post


Link to post
Share on other sites
Sign in to follow this  

×