In this tutorial we'll show you how to use the Move Ship action within your scripting events. As well as the normal viking ship and trade ship design we'll also be showing you how to make custom ships and even provide lifeboats and multiple landing craft! We'll look at setting up ship routes, adding delays, synchronising with other events (such as invasions), making ships leave the map or becoming shipwrecked, boat crashes and we'll even send ships up rivers, over waterfalls and through castles...
Submitted by Aubergine and BraveSirRobin
Defining Ship Routes Before you can get your ships to appear on the map and move around, you nee to place some flags to define their entry-point (where they first appear on the map) and any other waypoints on their journey. In our example, we want the ship to start at the edge of the map (red flag #1), then sail along the coast a little (to green flag #1) and finally arrive at the beach (blue flag #1): 
Note: The colour and number of flags do not matter, we've used the flags above simply to help us illustrate this tutorial more easily. Adding the Move Ship Action Now that you've placed flags on your map to define your route, you need to tell the ship about the flags. Go in to the mission editor and add a new event. The trigger can be anything you desire, but for now we're just going to use "Always" and the action needs to be "Move Ship": 
When you select the action, you'll be presented with a dialog that asks you to define the ships entry point (the first item in the list) and any subsequent destinations (remaining items in the list): 
To tell this ship about the route we have planned for it, we need to specify which flag it starts at and then each other flag on it's journey: 
The ship will travel in a stright line between each destinations. It will not automatically sail around coastlines and other obstacles - you have to plan every step of it's journey! Note: Never use the same entry point and first destination (ie. the first two rows on the dialog must be different) otherwise the ship will not appear. For example, if you had both the entry point and the following destination point as red flag #1, the ship would not appear. When you've entered all your flags, click the "OK" button to store the action. When the game is played, the ship will appear on the map at the defined entry point (red flag #1) and then go to each of its subsequent destinations (green flag #1 and blue flag #1) and then dissapear (leave the map). If you don't use up all the specified route destinations on the action panel, the game will automatically set the next avialble destination to be the same as the entry-point, probably to make using the Leave Map setting easier (see later). 
Normally, this is exactly what you want - the ship should leave the map at the same place where it first appeared on the map: 
However, if you want a shipwreck or a different exit point, this can be quite a problem! To solve the problem, simply fill up all the destination points as shown below: 
Without any free slots, the game has no choice but to use the last destination point as the location where the ship will either leave the map or turn to a wreck. Another alternative is to simply back-track the route, effectively getting the ship to turn round and go back the way it came. Here's an example: 
The good thing about this is that the ship will be on the map for longer (more chance of the player seeing it) and you already know that the route is working to your requirements (no need to place more flags or do further timings to work out how long it takes for the ship to leave the map). Using Delays In many cases, you might want the ship to pause at a certain destination point. To do this, set the number in the last column as shown below: 
In the example above, the ship would pause for one month at green flag #1. You can make the ship pause for up to 100 months at a given location - that's a whopping 8 years and 4 months! Note however that you can't delay the last point on the journey as the ship must either leave the map or turn to a wreck at that point, if it has not already done so before. If you want a delay of more than 8 years and 4 months, include the same point more than once and set a delay: 
In the example above, our ship would pause at gree flag #1 for 8 years and 8 months (because we added an extra 4 months at the following green flag). You can set a delay of up to 400 months at a single location which would result in the ship waiting for a grand total of 33 years and 4 months (by my calculations) before going to its final destination. But remember that the first two points on it's journey cannot be the same (otherwise the ship will not appear) so you would have to use a seperate flag for the entry point (eg. red flag #1) and place it as close as possible to the flag for the remaining destinations (eg. green flag #1): 
Trade Ship or Vikings? There are two standard designs of ship in Stronghold 2, the Trade ship or a Viking ship and you select the desired type of ship by clicking on the button on the action dialog: 
The trade ship is by far the largest ship and is the ideal ship to use if you want to represent settlers arriving at an island or goods arriving from an ally, etc. 
The captain (who we assume is also the trader) stands at the front of the ship and a pikeman keeps a watchful eye at the back. The ship is sail powered and features a "crows' nest" at the top of it's mast that would allow the crew to keep a lookout for land on the horizon. 
Various goods are stored below on deck under two sheets of canvas. After having a close look at the ship, the goods on both sides of the mast appear to be the same - some barrels (which could contain pitch, ale or wine), some white crates (which could be stone or candles) and some wooden crates (which could contain anything). Compared to the trade ship, the viking ship is tiny... 
The sail and mast are much smaller, the crows' nest is gone and there are 8 hardy Vikings rowing with all their strength while their leader steers the boat. 
Although there's no room for storage on this small boat, it is ideal for raiding parties, lifeboats, smuggling and other scenarios where you want a small boat to be involved. Trade Ships with Oars Do you have a scenario that could really use a third type of ship? Check this out: 
That's right, it's a trade ship that has oars! Should the wind drop, this ship would keep on going! 
Creating this custom ship is relatively simple - script a trade ship and then script a viking ship on exactly the same route and at the same time. Because both ships move at exactly the same speed, they will blend seamlessly along their route. 
Better still is that the vikings hide under the canvas that covers the goods on the trade ship. If you look closely, however, you can still see them rowing away under the canvas: 
You can use this ship for all kind of reasons... You could tell the player that vikings have been hiding on trade ships to launch raids on your castle or that this ship is simply a new design, etc. Personally, I just think it looks great and use it as eye candy! Lifeboats Because our custom ship completely hides the viking ship apart from it's oars and the occasional glimpse of a viking, we can treat the viking ship as a lifeboat! You can tell the trade ship to turn to a wreck and the viking ship will come out of the wreck as if it were a lifeboat: 
If you script several viking ships and a single trade ship and then set each viking ship to go to a different flag after the point where the trade ship is wrecked, you can give the effect of several lifeboats coming from the one ship! Landing Craft Instead of wrecking our trader ship, you could simply set a delay on it and the viking ships within it would keep moving making it appear that they have come out of the trader ship. If you have more than one viking ship then each should be given it's own location on the beach to head to otherwise it will look like there is only one of them. This would be a great way to scare the player - a single trade ship suddenly spawning several viking ships full of troops and heading their way. Leave Map or Shipwreck? There is a button on the action panel to state whether the ship should either leave the map after reaching it's last defined destination or turn in to a ship wreck. Clicking the button switches between the two settings: 
Only the trade ship can be turned in to a wreck as show below: Picture from Path of Peace, Mission 1
The shipwreck near the top of the picture above was placed in the map editor and looks far more submerged than the scripted shipwreck below it (near the middle of the picture). To find out how to manually place shipwrecks in the map editor, see our tutorial on Shipwrecks Anywhere. If you try to shipwreck the Viking ship, it will simply remain on the map for the duration of the game with it's crew still rowing. If you ever want a ship to arrive on the map and then remain there for the rest of the game without using delays, shipwreck a Viking boat! All Terrain Ships By simply placing flags on the map, the ship will go exactly where you tell it to - up rivers, over land and even appear out of waterfalls! Here's an example of a trade ship sailing across land: 
And the viking ship doing the same - which looks quite odd as the crew are still rowing! 
The ships will always "float" on the ground, be it water or earth, so if a mountain gets in the way (for example) the ship simply sails over it! We'll now go on to give a few examples of unusual ship journeys... Death by Waterfall What would happen if a ship went over a waterfall? 
Well, in Stronghold 2 it would acutally survive and continue on its journey unless you told it otherwise - to give it more expected behaviour, put a flag at the bottom of the waterfall and set the ship to be wrecked on that flag. The result: 
Crunch! Spawn from Waterfall If you set the start point of a ship to be at the bottom of a waterfall (or next to any cliff and even buildings for that matter), then the ship will appear to come out of the waterfall/cliff/building: 
The viking ship, being much smaller than the trade ship, is the ideal candidate for such things. As the ship slowly sails out of the water fall you can even see it behind the water: 
This is a perfect way to illustrate some secret cave hidden behind a waterfall! The smugglers or bandits can then sail down the river on their way to the sea: 
Ghost Ships In one of our forum discussions, HicRic asked if ships could be moved through walls like a "Ghost Ship" - the answer is most definatley "Yes": 
Here's anoter picture, this time taken looking from behind. The ship just glides through the wall on it's way to the keep... 
So, getting carried away as we often do, we decided to see if they'd go through buildings: 
That ship went through our entire castle without hesitation! Shipwrecks Anywhere In our tutorial on Shipwrecks Anywhere, we showed how to place wrecks in the map editor. It's not too much of a leap of imagination to realise that we can take this to the extreme using scripted ships... First, get a ship to go through a building or some other thing - here's a ship moving lengthways through our Keep: 
The tell it it turn to a wreck at a flag placed just outside the Keep: 
Because our ship is like a ghost, units (such as the Lord) will happily walk through it as if it were not there! That's quite handy considering we just placed a shipwreck inside the Keep! We also tried with a Viking ship and ended up with a permenant boat being rowed outside the keep door after turning it in to a wreck (because viking ships don't get wrecked, they just stay on the map for ever more). Who knows what that would look like if we'd built walls around it with those oars appearing and dissapearing through the walls!? Trigger Suggestions Because there are so many triggers and combinations of triggers in Stronghold 2, we could never list them all. Instead we'll just give some examples to give you some ideas as to the types of things that could be used to trigger a ship... Buying in Goods When a certain amount of gold is accumulated (Goods Aquired trigger), a ship could arrive to deliver goods (Give Resources action) and then take gold in payment (Cap Resources action). Enemy Reinforcement An obvious trigger is something relating to enemies such as Enemy Honor Aquired trigger (you could say the enemy has gained enough honor to bring in Viking reinforcements), Lord Damaged trigger (if a lord gets hurt he might send in a boat full of troops), etc. Completion or Failure of a Quest You might have to produce 100 swords for an enemy lord (Goods Aquired trigger) to complete a quest (Quest action). If that quest is not complete (Quest Not Complete trigger) on a set date the Vikings would invade otherwise they could act as reinforcements. Another very obvious quest is the completion of a lighthouse (also known as a beacon) as seen in Mission 1 of the Path of Peace. Like we said, there are numerous possibilities - you'll just have to experiment and see what you come up with... Synchronising with other Events This is one of the most time consuming aspects of using ships - getting other events to synchronise with the ship depending on where it is along it's journey. Luckily, ships move in straight lines and always at the same speed which makes things easier but you'll still have to get things right by trial and error. Let's say you want a ship to come ashore (where it will be delayed for 1 or more months) and when it does an invasion disembarks. You know when the ship appears on the map but not how long it will take to get to the beach. Your only option (as far as we are aware) is to play the game and count the number of months it takes for the ship to get to the beach. Now you need to get your invasion to appear on the beach after the ship arrives and before it leaves! The easiest way to do this is to script your invasion based on the same conditions that made the ship appear on the map and then set a delay (bottom right corner of picture below) on the invasion to the number of months it took for the ship to get to the beach: 
The benefit of using this method is that you tie both events to the same set of triggers (otherwise you might get the invasion appearing even if the ship event doesn't take place) and it's easy to alter the delay should you make any changes to the ship's journey. Because the invasion will happen at the start of the month, it's likely that the ship will have been on the beach for a while before the troops appear. In most cases this is not a problem, but if you are a perfectionist you might want to make the ship arrive at the beach moments before the troops arrive. You can't make the troops arrive in the middle of a month, so you have to modify the ship to arrive monents before the troops. This involves a lot of trial and error and playtesting. To alter the time it takes for a ship to reach the beach, you have to alter it's journey. You can't merely set a delay for a given waypoint as delays only work in months and not days or weeks. Instead you have to move your flags around to make the ships journey longer or shorter and after each change play the game to see what effect that has on the arrival of the ship at the beach. Good luck! There are also cases where you need to synchronise ships with each other... Boat Crash What started out as a small mention of naval battles in our Ships forum topic soon turned in to a quest to see how we could get ships to destroy each other. Unfortunately we've not been able to get ships to shoot at each other, but we have managed to get them to ram each other: 
If you ever needed an excuse to upgrade to the lastest, most powerful graphics card, just look at the picture above! Awesome! To get ships to ram each other you need to start them from two seperate flags (eg. green flag #1 and green flag #2) and then tell them both to head towards another flag (eg. red flag #1) as their final destination where one or both of them can shipwreck. Ideally, you need them to get to the final destination at roughly the same time so you might need to alter the positions of their starting flags (or even script in delays) to adjust their journey time. The "move ship" action is relatively flexible considering what we've manged to achieve above, eh? There will no doubt be many more ideas generated for this most special feature of the game. Well, we hope this has given you plenty of ideas and prompts you to start adding ships to your maps! Cast Off!
|