Pirateers 2 Editor Guide
Create custom missions and maps for Pirateers 2 using visual scripting and share them with your friends
If you donate to the game development of Pirateers 2 you get access to this premium map editor. Create custom missions and maps using visual scripting and share them with your friends using Armor Games’s sharing interface or with map code (text that you can copy & paste). What great things will you build?
- Map Editor Overview
- Performing Basic Tasks
- How to Add and Remove Ships, Towns and Spawner
- Basic Tutorial
- Advanced Tutorial : Fisherman Frenzy
Here is a screenshot of the editor and a brief description of its functions.
Tools Panel: Contains the menu and tools to edit your map.
Selection Tool: Select objects such as ships, towns, etc.
Transform Tool: To move and rotate objects.
Tile brush tool: To create islands, holes and wood tiles.
Object tool: To add ships, towns, etc.
Play button: To play your map.
Property panel: If an object is selected, property panel will display its properties.
Triggers panel: Create and edit scripts using this panel.
Creating a new map
To create a new empty map, click the File > New menu, and a dialog box will appear.
Adjust the map dimensions to your liking and click OK. Now, you can populate the map with ships, towns, etc.
To scroll the camera, hold the space key on your keyboard and left-click and drag your mouse.
Press G to hide/unhide grid.
How to save a map on a local disk
After editing a map, you might want to save your progress. Click the File > Save or File > Save As menu to save your map to local disk. Enter a name into the dialog box and click OK to save.
Your map is saved as a flash SharedObject (some sort of browser cookies), so be careful not to clear your browser’s cookies and disable the browser’s auto-cleanup setting. To avoid missing your map files, you can submit the map to Armor Games’ server and make them available for everybody else to play.
Submitting a map to Armor Games
Click File > Submit Map to Armor Games to upload and share your map with other players.
A dialog box will ask you to name the map and write a short description. Make a clear description and be interesting, so more people will be interested in playing your creation. Everyone will be able to browse, play and rate all the maps on Armor Games.
Map editing: how to add and remove island
Select brush tool and click the island tile type.
With brush tool selected, click anywhere on the map to add an island or use right click to remove island. You can’t add an island on black holes at the edges of the map. You can also add wood or hole tiles by selecting the appropriate brush type. Wood tiles are destructible, which means it will be destroyed if you shoot it.
To add ships, select the ship tool.
Click anywhere to add a ship. On the property panel (at the right side of the screen), you can see the ship’s properties. You can change the type of the ship, or its speed, HP, weapons, crew, etc.
You can also add towns (where player could buy goods and ammo) onto the map. First, select the town tool.
You can place the town anywhere on the map. On the property panel, you can set the town’s goods quantities and prices. If the property panel is empty, make sure that you have selected the town first.
Next, you can add a spawn point into the map. Spawn points automatically spawn ships for a fixed time interval. Select the spawn point tool on the tools panel.
Click anywhere to create it. On the property panel, you can set the spawn interval and the type of ship to spawn.
To delete an object (ships, towns, or spawn points), you have to select it first and then press the delete key on your keyboard. Or, you can click the Edit > Delete menu.
Moving/rotating objects around
Select the transform tool to move or rotate an object.
To move an object, place mouse cursor inside the bounding box, and then click and drag to new position.
To rotate, place mouse cursor in the edge of the bounding box, and then click and drag to rotate.
The Pirateers 2 scripting system is based on triggers or events. An event triggers when something happens in the game, such as, an enemy ship is destroyed, a ship enters a predefined area, etc. As a response to these events, you can define a sequence of actions to be taken.
Creating a new trigger
To create a trigger, first click the [+] button in the trigger tab.
Then write a name to identify this trigger. Click OK.
You can see the new trigger is now added to the list.
Double click the trigger you wish to edit. Trigger edit window will appear.
Click the arrow beside the add event entry, then select an event to trigger this script from the list.
To add a new Action, click the arrow beside the add action entry, then select an action you want in this script from the list. You can use your mouse wheel to scroll the action list.
- To edit the action entry, simply fill in the properties that you want. You can see more options by clicking the arrow at the right side of each entry.
- To remove the action, click the leftmost red X button.
- Click and drag the edit script window to scroll around.
- You can create another action entry by repeating this process.
Click hide when you finish to close the script edit window.
To remove a trigger, first select the script you wish to remove. Then click the [-] button in the trigger tab.
Using the region tool
You can use the Region Tool to mark an area for scripting.
Create a Region
First, select the Region Tool.
To create a region, click and drag to draw the Region Rectangle.
You can move and resize the rectangle using the properties panel.
To attach a Region to the script, you need to pick one of these event :
- Generic Unit Enter Region
- Generic Unit Leave Region
- Specific Unit Enter Region, or
- Specific Unit Leave Region
Then, select actions that you want. In this example, a storm will appear when player enter the region.
Removing a Region
To delete a region, select it and press Delete.
In this basic tutorial, we will create a simple kill target mission. Player is surrounded by Captain Cook and his gang, and we need to kill him to win the map.
Drawing the Map
To begin with, we need to create a fresh new file. Select File -> New, and then create a 40 x 40 map.
Draw several small islands on the map to spice it up a bit using the Brush Tool. Use Click to draw, and Right Click to delete.
Select the Create Ship tool, and draw 4 ships. You can place them as you like. Select one of the ship you’ve created, and change it’s Type to Capt. Cook. You may need to scroll up the dropdown using mouse wheel to find it. A confirmation box will appear, click OK. The ship’s sprite and stats now changed to Capt. Cook’s ship.
Captain Cook’s HP stats is too strong for player at the moment, so we need to reduce it. Set the Hull HP to 150.
Save the map by going to File -> Save. To try the map, you can click the Play Map button in the toolbar.
Scripting the Map
Next step is to create script to define our quest objective. To do this, we need to create two Triggers, name them “Map Initialization” and “Quest Complete”.
Double click the Map Initialization to edit the script. Create a new Game Started event and Quest – Assign Quest action. Let’s edit this quest’s name “Kill Capt. Cook”, and set the quest description to “Destroy Capt. Cook’s ship”.
Next, we edit the Quest Complete script. Add a Specific Unit Dies event. In the Unit dropdown, select Unit – Unit. In the select unit box, pick the Capt. Cook ship.
Create a new Quest – End Game action, set it to end the game in 1 second.
Aaaand…. that’s it! We’re done. Let’s save our map once more, and test play it. The quest is shown at the top bar, and the game will end if Captain Cook’s ship get destroyed.
This time, we’re going to make a “Fisherman Frenzy” game. In this map, player need to kill as many fisherman as possible before time runs out.
Draw the Playing Fields
1. Create a blank new map. File -> New. Set the map size to 30×32, click ok.
2. Select Brush Tool, and start to draw island on all map edge. We do this to prevent ships from falling to the edge.
We also need to create a bigger island area in the bottom left side of the map.
3. Select the Spawner Tool, and create 5 spawners. Put 4 spawners on each of the map edge, and the 5th spawner on map center, just above player’s position.
4. Use the Selection Tool and select the top left spawner. Set the type of this spawner to Fisherman. (You can use mouse wheel to scroll the dropdown menu). A dialog box will appear. Click OK to confirm.
5. Still in the Fisherman Spawner’s Properties box, click and drag the properties panel to reveal more options below. You will see the Interval properties. Set the number to 3. Make sure all spawners are enabled.
6. Repeat this process to all other spawners.
7. Let’s save the map before continuing. File -> Save, and name it whatever you like.
You can test the map now by using the Play Test button in the toolbar.
You’ll notice that our cannonball maybe firing a bit slow and deal not enough damage. Lets change that by editing our ship.
Select player ship. In the properties panel, set Cannon cooldown to 0.500. Then, scroll down a bit to reveal Weapons. Set primary weapon’s and secondary weapon’s damage to 99 and ammo count to 200.
Done ? Great! Lets test our map once again. You’ll notice now that we kill those poor fisherman fast and efficient 🙂
We will make time limit and kill counter using the scripts. But before we start, we need to setup the “dummy unit” to help us.
Create two units in the bottom-left island that we create earlier. Set their type to “Building Black Skull”, then set the 1st building’s HP to 30 and the 2nd one to 1000.
The first building with 30 hp will be our time counter dummy, and the second building with 1000 hp will be the kill counter dummy.
Okay, we’re set! Lets jump to the scripting panel.
Create the Map Initialization Trigger
Create a new Trigger and name it “Map Initialization”. Double click the Map Initialization trigger to edit it.
Add a new “Game Started” event, and then add a new “Unit – Damage Unit” action.
In the unit box, pick Unit – Unit, and then from the Select unit button, select “pick unit…”. (You need to scroll the selection to the bottom to find this)
Script window will be hidden and the cursor will change to pick unit. Click the Building we created earlier that have 1000 HP, and set the damage to 999. The reason we do this is to set the counter to 1. (We can’t set it to 0 because this building will die)
The final trigger should read like this :
Create another Trigger, name it “Fisherman Counter”. We will use this counter to track fisherman kill.
Add a new “Generic Unit Dies” Event in the Fisherman Counter, then add a new “Unit – Damage Unit” actions from the list. Fill the Unit box with the 1000 HP Building, and set the damage to -1. Damaging ship/building with negative value will add/heal their HP.
This trigger’s effect is that everytime an unit die, our kill counter dummy will gain 1 HP.
To show this information to the player, we need to create another action in this trigger. Pick the “GUI – Blinking Text” action.
Remember that we set this building’s HP to 1? We need to subtract the number with 1 to show the actual counter number. So in the first input box, select “Text – Number to Text”, then pick Math – Number – Number.
In the first Number box, select “Unit – HP of Unit”, and select the kill counter dummy building. Fill the second Number box with 1.
Next, in the Point box, pick Point – Make Point. Fill the boxes with 363, and 193.
This is where we place the text box. Note that this is screen coordinate. Pirateers 2 is 750 px width, and 600 px height. You can create the text offscreen but it will not be visible or partially visible.
Finally, set the duration for this text to 1 second.
The trigger should look like this in the end :
Let’s save, and play test our map. Looks good isn’t it 🙂
You can edit the text box to show additional text like “Fisherman Killed : 18” by using Text – Merge Text.
Last step is to create the timer. To do this, we need to create two triggers, name it “Timer” and “End Timer”.
Let’s edit the Timer Trigger first.
Add a new Timer event, and set the repeat interval to 1 second, and repeat count to 30.
Create a new Unit – Damage Unit action. Fill the Unit box with our 30 HP building, and set the damage to 1. This means, every 1 second for 30 times, our dummy building will receive 1 damage.
Create GUI – Blinking Text action. Fill the text with Text – Number to Text, and pick Unit – HP of Unit. Pick the time counter dummy building (30 HP one).
Position this text in 363, 80.
Double click the End Timer trigger to edit it.
Add a new Specific Unit Dies event, and pick our 30 HP time counter dummy.
Add Quest – End Game action. Fill the time with 1 second.
Huzzah, its done! Dont forget to save! Test play it, or share it with your friends 🙂
For practice, you can make a variant to this game. A few example :
– add time bonus for every kill count.
– add another building to track killstreak. Let’s say when player kill 10 fishermen, several whirlpool will appear at random place >;)
You can find both the basic tutorial map and the fisherman frenzy in the Custom Map section of the game.