PDA

View Full Version : Help libcod windows



Lucky
25th December 2014, 10:51
Hello,help me with run the libcod on windows,please.

IzNoGoD
25th December 2014, 11:21
Have you tried anything?

Mitch
25th December 2014, 11:24
The current version only supports cod2 1.3.

Download the dll from this post.
http://killtube.org/showthread.php?1730-Libcod-for-windows&p=10310&viewfull=1#post10310

Or compile it yourself from https://github.com/M-itch/libcod_win using CodeBlocks.

(copy the dll next to your server.exe)
(You might need https://github.com/M-itch/libcod_win/blob/master/libcod_win/lib/libmysql.dll too)

Now use kung's InjectLibcod.bat to inject libcod.

Lucky
25th December 2014, 11:42
So how i can run it in cod2 1.0?

Tally
25th December 2014, 12:29
So how i can run it in cod2 1.0?

Obviously, you can't. It only supports COD2 1.3. That means it wont work with 1.0.

Lucky
25th December 2014, 12:33
there a version 1.0?

Mitch
25th December 2014, 12:46
So how i can run it in cod2 1.0?

You can't unless you know how to add support for 1.0.
I will try to find the addresses that are needed for 1.0 when i got time.

serthy
25th December 2014, 13:00
You can't unless you know how to add support for 1.0.
I will try to find the addresses that are needed for 1.0 when i got time.

I'd like to to be able to do this, can you give me a hint? (maybe per pm, I'm going to record a tutorial video later, on how to compile libcod, run it, add functions and maybe on how to modify the the game memory etc. your last pm was an excellent start)

Mitch
25th December 2014, 13:06
I'd like to to be able to do this, can you give me a hint? (maybe per pm, I'm going to record a tutorial video later, on how to compile libcod, run it, add functions and maybe on how to modify the the game memory etc. your last pm was an excellent start)

I will post that tutorial and this one too later today.

Edit: this is for only adding the real functions. I still need to make the part for reading the parameters and the return function.

Edit 2: moved tutorial to a new thread.
http://killtube.org/showthread.php?2084-Tutorial-Add-libcod-support-for-your-cod-version

Lucky
8th February 2015, 14:43
Why libcod dont work?

835
836

Mitch
8th February 2015, 17:14
Why libcod dont work?

835
836

So far i can see it did work.

Edit: it says PLUGIN LOADED and the lines in the injector look ok.

Lucky
8th February 2015, 17:28
what did you mean?
Pls help me with run libcod on windows.

Mitch
8th February 2015, 17:43
what did you mean?
Pls help me with run libcod on windows.

Try this in your _menus.gsc



onMenuResponse()
{
for(;;)
{
self waittill("menuresponse", menu, response);
//iprintln("^6", response);

if(response == "libcodtest")
{
self iprintln("IP: " + self getIP());
self iprintln("Ping: " + self getPing());
self iprintln("Jump: " + self jumpButtonPressed());
self iprintln("Velocity: " + self getVelocity());
}

if(response == "libcodtest2")
{
self setVelocity((0,0,1000));
}


Now in game type this in your console:
/openscriptmenu -1 libcodtest
/openscriptmenu -1 libcodtest2

Lucky
8th February 2015, 18:20
if(response == "libcodtest")
{
self iprintln("Velocity: " + self getVelocity());
}

if(response == "libcodtest2")
{
self setVelocity((0,0,1000));
}

Error:Unknown Function.
If i put

getVelocity()
{
player = self;

functionid = 1;
playerid = player getEntityNumber();
ret = closer(functionid, playerid);
//iprintln("ret=", ret);
return ret;
}

setVelocity(velocity)
{
player = self;

functionid = 0;
playerid = player getEntityNumber();
x = velocity[0];
y = velocity[1];
z = velocity[2];
ret = closer(functionid, playerid, x, y, z);
}

And use in game console:
/openscriptmenu -1 libcodtest or /openscriptmenu -1 libcodtest2
Nothing happens

Mitch
8th February 2015, 18:52
We aren't using closer anymore for our functions in libcod.

You can now just call 'player getVelocity()' when libcod has been loaded.
(Windows supports only the basic functions compared to Linux version)

(Short support list: mysql_..., Cmd_ExecuteString, printf, ..Velocity, ...ButtonPressed, getPing, getIP)

Lucky
8th February 2015, 19:11
help me)

837

kung foo man
8th February 2015, 19:23
Don't start your server with "map command" and then inject the .dll-file. After that, you can load a map (which will load the scripting engine). Otherwise you want to use functions, which are not registered yet.

Lucky
8th February 2015, 19:41
I start server
getVelocity() work but setVelocity and getIP() and other functions kill my server.Why?

kung foo man
8th February 2015, 20:10
Define "crash my server"... does it crash at runtime? Does it crash start? Any error message?

When getVelocity() works but no other functions, I suspect you still have the closer-stuff in.

Ni3ls
8th February 2015, 22:39
Start the server without setting the map. Then inject dll. Start a map and it works