![]() We do this in our implementation of the MapObject() method of our plug-in. The next step in this plug-in is to actually parse the map object and save the details/configuration to our code. Void FlagTakeZonePlugin::Init ( const char* /*commandLine*/) Parsing Your Map Object (Part 1) to "Parsing Your Map Object (Part 1)" section virtual bool MapObject (bz_ApiString object, bz_CustomMapObjectInfo *data) class FlagTakeZonePlugin : public bz_Plugin, public bz_CustomMapObjectHandler Now if we load a map file with our custom map object, nothing will happen but an error won't be thrown either. ![]() Here's what our setup will look like so far. This is necessary, otherwise BZFS will not know that your custom map object is a valid object. Similar to creating custom slash commands, you'll be making use of two functions in our Init() and Cleanup() methods, respectively. We'll be using this function to parse the information of our custom map object. Implementing this virtual function can also help you keep track of bases, teleporters, or any other map object you'd like. This virtual function is called during the process of reading the map file and will give you access to every map object. The first step is to make your plugin extend the bz_CustomMapObjectHandler abstract class, which will require you to implement a virtual function. Registering Your Map Object to "Registering Your Map Object" section Think of them as the same as a BZW zone object, which has no visible form. These custom map objects are not visible to players. Thanks to the bz_CustomZoneObject class, courtesy of yours truly, all of the math and logic has been moved to the API and requires no effort on your part. Prior to May 2015, you would have to write all of the logic and math yourself if you wanted to support custom zones. ![]() Have you ever played the King of the Hill (KOTH), All Hands on Deck (AHOD), or Jumping Skills? In this chapter we'll be building a plug-in that knows when players enter a specified zone to control the hill, capture the flag, or save at a check point. The next topic I'd like to cover regarding plug-in writing is how to create custom map objects. Interstellar space pirate extraordinaire ![]()
0 Comments
Leave a Reply. |