RegisterRegister    Log inLog in    SearchSearch   

Post new topic   Reply to topic
 
View previous topic :: View next topic  
Author Message
levko



PostPosted: Fri Jul 24, 2009 9:48 pm    Post subject: how to change command line properties Reply with quote

i'd like to know is there anyway to change name of command line parameter which starts the server e.g. cod2_lnxded to let's say cod2_lnxded_test
Back to top
View user's profile Send private message MSN Messenger
adbot



PostPosted: Thu Mar 31, 2011 3:57 am 

Andrew
Mammoth


PostPosted: Mon Jul 27, 2009 11:51 am    Post subject: Reply with quote

No you cannot change what executable is ran at this time.

What you may want to do is create your own cod2_lnxded script and let it act as a wrapper that decides what to run.
Back to top
View user's profile Send private message
levko



PostPosted: Wed Jul 29, 2009 1:11 am    Post subject: Reply with quote

Okay can you give me one example of wrapper script? Smile
Back to top
View user's profile Send private message MSN Messenger
Andrew
Mammoth


PostPosted: Wed Jul 29, 2009 4:08 pm    Post subject: Reply with quote

What you need to do is create a simple bash script with the same name as the file GameCreate tries to start, cod2_lnxded, and inside it decide (based upon the argument supplied) choose what executable to then run.

Be sure GC is configured to run the game inside a screen (via Game Config area) so that the process does not become rogue.

You will need to do some research on bash scripting (simplest I can think of), it's been a while since I have had to use it.
Back to top
View user's profile Send private message
levko



PostPosted: Wed Jul 29, 2009 10:19 pm    Post subject: Reply with quote

okay but where do i tell in GC which binary i wanna start? i mean how does the script get the argument? via command line parameter in GC?
Back to top
View user's profile Send private message MSN Messenger
Andrew
Mammoth


PostPosted: Thu Jul 30, 2009 10:15 am    Post subject: Reply with quote

GameCreate is *always* going to start cod2_lnxded - so you need to write a wrapper script called that (and rename the 'real' cod2_lnxded to something else, like cod2_lnxded_real) that your wrapper script starts (or decides instead to start cod2_lnxded_test as per your example) instead.

You can then make your wrapper script decide what executable to start (_real or _test) based upon what command line arguments are sent (and make GC send different one/s depending on what executable you want it to start).

This will take a bit of technical know-how.
Back to top
View user's profile Send private message
levko



PostPosted: Tue Aug 04, 2009 3:16 am    Post subject: Reply with quote

i'm planning to try out this script today Smile
Code:

#!/bin/bash
if [ $# -lt 1 ]
then
        echo "missing arguments"
        exit 1
fi

if [ $1 = "test" ]
then
        shift
        ./cod2_lnxded_test $@
elif [ $1 = "real" ]
then
        shift
        ./cod2_lnxded_real $@
else
        echo "invalid first argument - use real or test as the first argument"
        exit 1
fi
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum powered by phpBB © 2001, 2005 phpBB Group
GameCreate Service Terms | Privacy Policy | © Copyright Mammoth Media 2001-2007
GameCreate™ is a trademark of Mammoth Media Pty Ltd. GameCreate® is a registered trademark in Australia.