50% Packetloss Posted October 10, 2003 Report Posted October 10, 2003 The dll im making, opens the arena's LVL file...and other unimportant stuff. Problem is that I cant open the LVL file until the bot downloads it. The bot seems to start the dll before its done downloading the file. I place the code that reads the file in, case EVENT_ArenaSettings: Need to know how to check if the bot downloaded the map, so that i can open the file after its done, and how to get the arena's name so i can just strcat(arenaname,".lvl") to the end of the arena name. looked through the source for an answer, didnt find anything that seemed to work After I figure this out ill probably add a !sex function so that it will come outta spec and be my sex slave; woops too much information
ExplodyThingy Posted October 11, 2003 Report Posted October 11, 2003 Uhm, the bot can still toggle information before the dl. Otherwise, just load the bot, let it dl everything, then load the dll. Youll never need to wait again, since the files are already dled and saved.EVENT_ArenaSettings is not what you want, you would want EVENT_File or EVENT_GotFile or whatever its called.!sex is part of the core (icky catid). You can edit it really easily from there. What exactly are you trying to do anyway, that needs the files to be dled before use? The bot doesnt care if theyre dled or not, usually they just control them for other players.
50% Packetloss Posted October 11, 2003 Author Report Posted October 11, 2003 Bot opens lvl file, gets all the locations of the wormholes(could be anything but wormholes for now), stores them in linklist. When player moves it checks to see if they went into a wormhole. The event idea is to have cloaked spiders that use reps to knock people into wormholes, then bot spectates them. I was told that the physics of the wormhole would cause this not to work, but it seems to work with the defualt settings that come with the server app. I seem to p!@#$%^&* by the bot's location checking if i turn on super and speed into the wormhole but its probably fixable. The file needs to be downloaded before the file pointer looks through it. EVENT_File wont work becuase it doesnt redownload the file each time it goes into the arena.
ExplodyThingy Posted October 11, 2003 Report Posted October 11, 2003 Then utilize EVENT_PlayerMove, make a CFG or hardcode in the coords of the wormholes. Dont read the map. Or else, just make it download the map the first time. From then on, just make it read the map on EVENT_Init.
Mr Ekted Posted October 11, 2003 Report Posted October 11, 2003 All map downloading (if it's going to happen) should take place before the "you are in" packet (0x31), right? Is that an event in MERV?
ExplodyThingy Posted October 11, 2003 Report Posted October 11, 2003 case EVENT_ArenaEnter: { arena = (char*)event.p[0]; me = (Player*)event.p[1]; // if(me) {/*we are in the arena*/} bool biller_online = *(bool*)&event.p[2]; } break;
»Dustpuppy Posted October 11, 2003 Report Posted October 11, 2003 Why not just have the wormhole warp to a closed off center safezone.You could either wait till there's only one person left not in a safe, or if you wanted to spec people you could check if their in a safezone when they move.
Mr Ekted Posted October 11, 2003 Report Posted October 11, 2003 You get a player_enter packet for yourself (and all other existing players) BEFORE you get the "you are in" packet.
50% Packetloss Posted October 11, 2003 Author Report Posted October 11, 2003 how do i add that event? events are in here dllcore.h
ExplodyThingy Posted October 12, 2003 Report Posted October 12, 2003 EVENT_ArenaEnter is what you want. Ekted thinks Im refering to EVENT_PlayerEnter.
Mr Ekted Posted October 12, 2003 Report Posted October 12, 2003 Is EVENT_ArenaEnter an event for packet 02 or packet 31?
Mr Ekted Posted October 12, 2003 Report Posted October 12, 2003 Btw 'splody...I was looking at some of your docs to see if you had 31 packet defined, and I noticed in your Packet class you had a bug in the destructor: Packet::~Packet(){ if (msg) delete msg;} You are missing the [].
50% Packetloss Posted October 12, 2003 Author Report Posted October 12, 2003 Here is the list of all the codes, in order, no values are !@#$%^&*igned to each, believe the enum does that automaticlly. Hopefully its of some helpenum Bot2DLL_EventCodes { EVENT_Init, //DLL loaded EVENT_Term, //DLL unloaded EVENT_Tick, EVENT_ArenaEnter, EVENT_ArenaSettings, EVENT_ArenaLeave, EVENT_ArenaListEntry, EVENT_ArenaListEnd, EVENT_CreateTurret, EVENT_DeleteTurret, EVENT_PlayerEntering, EVENT_PlayerMove, EVENT_PlayerDeath, EVENT_PlayerScore, EVENT_PlayerPrize, EVENT_PlayerShip, EVENT_PlayerSpec, EVENT_PlayerTeam, EVENT_PlayerLeaving, EVENT_Chat, EVENT_LocalCommand, EVENT_LocalHelp, EVENT_RemoteCommand, EVENT_RemoteHelp, EVENT_FlagGrab, EVENT_FlagDrop, EVENT_FlagMove, EVENT_FlagVictory, EVENT_FlagReward, EVENT_TimedGameOver, EVENT_SoccerGoal, EVENT_File, EVENT_BallMove, EVENT_SelfShipReset, EVENT_SelfPrize, EVENT_SelfUFO, EVENT_PlayerWeapon, EVENT_PositionHook, EVENT_ObjectToggled, EVENT_BrickDropped, EVENT_WatchDamage, EVENT_FlagGameReset, }; EVENT_ArenaEnter is NOT what i want, it is called before the file is downloaded. EVENT_File would probablly be called when the map file was downloaded, the problem is that the file is only downloaded the 1st time the bot comes into the arena, if the map file is the same the bot wouldnt need to download it.
50% Packetloss Posted October 12, 2003 Author Report Posted October 12, 2003 oops, nm, it doesnt call event_file when it gets the map No matter if the map is downloaded or not, merv calls the same events.Order of events that are called when the bot enters://numbers are thier values 4: EVENT_ArenaSettings 2: EVENT_Tick // run every second 3: Event_ArenaEner
ExplodyThingy Posted October 12, 2003 Report Posted October 12, 2003 I already told you, EVENT_ArenaEnter = We are in the arena. All files dled. Ekted: Thanks, slight oversight.
50% Packetloss Posted October 12, 2003 Author Report Posted October 12, 2003 Thx for helping, but you are wrong. Files are downloaded after that case is executed or durring. Im happy to send my source to you so that you can see the same thing.
»Dustpuppy Posted October 16, 2003 Report Posted October 16, 2003 if (map) ? There's a gotMap too but I think that's just in the core
50% Packetloss Posted October 17, 2003 Author Report Posted October 17, 2003 if (map) ? There's a gotMap too but I think that's just in the core CALL_MAP map; //spawn.h typedef BYTE *CALL_MAP; //dllcore.h typedef unsigned char BYTE; //datatypes.h nope, doesnt seem that downloading the map has anything to do with the CALL_MAP map; , i had the bot display the variable in the game but it wasnt the map name either. Im going to try a few things. Going to have the bot open the lvl file and get its size, then wait a few seconds and do it again. when the sizes are the same from both checks, the file is done downloading. Otherwise it keeps trying, the file should grow larger while the bot downloads it, so not until its done will the size be the same after both checks. doubt this will work but ill try it
ExplodyThingy Posted October 17, 2003 Report Posted October 17, 2003 Why not just simply have the bot download the file before the module is loaded? This will only be a problem for you once for every map update. Seems much much simpler to me.
Mr Ekted Posted October 17, 2003 Report Posted October 17, 2003 Because in a good core design, all modules should be loaded BEFORE the connection is established.
»Dustpuppy Posted October 17, 2003 Report Posted October 17, 2003 CALL_MAP map; //spawn.h That is the map! It's not the name, it's the tile data.
ExplodyThingy Posted October 17, 2003 Report Posted October 17, 2003 Because in a good core design, all modules should be loaded BEFORE the connection is established.What Im saying is this: THe core only needs to download the map once. Simply load the core there and let it download. From then on, each time, all the files will already be downloaded, you wont need to worry about waiting for them to transfer. Otherwise, if theres ever a map change and the plugin flips out that it cant read the data, let dl finish, send !go where ever, and itll work fine.
Mr Ekted Posted October 17, 2003 Report Posted October 17, 2003 The point is, it's easy for the modules to get the map if the module interface is designed right. There is a packet (0x31) that says: login is complete, the map is downloaded, and you are in the arena. Does MERV have an event for 0x31 or does it not?
»nintendo64 Posted October 17, 2003 Report Posted October 17, 2003 The point is, it's easy for the modules to get the map if the module interface is designed right. There is a packet (0x31) that says: login is complete, the map is downloaded, and you are in the arena. Does MERV have an event for 0x31 or does it not? This should answer your question Ekted. // Enabled protocol generalRouter.add(0x01, handleIdent); generalRouter.add(0x02, handleInGameFlag); generalRouter.add(0x03, handlePlayerEntering); generalRouter.add(0x04, handlePlayerLeaving); generalRouter.add(0x05, handleWeaponUpdate); generalRouter.add(0x06, handlePlayerDeath); generalRouter.add(0x07, handleChat); generalRouter.add(0x08, handlePlayerPrize); generalRouter.add(0x09, handleScoreUpdate); generalRouter.add(0x0B, handleSoccerGoal); generalRouter.add(0x0C, handlePlayerVoice); generalRouter.add(0x0D, handleSetTeam); generalRouter.add(0x0E, handleCreateTurret); generalRouter.add(0x0F, handleArenaSettings); generalRouter.add(0x12, handleFlagPosition); generalRouter.add(0x13, handleFlagClaim); generalRouter.add(0x14, handleFlagVictory); generalRouter.add(0x15, handleDeleteTurret); generalRouter.add(0x16, handleFlagDrop); generalRouter.add(0x18, handleSynchronization); generalRouter.add(0x19, handleFileRequest); generalRouter.add(0x1A, handleScoreReset); generalRouter.add(0x1B, handleShipReset); generalRouter.add(0x1C, handleSpecPlayer); generalRouter.add(0x1D, handleSetTeamAndShip); generalRouter.add(0x1E, handleBannerFlag); generalRouter.add(0x1F, handlePlayerBanner); generalRouter.add(0x20, handleSelfPrize); generalRouter.add(0x21, handleBrickDrop); generalRouter.add(0x22, handleTurfFlagStatus); generalRouter.add(0x23, handleFlagReward); generalRouter.add(0x24, handleSpeedStats); generalRouter.add(0x25, handleToggleUFO); generalRouter.add(0x27, handleKeepAlive); generalRouter.add(0x28, handlePlayerPosition); generalRouter.add(0x29, handleMapInfo); generalRouter.add(0x2A, handleMapFile); generalRouter.add(0x2B, handleSetKoTHTimer); generalRouter.add(0x2C, handleKoTHReset); generalRouter.add(0x2E, handleBallPosition); generalRouter.add(0x2F, handleArenaList); generalRouter.add(0x30, handleBannerAds); generalRouter.add(0x32, handleChangePosition); generalRouter.add(0x35, handleObjectToggle); generalRouter.add(0x36, handleReceivedObject); generalRouter.add(0x37, handleDamageToggle); generalRouter.add(0x38, handleWatchDamage); // Disabled protocol generalRouter.kill(0x0A); // password response generalRouter.kill(0x31); // Login next generalRouter.kill(0x33); // Custom response generalRouter.kill(0x34); // Continuum version} -nintendo64
50% Packetloss Posted October 17, 2003 Author Report Posted October 17, 2003 if (map) ? There's a gotMap too but I think that's just in the core thx for the help dust, tried this, didnt work
Recommended Posts