Creating Decals

Please post any questions about developing your plugin here. Please use the search function before posting!
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Creating Decals

Postby decompile » Wed May 17, 2017 2:29 pm

Hey Guys,

Im currently trying to create decals and use them for painting on walls (like paintball shots on wall) or maybe recreating a spray.

I read that you can use it by creating a infodecal entity, but how alone that is most likely not the only thing I guess.

Greetings
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Creating Decals

Postby L'In20Cible » Wed May 17, 2017 2:42 pm

CTEWorldDecal

Syntax: Select all

from effects.base import TempEntity
from engines.precache import Decal
from mathlib import Vector

te = TempEntity('World Decal')
te.decal = Decal('decal.vmt')
te.origin = Vector(0, 0, 0)
te.create()


EDIT: Example: viewtopic.php?f=7&t=502&p=8613
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Creating Decals

Postby decompile » Thu May 18, 2017 3:16 am

Thank you for the reply!

Just wondering if this viewtopic.php?p=9002#p9002 still relies on the TempEntity('World Decal') that you cant remove it after its 'created'?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Creating Decals

Postby L'In20Cible » Thu May 18, 2017 6:20 am

Correct, you cannot remove it once it has been sent to clients. However, you cannot remove the one created by infodecal either. Once they are networked to clients, removing the entity server-side won't remove the decal displayed to them. The only way you have to remove decals, is to send the r_cleardecals (from memory) command which will remove all others as well. The only difference between the two, is that since client can configure the max amount of displayed decals, the temp entity will replace the oldest when creating a new one and the server-side entity won't be displayed at all if the limit has been exceeded. At least, this used to work like that on CS:S, things might have changed on CS:GO.
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: Creating Decals

Postby decompile » Thu May 18, 2017 10:59 am

Thanks for the info, everything solved :)

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 23 guests