PDA

View Full Version : cod2 libcod problems



Moolster
16th May 2014, 11:58
Hi im totally new to linux but got a cod2 server up and running just wondering how i get libcod going? ive tried placing all libcod files into my server directory and running the commands but receiving no such file or directory error.

Any help would be great :)

Mitch
16th May 2014, 14:07
You have tried what the readme file says?

https://github.com/kungfooman/libcod/blob/master/README.md

Also the newest libcod version doesn't require any std GSC files. The function that libcod provided are now real function.
You can find these functions with documentation at: http://znation.nl/cod4script/

Edit: you can post the little that your log says and your startup line?

Moolster
16th May 2014, 15:53
Thanks for getting back, My startup line is



LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +set dedicated 2 +set g_gametype tdm + exec server.cfg


703704
These 2 images showing what im getting and also what is in my main server folder.



File Handles:
----------------------
81662 files in iwd files
execing default_mp.cfg
couldn't exec language.cfg
couldn't exec config_mp_server.cfg
dedicated is read only.
Opening IP socket: localhost:28960
ERROR: UDP_OpenSocket: bind: Address already in use
Opening IP socket: localhost:28961
Hostname: cod2-virtual-machine
IP: 127.0.1.1
--- Common Initialization Complete ---
dedicated is read only.
couldn't exec server.cfg
Hitch warning: 2096 msec frame time


This is at the bottom of that picture sorry it was cut off.

Mitch
16th May 2014, 16:12
For some reason it can't preload the .so.

Are you using this one?
http://killtube.org/downloads/libcod/libcod2_1_3_nomysql.so

If you are using that version or it also didn't work then you might need to recompile the .so for Linux Mint.
(edit confg.hpp to disable mysql)

Edit: to run libcod you don't need the source files (.hpp, .cpp). You only need the .so. Your current startup line requires the .so to be in the same directory as your linux binary.
Also linux cod2 doesn't need the cod.bmp or any dll.

Moolster
16th May 2014, 16:37
I have just tried with that .so and no source files in my main with the same error. Sorry to sound stupid but where is the binary located for me to put the .so into?

Mitch
16th May 2014, 17:50
I just recompiled libcod. Try these one:
http://znation.nl/libcod/libcod2_1_3_nomysql.so

And if that doesn't work try this as start up line:


LD_LIBRARY_PATH=. LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +set fs_game ...

Moolster
16th May 2014, 19:23
Thank you so much libcod is now loading great but theres one issue no one can seem to connect to my server just sitting on connection 1,2,3 etc. If i use localhost i can connect but my external ip doesnt allow connections, i have port forward all the ports requires so not sure what is going on. Again thank you so much for getting libcod sorted :), Hopefully we can get the server fully online

kung foo man
17th May 2014, 18:46
Nobody can connect because you are running libcod now or is it an independent problem? You might just need to configure UDP-Port-Forwarding in your router, e.g. at http://192.168.0.1

Moolster
17th May 2014, 21:17
Thank you both for the great advice now got a fully working codlib server :). Time to mod and have some fun.

Edit: Sorry to bug you both but how would i go about using the scripts e.g. Disable collision?

filthy_freak_
17th May 2014, 22:02
Thank you both for the great advice now got a fully working codlib server :). Time to mod and have some fun.

Edit: Sorry to bug you both but how would i go about using the scripts e.g. Disable collision?

http://znation.nl/cod4script/

You can disable global collision by adding



disableGlobalPlayerCollision();


right after



Callback_StartGameType()
{


in your gametype.gsc file.

Moolster
17th May 2014, 22:08
Thanks for the reply, Where is the gametype.gsc located?

Mitch
17th May 2014, 22:12
Thanks for the reply, Where is the gametype.gsc located?

You can add it in maps\mp\gametypes\[gametype].gsc or maps\mp\gametypes\_callbacksetup.gsc.

Moolster
17th May 2014, 22:23
I had no maps folder so i created the folders required in main and made a _callbacksetup.gsc in there with the command disableGlobalPlayerCollision();. But its not working im afraid.

Mitch
17th May 2014, 22:32
I had no maps folder so i created the folders required in main and made a _callbacksetup.gsc in there with the command disableGlobalPlayerCollision();. But its not working im afraid.

Copy it from iw_07.iwd > \maps\mp\gametypes\.
Also restart your server after adding the code. If you want to enable collision again remove the function and restart your server.

filthy_freak_
17th May 2014, 22:39
I had no maps folder so i created the folders required in main and made a _callbacksetup.gsc in there with the command disableGlobalPlayerCollision();. But its not working im afraid.

First off, stop using the main folder to put your mods.

Go to the CoD2 directory, create a new folder (Name it mymod for now).

Go inside the newly created mymod folder, create another 3-4 folders (mymod/maps/mp/gametypes).

Go to your main folder, find and open iw_07.iwd with winrar.

Go to maps/mp/gametypes and look for _callbacksetup.gsc.

Copy that file into the gametypes folder you created in the mymod folder.

Then open your freshly copied _callbacksetup.gsc, find



[[level.callbackStartGameType]]();


and place



disableGlobalPlayerCollision();


just before it such as;



CodeCallback_StartGameType()
{
// If the gametype has not beed started, run the startup
if(!isDefined(level.gametypestarted) || !level.gametypestarted)
{
disableGlobalPlayerCollision();

[[level.callbackStartGameType]]();

level.gametypestarted = true; // so we know that the gametype has been started up
}
}


Now all you need to do it edit your old launch configuration and set fs_game to mymod



LD_LIBRARY_PATH=. LD_PRELOAD=libcod2_1_3_nomysql.so ./cod2_lnxded +set fs_game mymod +set net_ip .....

Moolster
17th May 2014, 23:03
Thank you all for the help now working fully and now know what im doing lol :)

PureTryOut
18th May 2014, 17:36
Is there anyway to find these same files in Cod4? These files are not in any of the "iw_xx.iwd" files

Mitch
18th May 2014, 19:29
Is there anyway to find these same files in Cod4? These files are not in any of the "iw_xx.iwd" files

Download cod4 mod tools and go to cod4/raw/.

http://callofduty.filefront.com/file/Call_of_Duty_4_Modern_Warfare_Mod_Tools;85947 (v1)
http://callofduty.filefront.com/file/;86101 (v1.1 update)

Mirror #2
http://www.gamershell.com/download_22849.shtml (v1)
http://www.gamershell.com/download_22930.shtml (v1.1 update)

IzNoGoD
18th May 2014, 19:33
Download the mod tools, look in raw folder. Look for the globallogic file (iirc), as the scripts moved from the gametype gscs into one big obfuscated-ish file.

PureTryOut
19th May 2014, 08:44
Aah thanks! I could have known that :p