Raised This Month: $89 Target: $400
 22% 

Map Decals


Post New Thread Reply   
 
Thread Tools Display Modes
Author
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Plugin ID:
343
Plugin Version:
1.1
Plugin Category:
Admin Commands
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    262 
    Plugin Description:
    Allows admins to place any decals into the map that are defined in the the config and save them permanently for each map.
    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, 7724 views)

    Last edited by berni; 12-09-2012 at 14:26.
    berni is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 04-05-2008 , 18:26   Re: Map Decals
    Reply With Quote #2

    Now the hard part is getting my 647x159 image to a power of 2 and make it still look ok lol. Its impossible I say. Oh and Nem just released a new version of his VTF tools. Any dimension ideas?
    __________________

    DontWannaName is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 04-05-2008 , 18:34   Re: Map Decals
    Reply With Quote #3

    Quote:
    Originally Posted by DontWannaName View Post
    Now the hard part is getting my 647x159 image to a power of 2 and make it still look ok lol. Its impossible I say. Oh and Nem just released a new version of his VTF tools. Any dimension ideas?
    Do you have a link to his tool ?

    I would try to resize it in Photoshop, it's doing pretty well with such things, or you send it to me and I try it.
    berni is offline
    DontWannaName
    Veteran Member
    Join Date: Jun 2007
    Location: VALVe Land, WA
    Old 04-05-2008 , 18:41   Re: Map Decals
    Reply With Quote #4

    Im in IRC right now.

    http://nemesis.thewavelength.net/ind...=154&o=30#p154
    __________________

    DontWannaName is offline
    imported_Anth0ny
    Senior Member
    Join Date: Jan 2005
    Location: Saturn
    Old 04-06-2008 , 04:12   Re: Map Decals
    Reply With Quote #5

    Great job! =)
    This plugin looks like a Mani's World Decals tool (part of Mani admin plugin)
    __________________
    aka Mad.Eagle
    Creator\Owner\Admin of
    www.megatron.ws
    imported_Anth0ny is offline
    Send a message via ICQ to imported_Anth0ny
    sessus
    Senior Member
    Join Date: May 2006
    Old 04-06-2008 , 05:36   Re: Map Decals
    Reply With Quote #6

    Just an issue that has existed also with the MM Decals addon:

    When a player first connects to a server, custom decals, despite being downloaded, are not being displayed correctly. Only a Steam restart solves that Problem. Any chance this could be solved with pre-caching of the decals?

    Last edited by sessus; 04-06-2008 at 06:07.
    sessus is offline
    LocutusH
    Senior Member
    Join Date: Dec 2007
    Location: Hungary
    Old 04-06-2008 , 05:53   Re: Map Decals
    Reply With Quote #7

    Can anyone test, if this is compatible with sv_pure=1?
    __________________
    LocutusH is offline
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 04-06-2008 , 07:54   Re: Map Decals
    Reply With Quote #8

    Works like a dream! Thanks berni

    Quote:
    Originally Posted by LocutusH View Post
    Can anyone test, if this is compatible with sv_pure=1?
    Yes it's compatible with sv_pure 1

    You just need to add your decals to the whitelist.

    Attached a screenshot of decals working on my sv_pure 1 server
    Attached Thumbnails
    Click image for larger version

Name:	decals_demo.jpg
Views:	3380
Size:	81.3 KB
ID:	25374  
    __________________

    Last edited by Extreme_One; 04-06-2008 at 11:23. Reason: tested : works :)
    Extreme_One is offline
    berni
    SourceMod Plugin Approver
    Join Date: May 2007
    Location: Austria
    Old 04-06-2008 , 12:54   Re: Map Decals
    Reply With Quote #9

    Quote:
    Originally Posted by sessus View Post
    Just an issue that has existed also with the MM Decals addon:

    When a player first connects to a server, custom decals, despite being downloaded, are not being displayed correctly. Only a Steam restart solves that Problem. Any chance this could be solved with pre-caching of the decals?

    The decals are already getting precached. What game are you talking about ?
    It's working fine for me.
    berni is offline
    orij1nal™
    Member
    Join Date: May 2006
    Old 04-06-2008 , 16:45   Re: Map Decals
    Reply With Quote #10

    Quote:
    Originally Posted by sessus View Post
    Just an issue that has existed also with the MM Decals addon:

    When a player first connects to a server, custom decals, despite being downloaded, are not being displayed correctly. Only a Steam restart solves that Problem. Any chance this could be solved with pre-caching of the decals?
    Awesome plugin by the way! just doesn't appear to always work as I am experiencing the same issues as this guy. The decal doesn't always appear on the wall even though the positions have been saved to the map. Reconnect/retry does not appear to fix the problem either.

    A way around it for me was to exit the game(cs:s) completely and just load it up again and the decal would appear BUT there were several occasions where exiting and loading a couple times in a row did not fix the issue.


    SM Logs did not produce any errors.
    orij1nal™ is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 00:55.


    Powered by vBulletin®
    Copyright ©2000 - 2017, vBulletin Solutions, Inc.
    Theme made by Freecode