Author Topic: ULX ClearDecals - Clear all decals in the map.  (Read 29120 times)

0 Members and 1 Guest are viewing this topic.

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
ULX ClearDecals - Clear all decals in the map.
« on: January 29, 2010, 07:42:13 PM »
This is an addon for ULX that adds a command that clears all the decals in the map. (Bullet holes, blood, etc.)
I've attached versions for both non-SVN and SVN versions of ULX/ULib.

Usage:
Type "ulx cleardecals" in the console, or type "!cleardecals" in the chat.

Installation:
Extract to addons.
« Last Edit: January 30, 2010, 03:00:44 PM by RynO-SauruS »


YouTube music player by RynO-SauruS

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #1 on: January 29, 2010, 08:58:18 PM »
Call me old fashioned, but I don't really see the point in replacing one concommand with another.. even more so a longer one..

"r_cleardecals"  ---> "ulx cleardecals"


The chat command addition is nifty though..  ;D

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #2 on: January 29, 2010, 09:01:22 PM »
It's also for running it on all clients quickly, and looks nice. ;D I think most people don't even know about r_cleardecals.


YouTube music player by RynO-SauruS

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #3 on: January 29, 2010, 09:05:48 PM »
ahh, so you have it set up to run concurrently on all clients connected. That is a bit different then. I remember I used to have to do something along the lines of...

"ulx rcon * r_cleardecals" which was a little annoying. :D

Simple.. yet useful. Good Job!

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #4 on: January 29, 2010, 09:06:38 PM »
Thanks. ;D


YouTube music player by RynO-SauruS

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #5 on: January 29, 2010, 10:13:49 PM »
Short but sweet, I like it. :)
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #6 on: January 29, 2010, 10:16:37 PM »
Nice.
One concern... name of the function... "ulx.respawn"; Though not used currently by ULX or any modules other than yours (that I know of), seems the name might be better named. ulx.cleardecals perhaps? :)
Respawn just seems to close to something that might be used in another module to, uh, something to do with spawning? :D

Wonder what other utilitarian console commands (that don't require sv_cheats and aren't blocked) might be put into a pack along with this.

* gears squeal
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #7 on: January 29, 2010, 10:58:35 PM »
Well, this is embarrassing. I used the "ULX Respawn" addon as a reference to make this, because I was unsure of how the command system worked.  :-\
I forgot to rename the function.. I changed the name of it in the non-SVN version, but not the SVN version.
I'll re-upload it with the function name changed. Anyway, thanks for pointing that out.

Edit: Done.

Edit 2: I noticed my command doesn't show up in the autocomplete for the 'ulx' command.
I've compared, and it seems I have mine formatted exactly like the commands in fun.lua.
I can't seem to find what's adding those commands to the autocomplete. How do I add mine?
« Last Edit: January 30, 2010, 10:37:37 AM by RynO-SauruS »


YouTube music player by RynO-SauruS

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #8 on: January 30, 2010, 12:46:41 PM »
I started to dig in and thought it would be simple.
According to ulx base.lua (where ulx.concommand is set up), The ulx concommand function seems to be where it adds.
However, it wasn't as simple (for me) to dig up as I had thought.


Megiddo, what adds the autocomplete? It's not "ulx.addToMenu" is it? He's not using it for the non-SVN version, but, seems it shouldn't have to be added to the gui menu.

Ryno, may try ulx.ID_HELP too. I noticed that in the autocomplete table set up an if/then/else statement depending on ID_HELP or ID_PLAYER_HELP


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #9 on: January 30, 2010, 02:57:15 PM »
Man, I just noticed the variable is still called respawn.. D: I'll fix that..

Edit: Done.. Finally... I wish I hadn't messed up like that, this is embarrassing :-[ ...

Edit 2: About the autocomplete, what do you mean by ulx.ID_HELP? Where should I put it?  :-\
« Last Edit: January 30, 2010, 03:03:21 PM by RynO-SauruS »


YouTube music player by RynO-SauruS

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #10 on: January 30, 2010, 05:03:47 PM »
In your ulx.concommand, you have ulx.ID_PLAYER_HELP ... might try ulx.ID_HELP
Like I said, not sure that will do it... just noticed that the ULX autocomplete function does an if/else depending on that setting versus ulx.ID_PLAYER_HELP
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #11 on: January 30, 2010, 06:45:37 PM »
Oohh I see. I'm using the SVN version, you're referring to the non-SVN version.
The SVN version actually uses a different function, "ulx.command", and the non-SVN version uses "ulx.concommand".
I don't know what the argument does, the one that takes 'ulx.ID_PLAYER_HELP' or 'ulx.ID_HELP'.. I'll look in the SVN base.lua.
I actually don't know if the auto-complete works or not on the non-SVN version, but I know it doesn't on the SVN version.

Edit: Yeah, I see now the 'ulx.ID_PLAYER_HELP' etc. argument has to do with autocomplete..
I don't see anything in the 'ulx.command' function (not 'ulx.concommand') in the SVN that does anything about autocomplete.
So how do the fun commands get their autocomplete in the SVN? They use the same function in the exact same way from what I see and understand.
« Last Edit: January 30, 2010, 07:02:20 PM by RynO-SauruS »


YouTube music player by RynO-SauruS

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #12 on: January 30, 2010, 08:39:28 PM »
Oh. I thought you meant it wasn't showing in non-SVN because, I'm running SVN and it appears in my autocomplete fine.
Do you maybe have both of your versions in your addons/cleardecals/ulx/modules/<whatever> folder? That could be causing the issue.
I think our SVN still has traces of some of the old ulx commands. At least, when I search my ulx folder for ulx.concommand (the "release" ULX method), it finds base.lua.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline RynO-SauruS

  • Jr. Member
  • **
  • Posts: 77
  • Karma: 17
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #13 on: January 30, 2010, 09:16:45 PM »
Are you just starting a listen server with it?
I'm putting the SVN version on a SRCDS on my PC, and joining it with the same PC, and the command isn't in the auto-complete.
So, the new 'ulx.command' function will eventually replace the 'ulx.concommand' function? You refer to it as 'old'. :D


YouTube music player by RynO-SauruS

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX ClearDecals - Clear all decals in the map.
« Reply #14 on: January 30, 2010, 09:48:11 PM »
Single player, not even server.
I'll test ded/srcds at a later time. (Sorry, it's late, I'm tired)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming