Hello and welcome to PainEditor Basics tutorial (singleplayer levels). It will teach you about the PainEditor interface, what the buttons do, the counter system, and other things.
1. The Interface
To the bottom right, by default there is three tabs.
One is Game Objects, which list all entities such as enemies or checkpoints in the map. It will categorize the entities by their type.
Another is Templates, which list all the available templates to spawn. Templates are objects with preset settings, so if you wanted to make a bunch of fast enemies and don’t feel like editing, for example – the run speeds on every single default one, you can just change the run speed on the default enemy, then save it as a template. Now you can spawn it from the templates tab instead of spawning and editing every single default one Laugh.
The last is Entities. You can’t do anything here really but right click them and click Look at to see where they are. These entities are the map’s meshes and lights and various other things created in whatever modeling software was used to make them.
2. The Buttons
I will only describe the interesting ones from left to right, on the top row. (Don’t worry about the second row, it’s only for walkmap stuff which is only needed for new .mpk’s and I don’t even know what they do anyways).
- Purple-ish cube with reticule thingy to upper left = This creates a new, blank, plain object. Good for if you want to create an object possibly not in templates by specifying the name in the Base Object option.
- Small red box with arrow going over it = This resets the currently selected object. Resetting the object sets it’s position and settings to the last saved position and settings. Handy if you just accidentally moved an object out of some perfect alingment you set it in or messed up the settings/properties and don’t want to do it again. Or you could just close the level/click the Reload Level Objects button. That works too (but is a little more time-consuming).
- Yellow and green speckles (button location around the middle of the row) = Toggle showing areas, so you can visually see them to help you know their size when your editing the size. Areas are the .CBox entities.
- Red box with lightning icon in it = Launch gamemode, which starts the level, switches fullscreen, and switches to player mode. A real all-in-one button.
- Play/arrow button = Turns on all lua scripts essentially starting the level. Press the F key to go to player mode and you will have weapons and monsters will work.
- Back button with “L” = Reloads all level objects. If you killed some monsters or picked up some ammo or anything, this puts them back. It just refreshes everything.
3. Making A Map
First, click File > Extract Game Data. This extracts the maps (.mpk’s), levels, and textures. You need the .mpk’s.
Wait a few minutes.
If you want to edit an existing level with existing entities, you could copy the level’s folder, rename it, rename the (levelname).lua and (levelname).CLevel files to the new name, open (newlevelname).lua and on the function (levelname):OnPlay() part change (levelname) to (newlevelname). Then open the level in PainEditor and edit.
If you want to “clear” an existing level/map, follow these steps.
- Click File > New Project
- Enter the name of your level and click OK.
- Click the Reload Game Objects button (this reloads the level to enable the map option in the level properties).
- Open the level’s properties under the Game Objects tab (double click on name of your level or click right key of mouse & select Properties).
- Click inside the blank space beside the “map” option, then click the “…” button.
- Navigate to the Maps folder if your not already in there, and choose the .mpk you want.
- Back at the level properties, click inside the blank space beside the WayPointsMap option and click the “…” button.
- Navigate to the Maps folder if your not already in there and choose the .wps with the same name as the .mpk you chose.
Next load up the original level and see the value for the Scale option in the level properties.
Change the scale option value in your new blanked level to this value. This correctly sets the scale of the level so you can walk and will have collision in the level.
Now you can start placing entities in your level.
4. The Counter System
I will now explain the counter system. The entities I know of that use the counter system are checkpoints and slabs.
Now you will learn in conjunction with an AmbushForPlayer.CBox and MonsterSpawnPoint.CSpawnPoint how to enable a checkpoint after you kill five monsters.
- To move on map use default keys W, S, A & D and pressing right mousebutton to change the direction, so you can fly on the map like a spectator in multiplayer. Open the Templates tab and spawn an AmbushForPlayer.CBox, MonsterSpawnPoint.CSpawnPoint, and a CheckPoint.CItem under the GamePlay folder in the map.
- Go ahead and click the Edit Areas button if you want to see the AmbushForPlayer.CBox and MonsterSpawnPoint.CSpawnPoint. Open the properties of the AmbushForPlayer.CBox and under Actions > OnTouch click in the empty space beside <new> and enter – Launch:CheckPoint_001, 5.
The syntax for the Launch action is this – Launch:<object name>, <monsters to kill until launch>. Now after you have killed the amount of monsters specified, the Launch action is executed. Go into the properties of the CheckPoint.CItem and change the Frozen option from false to true.
This hides and disables the checkpoint until Launch is called on it. Now let’s commence the final steps.
- Open the properties of the AmbushForPlayer.CBox and under ToLaunch click in the blank space beside <new> and click the arrow and choose your MonsterSpawnPoint.
- Open the properties of the MonsterSpawnPoint.CSpawnPoint and click the space near SpawnTemplate and click the arrow to choose the monster to spawn if you want. Devilmonks are the default. The default amount of monsters to spawn (GroupCount) is five, you don’t need to change it.
Now navigate in fly mode to where you would want the player to first start at in the map. Press the f key to switch to walk mode to get at the right height above the floor. Press the f key again to go back in fly mode to get your mouse back, then click click File > Save Level and Objects to save everything and your position.
Go ahead and click the Launch Gamemode button to start the game. Touch the AmbushForPlayer.CBox. Monsters will spawn. After you kill five, the checkpoint will activate.
I hope you guys found this tutorial helpful.