.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Moster Plugin source compilation(Linux)
Old
  (#1)
kc2keo
Guest
 
Status:
Posts: n/a
Default Moster Plugin source compilation(Linux) - 29-08-2004

Hello,

I've been trying for the longest time to get botmans monster plugin source to compile via Linux. I know he mentions to use mingw and gcc for windows but I wish to compile it via linux. I see that it has a Makefile in the dlls folder and it has a depreciated flag so I had to change it to an updated one. I could run the shared library just fine on my steam dedicated server with the precached monsters which i'm happy with right now. I know the monster plugin uses Metamod so I decided to go to the metamod homepage and look around if I could find anything on the faq and nothing. I figured I could try the hlSDK for Linux and that didnt even compile so I dont know what to do. I havent tried taking the metamod shared library yet and putting it in my compile path and that might work but who knows. The forums are usually my last resort so I hate to be redundant with this question which probly has a simple awnser. I could see in the errors the compiler spits out when attempting to compile the monster plugin source complains mostly about SetUse, SetThink, etc. I'm almost sure that the shared library for metamod would work but I want to hear other peoples opinion. I read all of the readmes in the sdk, metamod, monster plugin. Like all of the tutorials I think point to mingw or claim to work in Linux. The SDK claims to work in Linux but I dont see how it is supposed to compile when I dont see a configure file and when I try Makefile nothing. Am I missing something here is there really a configure file because I know in most cases you must do ./configure to check your envirnment then you must do make to compile it. Other than that I'm confused and I need a bit a guideance I hope I dont sound like a nuecence or this is a stupid question.

Thanks in advance
George
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

The Monster plugin was compiled using an older version of gcc (2.91.66 or egcs-1.1.2).

Newer versions of gcc will complain about the SetUse(), SetThink() and SetTouch() calls. If there was this in the source code...

SetUse(MyUseFunction);

...it would need to be replaced with...

SetUse(&MyClass::MyUseFunction);

You will have to go through the source code and change all of these to match this format.

I have made similar changes to the SDK 2.2 source code found on my website. Download the SDK 2.2 patches shown here...

http://hpb-bot.bots-united.com/building.html

and either look at the diff files or run the batch file that converts the original SDK 2.2 source code, then compare the original SDK 2.2 source code files to those patched files to see what needs to change for a newer version of the gcc compiler.

It's a LOT of changes and if you aren't very familiar with C++, you WILL have problems converting things. So if you aren't good with C++, be prepared for some trouble.

botman
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#3)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

One can also use Will Day's personal SDK which he has updated for newer versions of GCC. That shouldn't be much trouble to make the changes in the monster plugin source code after that.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#4)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

thanks for the replies,

I have a good understanding of C++, C so I think this is enough information for me to get going.

Thanks this makes things more clear

George
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#5)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

ok,

I already downloaded the SDK for linux from www.metamod.org. I did that a while ago and I tried going to the dlls folder under multiplayer and running make. It doesnt know what the function setUse etc is still so I figured that I needed to run some other file before running that makefile. In the root part of the directory there is a .patch file which I suppose I should run. I looked through the file and its pretty large with diff commands. I looked at the man pages for diff and I got the gist of the command. Before I go any further with instructions you provided such as updating the setUse functions in the monster plugin source I want to know what the use of the .patch file is for.

I looked up unified diff files on the net and I found a nice article i'm currently reading and found so far the diff is for comparing files line by line and its good for developers. Thats nice to know so I could use it for my programs(nothing spectacular :-P ).

anyway I compared the patch file against the text file in the same directory and I got this output from this command that I issued:(output attatched)

Code:
[kc2keo@hellhole hlsdk-2.3-p1]$ diff -u hlsdkmetamod.patch metamod.hlsdk-2.3.txt
I think the -u flag is for unified i'm not sure what else I should use. I guess i'll experiment.


I had to make a change to the output from the diff command and tried removing it from the attatchment but it wouldnt remove. I think it might be because of my browser. I'm using konqueror in Mandrake Linux 10. anyway the bigger file size thats zipped is the one you would want to see.

thanks
George
Attached Files
File Type: zip outputfromcommand.txt.zip (6.2 KB, 308 views)
File Type: zip outputfromcommand.txt.zip (12.6 KB, 317 views)

Last edited by kc2keo; 30-08-2004 at 05:35..
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#6)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

continued post from previous post:

Last edited by kc2keo; 30-08-2004 at 05:32..
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#7)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

continued from previous post:





anyway after I ran the patchfile I got this output(see next post for outputpatch.txt.zip and download that for the ouput.

Last edited by kc2keo; 30-08-2004 at 05:31..
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#8)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

This is when I tried running the command

Code:
patch < patchfile
the output is attached
Attached Files
File Type: zip outputpatch.txt.zip (4.9 KB, 331 views)

Last edited by kc2keo; 30-08-2004 at 05:13..
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#9)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

continued from last post:


now I think I dont need to run the patch file because I assume the author has already patched the program. Isnt it just for backup like to patch the file again in case something happens and you need to restore the files. Anyhow I just want to patch it so I am sure it works.

Here is the patch file (its attatched):
Attached Files
File Type: zip hlsdkmetamod.patch.zip (11.1 KB, 324 views)

Last edited by kc2keo; 30-08-2004 at 05:20..
  
Reply With Quote
Re: Moster Plugin source compilation(Linux)
Old
  (#10)
kc2keo
Guest
 
Status:
Posts: n/a
Default Re: Moster Plugin source compilation(Linux) - 29-08-2004

finally the last segment:

It complains about the patching the code chuncks like:

Code:
@@ -33,4 +33,4 @@
and after that it says as you saw before in the output after I ran

Code:
patch < patchfile
it was complaining that it wasnt a valid path and it was going to skip the patch unless I specified. Is this command above outdated?
should I edit something here is something outdated?

I think I downloaded the correct SDK from the site. The stupid makefile still wont compile the files in the dll folder via multiplayer folder because it doesnt reconize the SetThink(), SetUse() functions etc.

The only thing I could think of is to now take botmans advice and edit all of the files manually to the newer format for the compiler. But even then how would it compile if I get this type of output:

also I had to edit a flag in the monster_plugin Makefile from -m386 to -march=i386 or -mcpu=i386 and that error is the only error resolved so far.

anyway heres the output from the dlls folder in monster_plugin folder:

Code:
[kc2keo@hellhole dlls]$ make
gcc -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -mcpu=i386 -lmetamod_i386 -O2 -w -I. -I../engine -I../common -I../pm_shared  -c agrunt.cpp -o agrunt.o
In file included from weapons.h:18,
                 from cmbasemonster.h:320,
                 from agrunt.cpp:22:
effects.h: In member function `void CMSprite::AnimateAndDie(float)':
effects.h:82: error: invalid static_cast from type `<unknown type>' to type `void (CMBaseEntity::*)()'
effects.h: In member function `void CMBeam::LiveForTime(float)':
effects.h:168: error: invalid static_cast from type `<unknown type>' to type `void (CMBaseEntity::*)()'
make: *** [agrunt.o] Error 1
[kc2keo@hellhole dlls]$
now for the source in the util.h file I had to include string.h for some of the functions used because it didnt exist. Now where the unknown type is is where the use, think, etc functions are. I even tried to include the metamod shared library into the path and that didnt work which I thought was logical since it uses metamod possibly it would link the functions against the shared library.

Last edited by kc2keo; 30-08-2004 at 05:26..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com