News: 1up Discord VOIP
Invite Code: https://discord.gg/VPv9JhP

Author Topic: 1up demo loader now available.  (Read 7160 times)

0 Members and 1 Guest are viewing this topic.

Offline KD197

  • Posts: 671
  • Karma: 28
  • Since: 20/06/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #15 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!

Not-so-1337-hax0rz: awsdgiaygveiujgfahiy, killer, [K1L]ShAd0W[GER], [51]Usage (impersonator), 1Lexa8, Redeye, sid, ASTROKILLA, bar, mody, [R:K]BatistaBomB, revenger, [58f]gojan, imaidiot, [DOA]Arik, sn4k3, Broajer, HACKER, DDMX, dopey

"yeah, I googled "mod reveal 67" to find out what it does and the top links were from 1up" - SlimPickins[1up]

Offline Tesla[1up]

  • *Administrative Leave
  • [1up] Dev Admin
  • [1up] UrT Admin
  • Posts: 480
  • Karma: 106
  • Since: 07/07/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #16 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]
"May I suggest the footing of your ass" Red Forman

Offline KD197

  • Posts: 671
  • Karma: 28
  • Since: 20/06/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #17 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
« Last Edit: November 09, 2010, 02:53:32 PM by KD197[1up] »

Not-so-1337-hax0rz: awsdgiaygveiujgfahiy, killer, [K1L]ShAd0W[GER], [51]Usage (impersonator), 1Lexa8, Redeye, sid, ASTROKILLA, bar, mody, [R:K]BatistaBomB, revenger, [58f]gojan, imaidiot, [DOA]Arik, sn4k3, Broajer, HACKER, DDMX, dopey

"yeah, I googled "mod reveal 67" to find out what it does and the top links were from 1up" - SlimPickins[1up]

Offline Tesla[1up]

  • *Administrative Leave
  • [1up] Dev Admin
  • [1up] UrT Admin
  • Posts: 480
  • Karma: 106
  • Since: 07/07/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #18 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]
"May I suggest the footing of your ass" Red Forman

Offline FUBAR

  • Posts: 50
  • Karma: 6
  • Since: 27/05/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #19 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.

 :)
In a man-to-man fight, the winner is he who has one more round in his magazine.
Erwin Rommel

Offline Pyrite[1up]

  • *[1up] Dev Admin
  • [1up] Dev Team
  • [1upZ] NMRiH Admin
  • Posts: 1,560
  • Karma: 147
  • Since: 08/11/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #20 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 :)
•·.· ́ ̄`·.·•"Most Likely to Pillage the Global Village"•·.· ́ ̄`·.·•


Offline Tits_McGee

  • Posts: 326
  • Karma: 33
  • DON'T PANIC!
  • Since: 08/10/2009
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #21 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!

Offline Dougy

  • Posts: 594
  • Karma: -6
  • Since: 17/01/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • TheOMFG Music
Re: 1up demo loader now available.
« Reply #22 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.
« Last Edit: November 10, 2010, 12:14:54 PM by Dougy[1up] »

Offline KD197

  • Posts: 671
  • Karma: 28
  • Since: 20/06/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
Re: 1up demo loader now available.
« Reply #23 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.
« Last Edit: November 10, 2010, 12:41:35 PM by KD197[1up] »

Not-so-1337-hax0rz: awsdgiaygveiujgfahiy, killer, [K1L]ShAd0W[GER], [51]Usage (impersonator), 1Lexa8, Redeye, sid, ASTROKILLA, bar, mody, [R:K]BatistaBomB, revenger, [58f]gojan, imaidiot, [DOA]Arik, sn4k3, Broajer, HACKER, DDMX, dopey

"yeah, I googled "mod reveal 67" to find out what it does and the top links were from 1up" - SlimPickins[1up]

Offline Dougy

  • Posts: 594
  • Karma: -6
  • Since: 17/01/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • TheOMFG Music
Re: 1up demo loader now available.
« Reply #24 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

Offline EnJoy[1up]

  • *[1up] UrT Admin
  • [1upZ] Zombie
  • Posts: 1,014
  • Karma: 23
  • 1up Urt Admin
  • Since: 24/11/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • 1upclan
Re: 1up demo loader now available.
« Reply #25 on: November 28, 2010, 07:16:24 PM »
nice!

Offline LoveoftheDark

  • Posts: 98
  • Karma: 18
  • 01001001 00100000 01110111 01101001 01101110 00101
  • Since: 17/04/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
    • Loves Deviant Art
Re: 1up demo loader now available.
« Reply #26 on: November 30, 2010, 05:12:56 PM »
hurr durr...

I just downloaded this finally and I LOOOOVVVVEEEEe it. Very cool.
My turn.

marvsta

Re: 1up demo loader now available.
« Reply #27 on: December 12, 2010, 10:03:09 AM »
i found this mac demo loader :)
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