AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Map Decals (https://forums.alliedmods.net/showthread.php?t=69502)

berni 04-05-2008 16:04

Map Decals
 
1 Attachment(s)
http://www.ice-gfx.com/pics/sourcemod/mapdecals.png

http://berni.bcserv.eu/uploads/images/github-icon.png 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?)

DontWannaName 04-05-2008 18:26

Re: Map Decals
 
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?

berni 04-05-2008 18:34

Re: Map Decals
 
Quote:

Originally Posted by DontWannaName (Post 607096)
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.

DontWannaName 04-05-2008 18:41

Re: Map Decals
 
Im in IRC right now.

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

imported_Anth0ny 04-06-2008 04:12

Re: Map Decals
 
Great job! =)
This plugin looks like a Mani's World Decals tool (part of Mani admin plugin)

sessus 04-06-2008 05:36

Re: Map Decals
 
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?

LocutusH 04-06-2008 05:53

Re: Map Decals
 
Can anyone test, if this is compatible with sv_pure=1?

Extreme_One 04-06-2008 07:54

Re: Map Decals
 
1 Attachment(s)
Works like a dream! Thanks berni

Quote:

Originally Posted by LocutusH (Post 607290)
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 :up:

berni 04-06-2008 12:54

Re: Map Decals
 
Quote:

Originally Posted by sessus (Post 607283)
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.

orij1nal™ 04-06-2008 16:45

Re: Map Decals
 
Quote:

Originally Posted by sessus (Post 607283)
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.


All times are GMT -4. The time now is 18:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.