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
locking ship type with mervbot...

 
Post new topic   Reply to topic Printable version
 View previous topic  Need help with TM Mer 1.13 plugin for ... Post :: Post MERV:CTF Help plz?  View next topic  
Author Message
heh
Guest


Offline

PostPosted: Wed Jul 09, 2003 6:54 pm    Post subject: locking ship type with mervbot... Reply to topic Reply with quote

hi, i want merv to check ship type and lock it (as the shipcheck dll does, but i unless i can get the source for this its not much use to me because i'm adding additional functionality icon_smile.gif )
currently i'm using the handleSetTeamAndShip function, and when it detects a ship change to a ship other than the one i wanted for that particular player, it private messages them with "*setship ship#". hell, i even tried a directed *setship 1 and that didnt work, so i know its not the syntax..the if structures created do in fact trigger, as evidenced by another private message sent right before the setship...i'm guessing the problem is that because their ship was just set, it cant be set again immediately, so the command is ignored by the client, as its still in the process of changing ship the first time <which of course is what triggered the attemped change back in the first place.> i've just been editing merv source for all of my changes, but for those of you more familiar with the dll export syntax, the handleSetTeamAndShip function calls makePlayerSpec, makePlayerTeam, and makePlayerShip, respectively, depending obviously on whether freq was changed, ship was changed to spec, or ship was changed to anything else. i'm thinking i may just have to wait some period of time before i send the setship, and that really wouldnt be a problem to do, but is there another way that's less of a kludge (if that's eeven the problem.) ? any input or advice would be appreciated.
Back to top
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Thu Jul 10, 2003 7:38 am    Post subject: Reply to topic Reply with quote

Why don't you use botInfo::gotEvent(BotEvent &event) in spawn.cpp? In the switch part of this funtion are all events that might happen. For your problem just look for case EVENT_PlayerShip:
There you get a pointer (*p) to the player class of the player who changed the ship, the number of his old ship and of his old team. With p->ship you have access to new shiptype of the player. You should have no problems using sendPrivate(p, "*setship #"); there.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
heh
Guest


Offline

PostPosted: Thu Jul 10, 2003 9:40 pm    Post subject: fixed Reply to topic Reply with quote

ehh writing dlls just isnt my thing, rather go straight to the source tongue.gif
i got it to work fine, it was very strange, i guess its something with messages not being sent reliably..when i send the setship before the notification that it had triggered, i had no problems. heh, go figure. i guess i'll just have to look into sending it reliably. funny thing was i took the trouble to use an std::map<Uint16,Uint32> to store each player ident and timer values <one for each shipreset>, waited 100 milliseconds, then sent the command...that worked fine so i said oh i'll lower the lapse on the timer, set it to 20 ms, fine, 5 ms, fine, took it out entirely and just put the *setship in that function and it worked. ah ha.
Back to top
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Fri Jul 11, 2003 5:38 am    Post subject: Reply to topic Reply with quote

I prefer dll's. It's easier for me and it's more flexibel.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
heh
Guest


Offline

PostPosted: Mon Jul 14, 2003 2:15 am    Post subject: well.. Reply to topic Reply with quote

easier, perhaps, but definitely not as flexible as editing source itself.
Back to top
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Mon Jul 14, 2003 6:15 am    Post subject: Reply to topic Reply with quote

With flexibel i meant in game. You can load and unload the plugins when you want.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
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: 33 page(s) served in previous 5 minutes.

phpBB Created this page in 0.673883 seconds : 28 queries executed (97.1%): GZIP compression disabled