Sie sind auf Seite 1von 2

Advanced Scenario Creation in the K2 Engine

This guide is intended to give a rough overview with what's involved in creating a custom scenario for the K2 Engine. This guide does not teach you how to script or use the map editor itself. To script alternate game scenarios in the K2 engine, you'll need a few things: Access to the map editor A good text editor (we suggest notepad++) Knowledge of the entity scripting system within K2, as well as knowledge of how to use the map editor (or the patience to learn) Custom Map scripting in K2 is achieved with a combination of XML entity scripting and map editing. An example of a custom scenario S2 has built is actually the HoN Tutorial all of its functionality, interface popups, scripted battles, and customized interfaces were handled via scripting (nothing is hard-coded). Any custom scenario made in the K2 engine should be packaged into a *.s2z map file (this is the file generated by the editor when you save your map). Any map file generated by the editor can be opened with WinRAR or any other zipping utility. In order to package the files necessary to your scenario into the map file, you must create a resources folder inside the archive. The resources folder here serves as a replacement to the game directory (in terms of folder hierarchy). More will be discussed on this later. A fully complete custom scenario will generally need the following components: The Map Itself This is the file that the map editor generates when you save your map. It's essentially your terrain layout. Any units or other entities that you need to spawn on the map are placed in here, in the map file, and called to spawn via the XML scripting in gameinfo.entity. XML file: gameinfo.entity This file contains basic game information on your mode. In here, you can script special events and sequences to respond to things the player does (such as joining the game, killing a unit, spawning etc). Look at the HoN tutorial's map file for an example. Art/interface assets If you used custom art for game-models or custom interfaces, they should go inside the map's resources directory, following the standard folder hierarchy Interface files, for example, would go in resources\ui\, An alternate model for the legion defense towers would go in resources\buildings\legion\attack_tower\ Custom XML Scripting If you need any custom XML scripting for units or special abilities, for example, they would go in the resources directory as well. If any particular entity was intended to replace an existing entity (for example, if you wanted to give Witch Slayer a new ultimate), you would put it in the \resources\ directory following the same folder hierarchy that the game uses. You may need a customized base.gamemechanics if you need to change how damage types work, or create any new target schemes Customized String Tables

This is so your abilities and mechanics may have valid tool tips. These should be placed inside the \resources\stringtables\ directory in your map's archive. If you want to still allow HoN's regular tool tips to be used (if you're keeping any HoN content in your map), then you should make your entity stringtable an extension of HoN's entity string table, by naming yours entities_MAPNAME_en.str, where MAPNAME is the same as the file name (without the s2z part) of your map. You can overwrite the other string tables (such as interface string tables) in the same manner. The important thing to remember when working with the \resources\ directory is that if any file inside your \resources\ directory matches the name and relative location as a file inside the Heroes of Newerth\game\ directory, the K2 engine will use the one in your map instead of the one from inside the \game\ directory. Similarly, it will use the file inside your map's \resources\ directory if the name and location match any files inside of \game\resources0.s2z. That's the basic pieces of creating a custom scenario for the K2 Engine. With this information you can hook up customized UI, game mechanics, game modes, and more from tower defense games to full-on single player dungeons crawlers, you'll find a lot is possible once you gain a strong grasp of our XML based scripting system and map editor. We strongly encourage you to look at the tutorial for an example, located in your Heroes of Newerth\game\maps\ directory. You should also look at examples done by other users, if you can find any.

Das könnte Ihnen auch gefallen