<=[[cw4:cpack:Start| Index]] ====== qople - Multimap ====== //[[canonical link to CPACK]] - where to get the author-maintained version// Multimap is a campaign editor made entirely within Creeper World 4's custom unit system. Because of this, no knowledge of 4RPL is required to use it. This guide assumes basic knowledge of how to import CPACKs and navigate the level editor. ===== Opening the Layout Editor ===== {{:cw4:cpack:docs:multimap_edit.png?400 |In the editor, the level map is toggled with a button.}} When you first import the CPACK, the first thing you'll notice is a green button next to your build units labeled "Edit Layout." Clicking this button will toggle the layout editor, which is where you can add levels and transitions into your campaign. Opening the layout editor will add 5 units to the "custom" tab: Level, Transition, Goal, Thumbnail, and Help. These units make up the entirety of Multimap, and are the only custom units you need to know. \\ \\ \\ \\ \\ \\ \\ \\ \\ ===== Multimap Units ===== Each level unit represents one map in your campaign. Clicking on one and either pressing its UI button or pressing ctrl + spacebar will switch to that map. Opening its script settings will allow you to change various attributes about the level: * TITLE: The name of the level * DESCRIPTION: The description shown below the title when clicked on * START_MSG_CHANNEL: The name of an ADA message channel to show when the level is switched into (only works outside of edit mode) * COMPLETE_MSG_CHANNEL: The name of an ADA message channel to show when the level is completed. * The completion message is shown as a game message (A text box on top of the screen), not an ADA message, to disincentivize excessive ADA message spam. * COMPLETE_MSG_BUTTON: The text shown on the button below the level's ending game message. * UNIT_UNLOCKS: A formatted string determining the level's unit unlocks. * Formatted as "TYPE:AMT,TYPE:AMT" for however many units you want to unlock. * TYPE is the [[4rpl:commands:unit_types| unit type]] of the unit to unlock, or the CMOD GUID for a custom unit. * If AMT is 0, that unit will be set to locked when unlocks are applied. * If AMT is positive, that many units will be *added* to the cap (if you have 2 max cannons and the unlock string says "cannon:5", you will have 7 max cannons after.) * If AMT is negative, the unit limit for that unit will be removed. * For custom units, you must format it as TYPE:AMT:SECTION, where SECTION is a number specifying the build tab your unit should appear under: * 0=STRUCT * 1=WEAPON * 2=AIR * 3=SPECIAL * 4=CUSTOM * If APPLY_UNLOCKS_ON_LOAD is 1 (the default value), then unit unlocks will be given to the player when they start the level, but removed if they leave without beating it. If this value is 0, unlocks will only be given when the level is completed. * CUSTOM_COMPLETE_EFFECTS is a way for completing levels to grant custom forms of meta-progression to the player. * It should be a string formatted as "EFFECT:VALUE,EFFECT:VALUE" * Will apply the given effects with the given values. * By base, the only effect is "IncreaseEnergy" which will increase the rift lab's base energy generation by the given value. * For instance, "IncreaseEnergy:0.5" will start the player with 1.5 energy generation instead of 1.0 for every level in the campaign after they beat this level. * FOR SCRIPTERS: Adding custom effects is easy, since all that this does is run SendMsg("EFFECT" "VALUE") on level completion. Just make sure to change the data type from a string in your script that receives the message. Transitions are how you add paths to your campaign, and objectives to your levels. They are placed by dragging them between two levels, instead of placing them down. Once placed, you can click on them and use their unit UI to select objective types and add them to that path. More than one objective can be added to a single transition. Objectives can be reclaim, collect, totems, nullify, time, or custom. All objectives other than time work the same as in vanilla Creeper World 4, and the time objective simply activates after a certain amount of time has passed, if the rift lab has not left the map (similar to a hold objective). The time objective is not intended to be used as the main objective for a level. Each transition's script settings has options that let you customize your objectives a little more than the base game lets you: * If REQUIRE_ALL is set to 0, the transition will count as complete if any objective added to it is completed. If set to anything else, all objectives in the transition will be required. * RECLAIM_REQ functions the same as the "reclaim %" number in the editor's "Game" tab. It's description is as follows: * "The percent of peak creeper that the creeper must fall below to get the reclaim objective. Set to 0 for total creeper elimination." * RECLAIM_CHARGE is the number of frames (30 frames = 1 second) it takes for the reclaim objective to charge. The default value of 450 frames means 15 seconds. * COLLECT_NUM, TOTEM_NUM, and NULLIFY_NUM all use the same format, for the collect, totems, and nullify objectives: * 0 means to require all infocaches, totems, or enemies * A positive number means to collect, activate, or nullify/destroy that many (COLLECT_NUM of 2 means "collect at least 2 infocaches") * A negative number means to collect, activate, or nullify/destroy ALL EXCEPT that many (NULLIFY_NUM of -2 means "nullify all enemies except for 2") * TIME is the number of frames (30 frames = 1 second) since the start of the level for the time objective to complete. The default value of 18000 means 10 minutes. * The rest is info for the custom objective, which is explained in its own tab. This section requires knowledge of 4RPL. A full walkthrough on how to make your own custom objective is located further down the page. This section focuses on the transition's UI for the objective. Each transition can have one custom objective on it. It is updated by an external script through the 4RPL SendMsg API. Each custom objective has a few settings that must be set in the transition unit's settings: * CUSTOM_GOAL: If the transition is fed any number greater than or equal to this number, it will complete the custom objective. * CUSTOM_START_TEXT: A string that shows up as the objective description when the level is loaded into, before the player unpauses. * CUSTOM_RUNNING_TEXT: A string that is shown when the level is running. This can be changed directly with [[4rpl:commands:setscript1var| SetScript1Var]], or will automatically update itself by these rules: * Any instance of "" in the string will be replaced by an automatically calculated percent complete (last value given / CUSTOM_GOAL * 100), with the % sign included. * Any instance of " will be replaced by [CUSTOM_GOAL - last value given]. Useful for "Do something X times" types of goals. * Any instance of "" will be replaced by the last value given, whether it is a string, number, list, or anything else. * CUSTOM_CHANNEL is the message channel used to communicate objective progress with this transition. The last value sent over this channel will be used for the text replacements above. * It is recommended that you have a different message channel here for every transition with a custom objective, to minimize the chances of interference between them. Goals are special types of levels that will complete the custom objective (beat the game) when they are unlocked. They show script settings like any other level, but they will ignore all of them. There can be any number of goal squares, and only one must be reached to win. Thumbnails are a special type of level that allow you to have a custom thumbnail for a colonies map that is not the first level of your campaign. This is done by saving a level that is switched out of immediately when loaded into. To make one, add a thumbnail unit to your level, add a transition from it to the first level of your campaign, and make the thumbnail level like any other level. Just remember to finalize on the thumbnail before you upload it! The help unit that shows up on the layout editor can be used as a quick guide in-game at any time. It has basic, essential information on what things do, and will redirect you back to this page on mouseover. It will delete itself when you exit the layout editor. \\ \\ \\ ===== Global Scripts ===== The map switcher manages and creates all map saves, and does the work to switch between them. Its script settings are: * CUSTOMUNITS: a comma-separated list of the GUIDs of all player-buildable custom units in the campaign. * PAUSE_ON_SWITCH: Whether to pause the game when the map is changed (recommended to leave on) * SAVE_BUILD_LIMITS: When 0, build limits will be the same for all levels, and unlocks can be used to unlock (or lock) units as more levels are beaten. When anything else, build limits will be saved with the rest of the map, and overridden with each map load. No unit unlocks will work with this setting on. * ERNS_PERSIST: If this is anything other than 0, the player can keep all ERNs from all levels they complete and use them in all levels afterward. If it is 0, only ERNs you place in each level can be used. * MAP_SPOILER_MODE: A number from 0 to 4 that decides how much information to show the player about maps they cannot travel to. The values are: * 0: Show all information about locked maps (title, description) * 1: Hide description for locked maps, but show their title * 2: Hide title and description for locked maps (default) * 3: Fully hide locked maps until unlocked. Will still show the location of Win squares. * 4: Fully hide locked maps and win squares. The objective script checks once per second and updates progress on all objectives in the level. If you have any custom units you would like included in the nullify objective, you should list their GUIDs here. All other global scripts have no settings, but they all serve a purpose. Editing.4rpl manages everything to do with the layout editor. CompleteEffects.4rpl contains the IncreaseEnergy completion effect, and can either be updated by script writers to add more, or used as an example. MVerse support.4rpl contains code for enabling multiplayer in your campaign. (Note that any custom content must be compatible with both MVerse and Multimap to work correctly.) DropInMVerse.4rpl allows players in an MVerse match to save and load their MVerse game in the middle of their session. \\ \\ \\ ===== Misc Info ===== ==== Will Multimap reset my saves? ==== It is highly recommended you keep at least one backup save in your editor scratch slots at all times, especially if you are using any other custom content. Multimap will **never** delete any map saves, for any reason. If you accidentally delete a level unit, place another down and it will link to the same save again. ==== Can I use (this other CPACK) in my campaign? ==== Multimap supports custom units //in theory,// although due to the nature of custom content, some units or CPACKS might do something that breaks the pack. In general, the more complex the content, the more likely it will need changes to be compatible. This is the responsibility of the one who made the unit to fix. Multimap is not currently compatible with FPS, PAC, or any other full-conversion mod. ==== A Note on Save File Size ==== Multimap saves each level in a compressed manner that allows (relatively) low save file sizes. However, it should be noted that **save files larger than 10 MB cannot be uploaded to colonies.** Here are some tips on keeping save size down: * Don't cover the whole map in creeper or special terrain. This is the single biggest factor in save file size. A map will take up about 10 times as much save file space if fully covered in creeper or special, or 20X if covered in both. * This will only matter on large map sizes with many levels. Normal use will not have this problem. * Rough terrain will take up slightly more save file space than smooth terrain. \\ \\ \\ ===== Using your own 4RPL with Multimap ===== This section requires knowledge of 4RPL. Multimap is compatible with custom content, but there are some differences. This section aims to provide an outline of everything you need to keep in mind when writing scripts for your campaign. ==== Global Scripts ==== Global scripts should only be used with Multimap if they should apply to every level in the campaign. An easier, more performant, and more reliable way to make a global script for one level is to make an invisible unit somewhere on or outside of the map that runs all the level's global scripts. If you want the script to run while paused, or outside of the unit update phase, register the unit for [[4rpl:commands:msg_preupdate| MSG_PreUpdate]], [[4rpl:commands:msg_postupdate| MSG_PostUpdate]], or [[4rpl:commands:msg_frameadvance| MSG_FrameAdvance]]. ==== Custom Units ==== Most custom units should be compatible with Multimap with little to no modification. Make sure that **@GameLoaded is not used for unit initialization.** ==== Creating a Custom Objective ==== Making a custom objective is different in Multimap than in the base game, since it involves sending messages to a unit. The main difference is in how you update the objective text, which you have two ways of doing: * Use the automatic text replacement rules in the custom objective overview, or * Manually grab the transition's UID, and change CUSTOM_RUNNING_TEXT with [[4rpl:commands:setscript1var| SetScript1Var]]. It will reset to whatever you originally set it to whenever the map is reloaded. ===== List of Units (CMODS) in this CPACK ===== * [[cw4:cmod:docs:627724b4-1a7b-4e6b-9764-e66ddf5edd1e|Level]] * [[cw4:cmod:docs:651ecd06-600d-4166-94d0-afde51f8b813|Transition]] <=[[cw4:cpack:Start| Index]]