1up Clan Forums

Discussions => Admin Announcements => Site News => Topic started by: Tesla[1up] on November 06, 2010, 05:03:44 AM

Title: 1up demo loader now available.
Post by: Tesla[1up] on November 06, 2010, 05:03:44 AM
(http://1upclan.info/public/upload/projects/1up_demo_loader/1up_demo_loader_ss.png)

If you review alot of demos then you know how much of a pain it can be to use the standard Urban Terror client by itself which is why the demo loader application was created to help make this task as simple as possible. For more details and a download link, just visit our projects page located here (http://www.1upclan.info/projects.php). (demo loader is located at the bottom of the page) We hope you will find it useful and as always feedback is welcome.

Thanks,
Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: inka on November 06, 2010, 06:27:15 AM
Wow tesla you are a legend elite coder.
Downloading it now becuase this will me me review ALOT more demos :D fill give more feed back when I have tested it.
Title: Re: 1up demo loader now available.
Post by: SaSoOon[1up] on November 06, 2010, 07:03:32 AM
Its Working great
Good job Tesla. :)
Title: Re: 1up demo loader now available.
Post by: Tesla[1up] on November 06, 2010, 09:37:25 AM
Thanks SaSo0on, even tho you spelled my name wrong, I won't hold it against you :).  Hope it works for you as well Inka.

Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: KD197 on November 06, 2010, 09:42:00 AM
How does this actually work? I have no Windows machines so I can't try it. Does it give you a list of demos in your folder to click on to play or something? I read on the projects page about using it as the default program for .dm_68, that's a damn nice feature!
Title: Re: 1up demo loader now available.
Post by: Tesla[1up] on November 06, 2010, 11:51:50 AM
No list, you just double click on the demo you want to play and Urban Terror will load automatically and start playing the demo. If you do it from the browser it will do the same thing you just have to associate the file with the program. On my system this was already done I just had to tell firefox to remember the setting. From then on just clicking on the demo link will be enough to get it to play for you, nothing else needed.

Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: Pyrite[1up] on November 06, 2010, 11:56:22 AM
How does this actually work? I have no Windows machines so I can't try it. Does it give you a list of demos in your folder to click on to play or something? I read on the projects page about using it as the default program for .dm_68, that's a damn nice feature!

To answer your question, no this isn't for Linux/Mac machines. It is a simple native Windows application that lets you click on a demo on the forums, and downloads it, launches UrT, and plays it, all automagically. The main audience is our referees who watch 100's of demos a week. It saves times, it saves patience, etc. The way it works is basically this.

1. Referee clicks on a "Demo for Review" on the forums.
2. Browser asks him/her if they want to Save/Open the file.
3. Referee clicks Open, and their job is done.
4. Tesla's magic takes care of the rest, UrT launches, demo plays, no further steps by Referee.
Title: Re: 1up demo loader now available.
Post by: Pyrite[1up] on November 06, 2010, 02:51:42 PM
Tesla,

Outstanding work as usual! I believe this is a very useful contribution both to our refs and the community.

Thank you!
Title: Re: 1up demo loader now available.
Post by: White^lynx on November 06, 2010, 04:09:00 PM
i love you guys.  :) I love it. Works amazing.
Title: Re: 1up demo loader now available.
Post by: SnKQuaKe on November 06, 2010, 07:42:16 PM
flawless victory
Title: Re: 1up demo loader now available.
Post by: ColdBlooded on November 08, 2010, 10:54:21 AM
does it work for macOS X
Title: Re: 1up demo loader now available.
Post by: Tesla[1up] on November 08, 2010, 10:59:58 AM
does it work for macOS X

Sigh, Read Pyrites first reply in this topic.

Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: ColdBlooded on November 08, 2010, 03:08:29 PM
does it work for macOS X

Sigh, Read Pyrites first reply in this topic.

Tesla[1up]


so sadly right now it doesnt......
Title: Re: 1up demo loader now available.
Post by: KD197 on November 08, 2010, 05:26:20 PM
HOKAY! HACKY BASH SCRIPT TIEM! 8)
I've slapped together a bash script for this, but for some reason I can't attach it to this post, so I'll dump it here.
Code: [Select]
#!/bin/bash
### KD197's Quick UrT Demo Loader ###
### Yeah I know it sucks! But it  ###
### works doesn't it?!            ###
### Requires sed and tr           ###
OS=$(uname -s)
URT() {
        if [[ $OS == "Linux" ]]; then
                ### Uncomment out the following line if you use cpufrequtils ###
### and wish to set your cpu mode to "performance". ###
#sudo cpufreq-set -r -g performance

### Start UrT in a second X session ###
                DISPLAY=:1.0
                xinit /usr/bin/urbanterror $* -- :1
        else
                ### Run Urban Terror on a Mac ###
                /Applications/UrbanTerror/ioUrbanTerror.app/Contents/MacOS/ioUrbanTerror.ub $*
        fi
}
### GETOPTS ###
while getopts ":w:h" OPTION
do
case $OPTION in
w) FLAG="w" INFILE=$OPTARG;;
h) FLAG="h";;
esac
done
### Set paths ###
### Change the ".urbanterror/q3ut4/demos/" part to whatever your path is ###
DIR="$HOME/.urbanterror/q3ut4/demos/"
COM='+set com_cameramode 1 +demo'
WCOM='+set com_cameramode 1 +set r_shownormals 1 +demo'
### Move demos to the demos folder and play with selected options ###
if [[ $FLAG == "h" ]]; then
echo "Options: -h to show this help"
echo "         -w /path/to/demo.dm_68 to start with r_shownormals 1"
echo ""
echo "By default, demos are run with com_cameramode 1 so that the"
echo "keyboard may be used, for timescale binds etc; files are moved"
echo "to the demos folder, and the filename is converted to UPPERCASE"
echo "because the Linux version doesn't like the demos otherwise :P"
elif [[ $FLAG == "w" ]]; then
FILE="$(echo $INFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $INFILE ${DIR}${FILE}
URT $WCOM $FILE
else
FILE="$(echo $1 | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $1 ${DIR}${FILE}
URT $COM $FILE
fi
Copy and paste that into a file (lets call it "urtdml" for sake of example) somewhere convenient and chmod +x it. Then pop open a terminal, and run it like "urtdml /path/to/demo.dm_68" and Bob's your uncle. I guess you could probably do some jazz to make dm_68's point at this scriptlet but that's up to you, I have no graphical filemanager to test it on. Besides, running it through a terminal is better because then you can add the "-w" switch to turn shownormals on 8)
Default behaviour (as seen in "help" the -h option) is that it will move the file to your demos folder if it's not already there, and convert the file name to uppercase (for the Linux users out there) then start the demo rolling with com_cameramode 1, which means you can use any keybinds you might have for increasing/decreasing timescale.

It's not a patch on Tesla's fancy app but maybe this'll fill a hole for Linux and Mac users until someone writes an equivalent of Tesla's launcher. :-[
Title: Re: 1up demo loader now available.
Post by: EddieLee on November 08, 2010, 06:47:34 PM
OH MAN!!! at first i was reluclant to ask if that program was also available for linux and even tried to run the .exe with wine (and failing miserably lol) but now, KD, with your script, OOOH MAN! THANKS A LOT MAN! it helps me a lot specially since i had to rename each and every demo to numbers because i couldnt run it even if i used uppercase letters, again thanks a lot  ;)!

also the options you put in it...so sexy


 8)

Title: Re: 1up demo loader now available.
Post by: KD197 on November 08, 2010, 07:27:35 PM
Heh you're welcome, it's not much but if it's useful then it's all good!
Title: Re: 1up demo loader now available.
Post by: Tesla[1up] on November 09, 2010, 03:01:43 AM
Nice job KD. As soon as I get a couple of more confirmations that it works (mainly form those on a Mac) I will add it to the projects page if you want.

Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: KD197 on November 09, 2010, 11:00:53 AM
I dunno if it's worthy of being on the projects page as it's just a terminal script, but let me fiddle with it some more and see if I can make something a bit nicer :)

EDIT:
Now in GUI flavour! 8) Requires Zenity, but can still be run without. (It will tell you if it can't find Zenity and exit.)
Code: bash [Select]
#!/bin/bash
### KD197's Quick UrT Demo Loader ###
###  Requires sed, tr and Zenity  ###
###      Now in GUI flavour!      ###
OS=$(uname -s)
URT() {
        if [[ $OS == "Linux" ]]; then
                ### Uncomment out the following line if you use cpufrequtils ###
### and wish to set your cpu mode to "performance". ###
#sudo cpufreq-set -r -g performance

### Start UrT in a second X session ###
                DISPLAY=:1.0
                xinit /usr/bin/urbanterror $* -- :1
        else
                ### Run Urban Terror on a Mac ###
                /Applications/UrbanTerror/ioUrbanTerror.app/Contents/MacOS/ioUrbanTerror.ub $*
        fi
}

### Define Colours ###
NC="\x1b[0;32m"
DC="\x1b[0m"
WC="\x1b[0;31m"

### GETOPTS ###
while getopts ":w:n:h" OPTION
do
case $OPTION in
w) FLAG="w" INFILE=$OPTARG;;
n) FLAG="n" INFILE=$OPTARG;;
h) FLAG="h";;
esac
done

### Set paths ###
### Change the ".urbanterror/q3ut4/demos/" part to whatever your path is ###
DIR="$HOME/.urbanterror/q3ut4/demos/"
COM='+set com_cameramode 1 +demo'
WCOM='+set com_cameramode 1 +set r_shownormals 1 +demo'

### Main ###
### Display help ###
if [[ $FLAG == "h" ]]; then
echo -e "${NC}Options: -h${DC} to show this help"
echo -e "         ${NC}-u${DC} /path/to/demo.dm_68 to start normally"
echo -e "         ${NC}-w${DC} /path/to/demo.dm_68 to start with r_shownormals 1"
echo ""
echo "If no option is passed, graphical mode will be used."
echo "By default, demos are run with com_cameramode 1 so that the"
echo "keyboard may be used, for timescale binds etc; files are moved"
echo "to the demos folder, and the filename is converted to UPPERCASE"
echo "because the Linux version doesn't like the demos otherwise :P"
### Run with r_shownormals ###
elif [[ $FLAG == "w" ]]; then
FILE="$(echo $INFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $INFILE ${DIR}${FILE}
URT $WCOM $FILE
### Run normally ###
elif [[ $FLAG == "n" ]]; then
FILE="$(echo $INFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $INFILE ${DIR}${FILE}
URT $COM $FILE
### Run with Zenity GUI ##
else
ZFILE=$(zenity --title="Select a demo" --file-selection 2>/dev/null) \
|| { echo -e "${WC}*** Zenity was not found or the operation was cancelled! ***${DC}"; \
echo "If opening a file failed, either install Zenity or run with";
echo "the -h switch to see available options for CLI usage."; exit 1; }
FILE="$(echo $ZFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $ZFILE ${DIR}${FILE}
zenity --title="Use r_shownormals?" --question --text "Use r_shownormals?"
        if [[ $? == "0" ]]; then
                URT $WCOM $FILE
        else
                URT $COM $FILE
        fi
fi
Title: Re: 1up demo loader now available.
Post by: Tesla[1up] on November 09, 2010, 03:06:25 PM
In that case I will just make a link that points to this topic on the projects page, I still need someone on a mac to confirm it works for them before I can do that tho.

Tesla[1up]
Title: Re: 1up demo loader now available.
Post by: FUBAR on November 09, 2010, 10:54:11 PM
That's a great tool Tesla.  Ron posted it at the UAA, and its gotten some good feedback so far.  I'll see if I can't get it some more exposure over there.

 :)
Title: Re: 1up demo loader now available.
Post by: Pyrite[1up] on November 09, 2010, 10:58:08 PM
And to think, he didn't even think people would want it, haha. I told you so Tesla :)
Title: Re: 1up demo loader now available.
Post by: Tits_McGee on November 10, 2010, 01:52:48 AM
This thread gave me a boner. At first I was psyched, then bummed, then psyched again. Thank you Tesla and KD197!
Title: Re: 1up demo loader now available.
Post by: Dougy on November 10, 2010, 10:22:12 AM
I dunno if it's worthy of being on the projects page as it's just a terminal script, but let me fiddle with it some more and see if I can make something a bit nicer :)

EDIT:
Now in GUI flavour! 8) Requires Zenity, but can still be run without. (It will tell you if it can't find Zenity and exit.)
Code: bash [Select]
#!/bin/bash
### KD197's Quick UrT Demo Loader ###
###  Requires sed, tr and Zenity  ###
###      Now in GUI flavour!      ###
OS=$(uname -s)
URT() {
        if [[ $OS == "Linux" ]]; then
                ### Uncomment out the following line if you use cpufrequtils ###
### and wish to set your cpu mode to "performance". ###
#sudo cpufreq-set -r -g performance

### Start UrT in a second X session ###
                DISPLAY=:1.0
                xinit /usr/bin/urbanterror $* -- :1
        else
                ### Run Urban Terror on a Mac ###
                /Applications/UrbanTerror/ioUrbanTerror.app/Contents/MacOS/ioUrbanTerror.ub $*
        fi
}

### Define Colours ###
NC="\x1b[0;32m"
DC="\x1b[0m"
WC="\x1b[0;31m"

### GETOPTS ###
while getopts ":w:n:h" OPTION
do
case $OPTION in
w) FLAG="w" INFILE=$OPTARG;;
n) FLAG="n" INFILE=$OPTARG;;
h) FLAG="h";;
esac
done

### Set paths ###
### Change the ".urbanterror/q3ut4/demos/" part to whatever your path is ###
DIR="$HOME/.urbanterror/q3ut4/demos/"
COM='+set com_cameramode 1 +demo'
WCOM='+set com_cameramode 1 +set r_shownormals 1 +demo'

### Main ###
### Display help ###
if [[ $FLAG == "h" ]]; then
echo -e "${NC}Options: -h${DC} to show this help"
echo -e "         ${NC}-u${DC} /path/to/demo.dm_68 to start normally"
echo -e "         ${NC}-w${DC} /path/to/demo.dm_68 to start with r_shownormals 1"
echo ""
echo "If no option is passed, graphical mode will be used."
echo "By default, demos are run with com_cameramode 1 so that the"
echo "keyboard may be used, for timescale binds etc; files are moved"
echo "to the demos folder, and the filename is converted to UPPERCASE"
echo "because the Linux version doesn't like the demos otherwise :P"
### Run with r_shownormals ###
elif [[ $FLAG == "w" ]]; then
FILE="$(echo $INFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $INFILE ${DIR}${FILE}
URT $WCOM $FILE
### Run normally ###
elif [[ $FLAG == "n" ]]; then
FILE="$(echo $INFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $INFILE ${DIR}${FILE}
URT $COM $FILE
### Run with Zenity GUI ##
else
ZFILE=$(zenity --title="Select a demo" --file-selection 2>/dev/null) \
|| { echo -e "${WC}*** Zenity was not found or the operation was cancelled! ***${DC}"; \
echo "If opening a file failed, either install Zenity or run with";
echo "the -h switch to see available options for CLI usage."; exit 1; }
FILE="$(echo $ZFILE | sed 's/.*\/\(.*\.dm_68\)/\1/' | tr [:lower:] [:upper:] | sed 's/DM_68$/dm_68/')"
mv $ZFILE ${DIR}${FILE}
zenity --title="Use r_shownormals?" --question --text "Use r_shownormals?"
        if [[ $? == "0" ]]; then
                URT $WCOM $FILE
        else
                URT $COM $FILE
        fi
fi


94 Dependancies

cd /opt/local/bin/portslocation/dports/zenity
sudo port install zenity  (use this if you actually have macports otherwise you fail lol)
Password: (password here if you have one if not this fails)



--->  Computing dependencies for zenity
--->  Dependencies to be installed: gtk2 atk gettext expat libiconv gperf ncurses ncursesw glib2 autoconf help2man p5-locale-gettext perl5 perl5.8 m4 automake dbus libtool pkgconfig zlib gtk-doc docbook-xml docbook-xml-4.1.2 xmlcatmgr docbook-xml-4.2 docbook-xml-4.3 docbook-xml-4.4 docbook-xml-4.5 docbook-xml-5.0 docbook-xsl gnome-doc-utils intltool gnome-common p5-getopt-long p5-pathtools p5-scalar-list-utils p5-xml-parser iso-codes libxslt libxml2 py26-libxml2 python26 bzip2 db46 gdbm openssl readline sqlite3 rarian getopt gdk-pixbuf2 jasper jpeg libpng tiff pango Xft2 fontconfig freetype xrender xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-renderproto cairo libpixman shared-mime-info xorg-libXcomposite xorg-compositeproto xorg-libXext xorg-libXfixes xorg-fixesproto xorg-libXcursor xorg-libXdamage xorg-damageproto xorg-libXi xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto libnotify dbus-glib


The log is 30, 000 characters +
so i could put the log here :S


The log is located in a textfile below to show you what i had to go through just to install zenity, You can decide from this if its actually worth installing zenity to run Kd's Demo loader or not, I obviously thought it was worth it otherwise i wouldnt have gone through the hassle lol.
Title: Re: 1up demo loader now available.
Post by: KD197 on November 10, 2010, 12:33:26 PM
You're welcome McGee, glad you like it :) I just nicked Teslas' idea though so the credit is all his.

Dougy, It'll work without Zenity, just without the GUI. On my system it's only 3 dependencies, your Mac appears to be trying to pull a complete X system LOL. I believe there are ways of adding simple GUIs to scripts natively on Macs, but I don't have one on which to test it, so it'll be down to a Mac user to lighten the deps on this by using a native solution.
Title: Re: 1up demo loader now available.
Post by: Dougy on November 10, 2010, 12:44:09 PM
You're welcome McGee, glad you like it :) I just nicked Teslas' idea though so the credit is all his.

Dougy, It'll work without Zenity, just without the GUI. On my system it's only 3 dependencies, your Mac appears to be trying to pull a complete X system LOL. I believe there are ways of adding simple GUIs to scripts natively on Macs, but I don't have one on which to test it, so it'll be down to a Mac user to lighten the deps on this by using a native solution.

meh i would rather download em all n have it all there for future stuff than having to download seperate ones for future projects ......... but yeah zenity requires 94 deps lol :D
Title: Re: 1up demo loader now available.
Post by: EnJoy[1up] on November 28, 2010, 07:16:24 PM
nice!
Title: Re: 1up demo loader now available.
Post by: LoveoftheDark on November 30, 2010, 05:12:56 PM
hurr durr...

I just downloaded this finally and I LOOOOVVVVEEEEe it. Very cool.
Title: Re: 1up demo loader now available.
Post by: marvsta on December 12, 2010, 10:03:09 AM
i found this mac demo loader :)
http://www.voidref.com/pub/apps/UrTDemoLauncher.10.5.zip (http://www.voidref.com/pub/apps/UrTDemoLauncher.10.5.zip)
just launch it and double click your dm_68 your files and it'll move it to the urban terror demos folders