Thread: Map Decals
View Single Post
Author Message
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-05-2008 , 16:04   Map Decals
Reply With Quote #1



We use Github: https://github.com/bcserv/map-decals
Code contributions are welcome! - How do I create a pull request on Github ?


Authors
  • Berni
  • Stingbyte
Config structure

map-decals.cfg: Add your decals here
maps/: Map specific configs for the decal positions

Commands

sm_paintdecal <decalname | decal_id>
- Paints a decal on the wall you are currently aiming at
Admin-Flag required: Custom3

sm_removedecal
<aim | all | id | name | last> - Currently not implemented, change map to reload the decals from the config file.
Admin-Flag required: Root

sm_savedecal
<aim | all | id | name | last> - Saves the decal position to the map specific config file.
Admin-Flag required: Root

sm_listdecal <aim | all | id | last | map | name | saved> - Lists decals
Admin-Flag required: Custom3

sm_aimpos - Shows current aim position
Admin-Flag required: Custom3

sm_decalmenu - Map Decals Menu for Admins
Admin-Flag required: Custom3


ConVars

md_decal_dista - max aiming distance where decal positions are recognized and check distance to prevent painting two decals on the same position
Default: 50.0

md_decal_printpos <0 | 1> - enables/disables printing out of decal positions
Default: 1

md_spraysound - Path to the spray sound that gets played when someone sprays a decal
Default: "player/sprayer.wav"


How do I add a new decal ?
  1. First upload the decal (.vmt and .vtf) to your server, decals should be uploaded to the materials/decals/custom/ directory, at least they should be in materials, otherwise it won't work. Edit your .vmt file with a text editor if neccesary, to change the path to the .vmt file.
  2. Add the path of the decal to the main config file decal.cfg. The path has to be put relative to the materials folder, and without the file extension.
  3. Start the server, Aim at a wall and use !paintdecal <decalname>
  4. Now you can save all panted decals in the map with !savedecals to the config ;)
Related Links

How to create a decal - Tutorial http://www.fpsbanana.com/tuts/6640
Valve Developer Community - Decals http://developer.valvesoftware.com/wiki/Decals

Todo
  • Find a way to remove decals on the server during the game
  • Mysql support ?
Changelog

23-8-2009 Version 1.1
  • Changed OnClientConnect with OnPostAdminCheck so players receive the decal later, should fix some issues
  • Changed the Filter Flag for the TraceRay to MASK_ALL (experimental)
  • Renamed all cvars to start with md_
  • Added version cvar md_version
  • Lots of code cleanup
17-5-2008 Version 1.02 (Stingbyte)

* Added reading decal filename (.vtf) from .vmt
* Fixed bug: SpraySound was added to DownloadsTable before DownloadsTable was ready

8-5-2008 Version 1.01
  • Fixed bug where trace handle got closed before it could get the trace entity
7-5-2008 Version 1.0

Thanks to Stingbyte (Stingbyte.com) for the work on this release.
  • Admin Levels by Defines (in map-decals.sp)
  • sm_paintdecal now supports name or id
  • sm_savedecals renamed to sm_savedecal (aim/all/id/name/last)
  • Implemented the command sm_removedecal (aim/all/id/name/last)
  • Added command sm_listdecal (aim/all/id/last/map/name/saved)
  • Added command sm_aimpos (Shows current aim position)
  • Added command sm_decalmenu (Map Decals Menu for Admins)
  • Added to AdminMenu (Server Commands)
  • Added Admin Logging via LogAction
  • CVAR: sm_decal_dista (max aiming distance where decal positions are recognized and check distance to prevent painting two decals on the same position (default: 50.0))
  • CVAR: sm_decal_printpos (enables/disables printing out of decal positions (1/0, default: 1))
  • CVAR: sm_spraysound - Path to the spray sound that gets played when someone sprays a decal
  • MultiLanguage Support (included: english, german)
  • Enhanced the whole plugin (no more compilation warnings, used hl2 built-in sprayer.wav)
Default admin levels (defined in code)

Admin Level Defines: Level for Allowing Temp.Spray/Temp.Remove of Decals and Level for Saving Decals/getting aim position

#define ADMIN_LEVEL_SPRAY ADMFLAG_CUSTOM3
#define ADMIN_LEVEL_SAVE ADMFLAG_ROOT

5-4-2008 Version 0.9
  • Initial release
Tested Games
  • Half Life 2: Deathmatch
  • Counter-Strike: Source
  • Team Fortress 2
Screenshot




Known Bugs/Limitations


After a Decal was removed, it still appears for players already connected. After a reconnect or a mapchange (if Decal Positions where saved) changes are visible (HL2 Limitation?)
Attached Files
File Type: zip map-decals_v1.1.zip (107.6 KB, 10998 views)

Last edited by berni; 12-09-2012 at 14:26.
berni is offline