 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
heh Guest
Offline
|
Posted: Wed Jul 09, 2003 6:54 pm Post subject: locking ship type with mervbot... |
 |
|
|
|
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 )
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: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Thu Jul 10, 2003 7:38 am Post subject: |
 |
|
|
|
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 |
|
 |
heh Guest
Offline
|
Posted: Thu Jul 10, 2003 9:40 pm Post subject: fixed |
 |
|
|
|
ehh writing dlls just isnt my thing, rather go straight to the source
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: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Fri Jul 11, 2003 5:38 am Post subject: |
 |
|
|
|
I prefer dll's. It's easier for me and it's more flexibel. |
|
Back to top |
|
 |
heh Guest
Offline
|
Posted: Mon Jul 14, 2003 2:15 am Post subject: well.. |
 |
|
|
|
easier, perhaps, but definitely not as flexible as editing source itself. |
|
Back to top |
|
 |
Doggeti Server Help Squatter

Age:40 Gender: Joined: Jan 12 2003 Posts: 297 Location: Germany Offline
|
Posted: Mon Jul 14, 2003 6:15 am Post subject: |
 |
|
|
|
With flexibel i meant in game. You can load and unload the plugins when you want. |
|
Back to top |
|
 |
|
|
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
|
Software by php BB © php BB Group Server Load: 75 page(s) served in previous 5 minutes.
|