The forum

[Script] Command And Conquer : Tiberian Dawn

Author Replies
KoRnKloWn Monday 11 June 2012 at 3:04
KoRnKloWn

I wrote this script on Ubuntu 12.04, however I think it should work on Mac also, I'd like someone to test it out if they could. I already submitted it and am waiting for a signature, but did not check the box for mac because I really don't know if it will work, and I have just updated it to fix a bug I noticed. it now seems to work flawlessly.

NOTE TO USERS WITH UBUNTU UNITY: This actually applies to ALL full screen wine apps, but before running the game, press Alt+F2 to bring up a command launcher and type 'gnome-shell --replace' (without the quotes), wait for it to change to gnome shell, then run the game. When you are done with the game/full screen wine app, press Alt+F2 again and run 'setsid unity'. You could use 'unity --replace', but 'setsid unity' works better from my experience.

Description
Command And Conquer Tiberian Dawn is a real-time strategy-combat game developed by Westwood Studios. Focusing on the global conflict between the fictional Global Defense Initiative and Brotherhood of Nod organizations, Tiberian Dawn puts the player in complete charge of fast paced military operations utilizing a wide variety of troops, ground vehicles, base installations, air strikes, and production facilities.

This is the classic Command And Conquer, patched by Nyerguds to work with Windows XP (and Wine :P).

Icons


Screenshots


--SCRIPT START--
[code]
#!/bin/bash
# Date: (5/28/2012)
# Wine version used: 1.3.12
# Distribution used to test : Linux Ubuntu 12.04 x64
# Author: Tory Gaurnier
# Licence: OpenSource
 
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Command And Conquer : Tiberian Dawn"
PREFIX="CommandAndConquer"
GAMEURL="http://www.gamefront.com/files/21533724/cc95v106c_r3_full_.exe"
MOVIESURL="http://download.digiex.net/Games/C&C%20Gold/cnc1_movies_full.rar"
MOV_DOWNLOAD="Yes, download the movie pack"
MOV_LOCAL="No, I already downloaded it"
MOV_NONE="No, I don't care about the movie scenes"
 
# Starting the script
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Westwood Studios Inc." "www.commandandconquer.com" "Tory Gaurnier" "$PREFIX"
 
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
# Create and setup wine prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "1.3.12"
POL_Wine_OverrideDLL "native,builtin" "ddraw"
 
# Download game
##Not using InstallMethod window because game must be downloaded from browser
##Also, if not downloading, make sure they have the patched version, it is required to work, not only on wine, but on anything newer than Windows 98 in general
POL_SetupWindow_question "$(eval_gettext 'Do you wish to download the game now? Choose no if you already downloaded the game (should be cc95v106c_r3_full_.exe).')" "$TITLE"

if [ "$APP_ANSWER" = "TRUE" ]
then
        POL_SetupWindow_message "$(eval_gettext 'When you continue your browser will open the download page.')"
        POL_Browser "$GAMEURL"
fi
 
# Install game
POL_SetupWindow_browse "$(eval_gettext 'Select the downloaded file (should be cc95v106c_r3_full_.exe).')" "$TITLE"
SETUP_EXE=$APP_ANSWER
 
POL_SetupWindow_message "$(eval_gettext 'IMPORTANT!!!\\nWhen installing, if you plan on adding the movie pack, DO NOT CHANGE INSTALL DIRECTORY.')" "$TITLE"
POL_Wine start /unix "$SETUP_EXE"
POL_Wine_WaitExit "$TITLE"
 
# Ask to download the videos pack
##Don't auto-download because it needs to be extracted from .rar, and we don't want to rely on 3rd party software within the script that is not installed by default. It is best if the user downloads and extracts themselves. Instead we just redirect to browser download if they want to download
POL_SetupWindow_menu "$(eval_gettext 'Do you want to download the movies pack?\\nWithout it you will not see the movie scenes in the campaign.')" "Actions" "$(eval_gettext '$MOV_DOWNLOAD')~$(eval_gettext '$MOV_LOCAL')~$(eval_gettext '$MOV_NONE')" "~"

if [ "$APP_ANSWER" = "$MOV_DOWNLOAD" ]
then
    POL_SetupWindow_message "$(eval_gettext 'When you continue your browser will open and the movies pack should start to download automatically.')"
    POL_Browser $MOVIESURL
    POL_SetupWindow_browse "$(eval_gettext 'Make sure to extract MOVIES.MIX from the downloaded rar file, then select MOVIES.MIX here\\n\\n')" "$TITLE"
    MOVIES_PACK=$APP_ANSWER
    mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\\&C95/MOVIES.MIX
elif [ "$APP_ANSWER" = "$MOV_LOCAL" ]
then
    POL_SetupWindow_browse "$(eval_gettext 'Make sure to extract MOVIES.MIX from the downloaded rar file, then select MOVIES.MIX here\\n\\n')" "$TITLE"
    MOVIES_PACK=$APP_ANSWER
    mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\\&C95/MOVIES.MIX
fi

sed -i "s/singlecpu=false/singlecpu=true/" $WINEPREFIX/drive_c/Westwood/C\\&C95/ddraw.ini

POL_Shortcut "C&C95.exe" "$TITLE" "tiberiandawn.png"
 
POL_SetupWindow_Close
exit
[/code]
--SCRIPT END--

Edited by KoRnKloWn

KoRnKloWn Monday 11 June 2012 at 3:11
KoRnKloWn

I should also note I will be attempting to make scripts for all C&C games not currently on the site, the next will be Command And Conquer : Red Alert, which EA also released as freeware :D However I can't promise a time line for when I make them, it depends on when I have time.
KoRnKloWn Friday 22 June 2012 at 21:51
KoRnKloWn

I just updated the script to follow the guidelines better, I believe I am totally following the guidelines now, if anyone sees any problems with my script please let me know, I don't want to work on any new scripts until my first one is 100% correct. There are some things I don't follow on purpose, because I can't, like the way I handle downloads, I added comments explaining why we need to handle them this way.
kcinman11358 Friday 29 June 2012 at 20:28
kcinman11358Anonymous

I can personally say this script works perfectly fine. Thanks for your effort! Off to play some retro games
KoRnKloWn Monday 16 July 2012 at 22:44
KoRnKloWn

So is there something I need to do for this script to be validated or something? Do you not like the download links I have? They are more reliable than mediafire, but is it because the downloads open in the web browser? Just let me know and I'll try to fix whatever it is that's keeping this from being validated and added to Playonlinux.
Sabre Friday 14 March 2014 at 16:28
Sabre

Hi!

Thanks,
works as expected, OS X 10.9.2 PlayOnMac 4.2.2

except this line:

    mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\\&C95/MOVIES.MIX

mistypeit should be 

mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\&C95/MOVIES.MIX

[code]
#!/bin/bash
# Date: (5/28/2012)
# Wine version used: 1.3.12
# Distribution used to test : Linux Ubuntu 12.04 x64
# Author: Tory Gaurnier
# Licence: OpenSource
# Web: http://www.playonmac.com/en/topic-9000-Script_Command_And_Conquer__Tiberian_Dawn.html 
 
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
 
TITLE="Command And Conquer : Tiberian Dawn"
PREFIX="CommandAndConquer"
GAMEURL="http://www.moddb.com/mods/command-conquer-unofficial-patch-106/downloads/cc95-v106c-revision-3-full-game-installer"
MOVIESURL="http://download.digiex.net/Games/C&C%20Gold/cnc1_movies_full.rar"
MOV_DOWNLOAD="Yes, download the movie pack"
MOV_LOCAL="No, I already downloaded it"
MOV_NONE="No, I don't care about the movie scenes"
 
# Starting the script
POL_SetupWindow_Init
POL_Debug_Init
 
POL_SetupWindow_presentation "$TITLE" "Westwood Studios Inc." "www.commandandconquer.com" "Tory Gaurnier" "$PREFIX"
 
# Setting prefix path
POL_Wine_SelectPrefix "$PREFIX"
 
# Create and setup wine prefix
POL_System_SetArch "x86"
POL_Wine_PrefixCreate "1.3.12"
POL_Wine_OverrideDLL "native,builtin" "ddraw"
 
# Download game
##Not using InstallMethod window because game must be downloaded from browser
##Also, if not downloading, make sure they have the patched version, it is required to work, not only on wine, but on anything newer than Windows 98 in general
POL_SetupWindow_question "$(eval_gettext 'Do you wish to download the game now? Choose no if you already downloaded the game (should be cc95v106c_r3_full_.exe).')" "$TITLE"

if [ "$APP_ANSWER" = "TRUE" ]
then
        POL_SetupWindow_message "$(eval_gettext 'When you continue your browser will open the download page.')"
        POL_Browser "$GAMEURL"
fi
 
# Install game
POL_SetupWindow_browse "$(eval_gettext 'Select the downloaded file (should be cc95v106c_r3_full_.exe).')" "$TITLE"
SETUP_EXE=$APP_ANSWER
 
POL_SetupWindow_message "$(eval_gettext 'IMPORTANT!!!\\nWhen installing, if you plan on adding the movie pack, DO NOT CHANGE INSTALL DIRECTORY.')" "$TITLE"
POL_Wine start /unix "$SETUP_EXE"
POL_Wine_WaitExit "$TITLE"
 
# Ask to download the videos pack
##Don't auto-download because it needs to be extracted from .rar, and we don't want to rely on 3rd party software within the script that is not installed by default. It is best if the user downloads and extracts themselves. Instead we just redirect to browser download if they want to download
POL_SetupWindow_menu "$(eval_gettext 'Do you want to download the movies pack?\\nWithout it you will not see the movie scenes in the campaign.')" "Actions" "$(eval_gettext '$MOV_DOWNLOAD')~$(eval_gettext '$MOV_LOCAL')~$(eval_gettext '$MOV_NONE')" "~"

if [ "$APP_ANSWER" = "$MOV_DOWNLOAD" ]
then
    POL_SetupWindow_message "$(eval_gettext 'When you continue your browser will open and the movies pack should start to download automatically.')"
    POL_Browser $MOVIESURL
    POL_SetupWindow_browse "$(eval_gettext 'Make sure to extract MOVIES.MIX from the downloaded rar file, then select MOVIES.MIX here\\n\\n')" "$TITLE"
    MOVIES_PACK=$APP_ANSWER
    mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\&C95/MOVIES.MIX
elif [ "$APP_ANSWER" = "$MOV_LOCAL" ]
then
    POL_SetupWindow_browse "$(eval_gettext 'Make sure to extract MOVIES.MIX from the downloaded rar file, then select MOVIES.MIX here\\n\\n')" "$TITLE"
    MOVIES_PACK=$APP_ANSWER
    mv $MOVIES_PACK $WINEPREFIX/drive_c/Westwood/C\&C95/MOVIES.MIX
fi

sed -i -e "s/singlecpu=false/singlecpu=true/g" $WINEPREFIX/drive_c/Westwood/C\&C95/ddraw.ini

POL_Shortcut "C&C95.exe" "$TITLE" "tiberiandawn.png"
 
POL_SetupWindow_Close
exit
[/code]

Edited by Sabre

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com