Jump to content
SubSpace Forum Network

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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.

Posted

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 [].

Posted

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 help

enum 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.

Posted

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

Posted
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

Posted
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.

Posted
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?
Posted
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

Guest
This topic is now closed to further replies.
×
×
  • Create New...