Server Help

Bot Questions - Elim Plugin

blackmoon - Fri Jul 30, 2004 1:27 pm
Post subject: Elim Plugin
Okay... first off, I posted this help request in ssforum.net and didnt really get a response. I have the elim.dll plugin which is cool, however, I do not want it to give the option of Zombies or Conquer. I only want Elim, Team Elim, Warbird Elim and Race. Can anyone help me with that?

Someone sent me the source code but I am not a programmer. However, I tried compiling the source code without modifying it and the plugin wouldn't work still, so I figured it was pointless trying to get it to work.I am using Merv b44 if that makes a difference.
CypherJF - Fri Jul 30, 2004 1:55 pm
Post subject:
Using b44 shouldn't make any difference.
blackmoon - Fri Jul 30, 2004 3:14 pm
Post subject:
Ok... maybe I was given bad source code? I used the MervBot source found in the src.zip for the base folder and I followed the tutorial directions for VS6.0.
D1st0rt - Sun Aug 01, 2004 11:35 am
Post subject:
My suggestion would be to modify glock to support multiple games. If you didn't want to do that, you could just take the other options out of the plugin. If you don't want to do any programming, just use !force during voting
blackmoon - Mon Aug 02, 2004 3:13 am
Post subject:
I tried removing the options, but my dilema is that even if I dont modify the code and compile it, the plugin still doesnt work. Bad source code? I dunno. I really want to atleast try to modify it myself. Can someone send me some mervsource/elim source that they know for a fact is good?? I would atleast like to try to do it on my own.
blackmoon - Wed Aug 04, 2004 3:57 am
Post subject:
It's me again... and I am still on my quest to get this thing working. I used the !glock but it only allows me to lock 1 game. I have to found any source code that seems to work. If I compile it without making any changes, it gives me an error about 'i' having multiple declarations and such. I tried using merv 38 and merv 44 as the base and it still gives me the errors. Any ideas?
Bak - Wed Aug 04, 2004 7:21 am
Post subject:
post the source and post all the errors
blackmoon - Wed Aug 04, 2004 10:02 am
Post subject:
Here are the errors in my output box:

--------------------Configuration: elim - Win32 Debug--------------------
Compiling...
spawn.cpp
C:\Documents and Settings\Desktop\plugin\b44\elim\spawn.cpp(85) : error C2374: 'i' : redefinition; multiple initialization
C:\Documents and Settings\Desktop\plugin\b44\elim\spawn.cpp(64) : see declaration of 'i'
Error executing cl.exe.

elim.dll - 1 error(s), 0 warning(s)


Here is the source code, unmodified:
CypherJF - Wed Aug 04, 2004 10:48 am
Post subject:
You simply can not use the same variable name, taking into account for any scoping issues, for redeclaration. ie:

int x;

String x; // this will error since "x" is an integer


I'm assuming since you use "i", you use'd a for loop or something along those lines, where you may have done something like:

for (int i = 0; ...

for (int i = 0; ...) // this should be for (i=0, ...)

hopes this helps
Bak - Wed Aug 04, 2004 11:25 am
Post subject:
damn cypher... talk about hitting the nail on the head... you didn't look at the source did you?

blackmoon, you want to change your EndVote function to:

Code: Show/Hide
int botInfo::EndVote()
{
   if (override)
      return vote_default;

   int votes[MAX_VOTE];
   int i;

   for (i = 0; i < MAX_VOTE; ++i)
      votes[i] = 0;

   _listnode <Player> *parse = playerlist->head;

   while (parse)
   {
      Player *p = parse->item;

      int vote = get_tag(p, 2);

      if (vote >= vote_low && vote <= vote_high)
      {
         ++votes[vote];
      }

      parse = parse->next;
   }

   int best = vote_default;

   for (i = vote_low; i <= vote_high; ++i)
      if (votes[best] < votes[i]) best = i;

   return best;
}


in spawns.cpp
CypherJF - Wed Aug 04, 2004 11:53 am
Post subject:
Nope, I didn't look at the src tongue.gif just it's a common error that many people, including myself, do from time to time. icon_smile.gif
blackmoon - Wed Aug 04, 2004 12:42 pm
Post subject:
kk... I tried it... now I get...

--------------------Configuration: elim - Win32 Debug--------------------
Linking...
Creating library Debug/elim.lib and object Debug/elim.exp
command.obj : error LNK2001: unresolved external symbol "public: struct PlayerRank * __thiscall ElimRanks::FindRank(char *)" (?FindRank@ElimRanks@@QAEPAUPlayerRank@@PAD@Z)
spawn.obj : error LNK2001: unresolved external symbol "public: struct PlayerRank * __thiscall ElimRanks::FindRank(char *)" (?FindRank@ElimRanks@@QAEPAUPlayerRank@@PAD@Z)
command.obj : error LNK2001: unresolved external symbol "public: void __thiscall ElimRanks::SaveRanks(char const *)" (?SaveRanks@ElimRanks@@QAEXPBD@Z)
spawn.obj : error LNK2001: unresolved external symbol "public: void __thiscall ElimRanks::SaveRanks(char const *)" (?SaveRanks@ElimRanks@@QAEXPBD@Z)
spawn.obj : error LNK2001: unresolved external symbol "public: void __thiscall ElimRanks::ResortPlayers(void)" (?ResortPlayers@ElimRanks@@QAEXXZ)
spawn.obj : error LNK2001: unresolved external symbol "public: void __thiscall ElimRanks::AddRank(struct DiskRank *,bool)" (?AddRank@ElimRanks@@QAEXPAUDiskRank@@_N@Z)
spawn.obj : error LNK2001: unresolved external symbol "public: void __thiscall ElimRanks::LoadRanks(char const *)" (?LoadRanks@ElimRanks@@QAEXPBD@Z)
elim.dll : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

elim.dll - 8 error(s), 0 warning(s)

guess I should actually take more time learning C++ and looking at this all. lol!
Cyan~Fire - Wed Aug 04, 2004 1:20 pm
Post subject:
The redefinition thing is not a user error. Variables declared in the parentheses of the for loop are, by the C++ standard, go out of scope as soon as the loop ends. However, VC6 (and below?) puts it in the scope outside the loop. MS fixed it in VC7 and that's the one Catid uses. Therefore, Catid code has to be changed to compile of VC6.

Your linker errors, however, are. icon_razz.gif It sounds like you didn't include "rank.cpp" in your project.
blackmoon - Wed Aug 04, 2004 4:18 pm
Post subject:
thanks... that worked and I was able to modify it for my needs. Thanks!
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group