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?

Quick Links

Map editor overview

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.

Basic tasks: creating new maps, saving, loading, and screen scrolling

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.

Screen scrolling

To scroll the camera, hold the space key on your keyboard and left-click and drag your mouse.

Grid

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.

How to add and remove ships, towns and spawner

Adding objects

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.

Deleting objects

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.

Scripting System

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.

Editing script

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.

Removing script

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.

Scripting

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.

Basic Tutorial

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”.

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.

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 :

Kill Counter

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.

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.

In-Game Timer

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.

We strive to deliver the best gaming experiences on the internet and on your mobile phone. Play thousands of free online games, get access to free mmorpg games, online rpg games, fun online flash games, and more.