Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
MERVBot with Eclipse?

 
Post new topic   Reply to topic Printable version
 View previous topic  Idea - Dynamic arena settings Post :: Post Merv-Bot cant !say (8)  View next topic  
Author Message
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Mon Sep 06, 2010 12:58 pm    Post subject: MERVBot with Eclipse? Reply to topic Reply with quote

Anyone ever made mervbot plugins with Eclipse?

I seem to be having trouble getting it to run properly...

I installed MinGW, all the include paths are set...


I get dozens of errors like this:
..\spawn.cpp:583:37: error: no matching function for call to 'botInfo::tell(BotEvent)'
Everytime a tell is called, like:
Code: Show/Hide

void botInfo::sendPublic(char *msg)
{
   tell(makeSay(MSG_Public, 0, 0, msg));
}


This refers to this function:
Code: Show/Hide
void botInfo::tell(BotEvent &event)
{
   if (callback && handle)
   {
      event.handle = handle;
      callback(event);
   }
}

What is the '&' for in the declaration?
Edit: Apparently void (int *a) { *a += 5; } is equivalent to void (int &a) { a += 5; } , looks confusing to me, but whatever tongue.gif (Thanks to JoWiE)

Also, a bunch of these:
..\spawn.cpp:205:38: error: cast from 'void*' to 'Uint16' loses precision
These aren't warnings, they're errors...

I also get hundreds of these warnings:
..\/..\player.cpp:89:19: warning: deprecated conversion from string constant to 'char*'
Anytime a "string" is passed to a function that takes a char*


What's wrong?
_________________
(Insert a bunch of dead links here)


Last edited by Samapico on Mon Sep 06, 2010 2:21 pm, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Mon Sep 06, 2010 1:57 pm    Post subject: Reply to topic Reply with quote

I'm on windows 7 x64, if that's any help
Back to top
View users profile Send private message Add User to Ignore List
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Mon Sep 06, 2010 3:17 pm    Post subject: Reply to topic Reply with quote

Got rid of the "cast from 'void*' to 'Uint16' loses precision " errors by changing all these casts to 'int'. void* and int are guaranteed to be the same size, so I guess g++ likes that more, or something.

Stuck with:
..\spawn.cpp:588:39: error: no matching function for call to 'botInfo::tell(BotEvent)'
..\spawn.cpp:41:6: note: candidate is: void botInfo::tell(BotEvent&)

hmm
Back to top
View users profile Send private message Add User to Ignore List
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Mon Sep 06, 2010 3:27 pm    Post subject: Reply to topic Reply with quote

Possible solution:

Code: Show/Hide

void botInfo::sendPublic(char *msg)
{
   tell(makeSay(MSG_Public, 0, 0, msg));
}

changed to:
Code: Show/Hide

void botInfo::sendPublic(char *msg)
{
   BotEvent evt = makeSay(MSG_Public, 0, 0, msg)
   tell(evt);
}




Yep... that did the trick... was a pain in the butt to change all over the place though.
Back to top
View users profile Send private message Add User to Ignore List
cycad
Novice


Gender:Gender:Male
Joined: Feb 12 2004
Posts: 29
Offline

PostPosted: Tue Sep 07, 2010 2:46 pm    Post subject: Reply to topic Reply with quote

Careful, void* and int aren't necessarily the same size on x64, and I don't know of any standard that guarantees they would be.

As for the string conversion warnings, you can disable them with -Wno-write-strings
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 664 page(s) served in previous 5 minutes.

phpBB Created this page in 0.459920 seconds : 30 queries executed (93.9%): GZIP compression disabled