Results 1 to 4 of 4

Thread: [CoD4] [Linux] Add custom map

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts

    [CoD4] [Linux] Add custom map

    Hey all,

    I'm trying in last time to get something with CoD4 done, but everything seems different and buggy (I hope just as long I'm new to it).

    I wanted to add a custom map, so I made the folder usermaps in fs_homepath and just copied some maps in it (from my CoD4 client, so they worked on client at least).

    Then I wanted to start the map with: map mp_cod4_surf

    Result:

    Code:
    Error: Can't find map "mp_cod4_surf".
    A mod is required for custom maps
    The error message seems good, but the same message appears when I uploaded Deathrun1.2Braxi-Mod.

    PHP Code:
    "version" is"CoD4 MP 1.7 build 13620 Thu Oct 04 00:43:04 2007 linux-i386^7" default: "^7" 
    (if you got custom maps in CoD4/Linux working, could you compare the version? Just execute "version"-command)

    Start script:

    PHP Code:
    /root/helper/game_cod4/cod4_1_7 +set fs_homepath "/home/k_cod4_a" +set fs_basepath "/home/k_cod4_a" +set fs_game mods/k_dr +set net_port 45000 +set sv_maxclients 16 +exec rcon.cfg +set developer 1 +exec server.cfg +set g_gametype deathrun +map_rotate 
    Any ideas?

    Regards,
    kung
    timescale 0.01

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    BTW, under Windows everything works fine with: +set dedicated 2 +set fs_game Mods/modwarfare

    Most problems I had so far with linux/windows are case-sensitive-issues, but I have no clue here.

    If this problem is solved, I can start making the surfmod for CoD4 (working in extension: MySQL for Ranks / setVelocity / leftButtonPressed / rightButtonPressed).
    timescale 0.01

  3. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    I think the error is that you have your mod folder named with an underscore. No underscores in the mod folder name with linux servers. And everything lower case in the command line (linux COD4 servers are case sensitive).

    Also, when choosing custom maps, check the IWD file to make sure it only has: 1) an image folder; 2) a sound folder. If it has anything else other than sound or IWI files, linux servers will fall over when the map loads. You have to do what the community calls "cleaning" the map IWD by removing all unnecessary files from them.

    For a full in-depth tutorial, try this - it is specifically for setting up a linux server for custom maps and mods:

    http://www.inx-gaming.com/forum/thre...up-Custom-Maps

    EDIT - a word about what file types work in IWD files, and what needs to be compiled into fasfile:

    The game engine will only read the following file formats from disc (IWD):

    1. GSC
    2. CFG
    3. IWI
    4. MP3
    5. WAV
    6. WEAPON

    Every other file format MUST be compiled into fastfile in order for the game to recognise it's existence. It is no good putting in an .EFX, a .MENU, or .CSV file into an IWD and expecting the file to be read. They wont. They will be invisible to the game, as if they weren't there.

    SPECIAL CASES:

    When adding custom weapons, you must add the weapon file to your mod.CSV file (so that it is compiled into the mod.ff file) AND add it to your mod IWD file. The server will crash if you don't also add the weapon file to your mod IWD file.

    The same for image (IWI) files: they are compiled into fastfile AND added to your mod IWD file.

    Every other file format which has to be added to the fastfile doesn't also have to be added to the IWD file as well. Only IWI and weapon files.

    For GSC files, when testing your mod, you can simply place them in the IWD file for quick and easy editing. However, when you are complete, you are advised to compile them into fastfile. COD4 has an enduring bug that if GSC files are left in the mod IWD file, on a round switch (i.e. on the second and subsequent rounds) the server will crash with an "iwd sum mismatch" error. Putting them into fastfile will prevent this from happening.
    Last edited by Tally; 16th March 2013 at 07:53.

  4. The Following User Says Thank You to Tally For This Useful Post:

    kung foo man (16th March 2013)

  5. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Thanks for the infos, they come in handy. In some hours I have my vmf2map-convertor working for CoD4

    The problem was the pre-exec-script infront of the real lnxded-binary. Running the server directly = no issues anymore. Because the pre-exec-script changed the working directory to the location the lnxded is in (but in that folder is not my usermaps/).


    Thats the problem causing script:

    PHP Code:
    #!/bin/sh
    #
    # cod4_lnxded startup script
    #

    # Function to find the real directory a program resides in.
    # Feb. 17, 2000 - Sam Lantinga, Loki Entertainment Software
    FindPath()
    {
        
    fullpath="`echo $1 | grep /`"
        
    if [ "$fullpath"" ]; then
            oIFS
    ="$IFS"
            
    IFS=:
            for 
    path in $PATH
            
    do if [ -"$path/$1" ]; then
                   
    if [ "$path"" ]; then
                       path
    ="."
                   
    fi
                   fullpath
    ="$path/$1"
                   
    break
               
    fi
            done
            IFS
    ="$oIFS"
        
    fi
        
    if [ "$fullpath"" ]; then
            fullpath
    ="$1"
        
    fi

        
    # Is the sed/ls magic portable?
        
    if [ -"$fullpath]; then
            
    #fullpath="`ls -l "$fullpath" | awk '{print $11}'`"
            
    fullpath=`ls -l "$fullpath" |sed -e 's/.* -> //' |sed -e 's/\*//'`
        
    fi
        dirname $fullpath
    }

    # Set the home if not already set.
    if [ "${COD4_DATA_PATH}"" ]; then
        COD4_DATA_PATH
    ="`FindPath $0`/"
    fi

    LD_LIBRARY_PATH
    =.:${COD4_DATA_PATH}:${LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH

    # Let's boogie!
    if [ -"${COD4_DATA_PATH}/cod4_1_7-bin" ]
    then
        cd 
    "${COD4_DATA_PATH}/"
        
    exec "./cod4_1_7-bin" $*
    fi
    echo "Couldn't run Call of Duty 4 server (cod4_1_7-bin). Is COD4_DATA_PATH set?"
    exit 1

    # end of cod4_lnxded ... 
    Now the modding can start, finally after days of preparation.
    timescale 0.01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •