Skip to content

setWorldSpecialPropertyEnabled: "weapontracers" & "bloodsplatters" #4222

Open
@sacr1ficez

Description

@sacr1ficez

Is your feature request related to a problem? Please describe.

As in title, currently there's no way to gracefully disable those effects.

It is partially achievable using shader and transparent texture, however:

  • for weapon tracers it won't work, because it's not a texture (doesn't show up in shader_tex_names)
  • for blood splatters it will work, but these textures are also used in other places, such as wood bullet impact and probably few more extra things ("bloodpool_64", "carsplash_03", "carsplash_04", "carsplash_05", "kaplc")

A good reason to disable them would be:

  • creating own weapon tracer effect
  • creating own blood splatter effect upon hitting player/ped which will clearly indicate that player/ped got hit, unlike by default which isn't necessarily always true

Describe the solution you'd like

setWorldSpecialPropertyEnabled("weapontracers", false) -- toggle weapon tracers (by default: true)
setWorldSpecialPropertyEnabled("bloodsplatters", false) -- toggle blood splatters when hitting ped/player (by default: true)

Describe alternatives you've considered

Shader & transparent texture, but it will have unintended side effects, and will work only for blood splatters.

Additional context

Code for hiding blood splatters:

local shaderRaw = [[
	texture gTexture;
	technique replace {
		pass P0 {
			Texture[0] = gTexture;
		}
	}
]]

local alphaTexture = dxCreateTexture("alpha.png")
local texturesToReplace = {
	"bloodpool_64",
	"carsplash_03",
	"carsplash_04",
	"carsplash_05",
	"kaplc",
}

for _, textureName in pairs(texturesToReplace) do
	local shaderMacros = {}
	local shaderPriority = 0
	local shaderMaxDistance = 0
	local shaderLayered = false
	local shaderElementTypes = "world"
	local shaderReplace = dxCreateShader(shaderRaw, shaderMacros, shaderPriority, shaderMaxDistance, shaderLayered, shaderElementTypes)

	if (shaderReplace) then
		local shaderTargetElement = nil
		local shaderAppendLayers = true

		dxSetShaderValue(shaderReplace, "gTexture", alphaTexture)
		engineApplyShaderToWorldTexture(shaderReplace, textureName, shaderTargetElement, shaderAppendLayers)
	end
end

Security Policy

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions