CampGen Tutorial
From Wesnoth
Contents
|
My First Campaign
A Campaign from Scratch
Let's try creating a most simple campaign with CampGen. Note that some things will change as newer versions are released, so just post in the forum if you don't understand anything.
Start CampGen, and choose "Create a new campaign from scratch". You will find yourself in the campaign dialog. You can fill in some basic information about the campaign here. Let's do so. Give it a name, an icon, a short description, a picture (it will appear in-game later above the description the campaign selection), and three difficulty levels. For icon and picture, you can just use anything out of your Wesnoth/images folder for now, e.g. some unit (in images/units) as icon and a portrait (in images/portraits/<author>) as picture. Or use your own pictures, or just leave them blank for now.
Next, each difficulty level gets an icon, a name, and a difficulty description. You can also leave it all blank for now if you want.
To be playable, the campaign now needs at least one scenario. Click the "New" or "Edit" button to create a new scenario and switch to the scenario dialog.
My First Scenario
Give the scenario a name, and specify the number of turns. After that, it will need a map to play on, a side for the player, and an opponent side. To create a map, click on "Edit Map". This will open the built in Wesnoth Map Editorâ„¢. Modify the map, then exit the editor (save the map if it asks). For now, a map consisting of just grass is enough. But make sure to set a player 1 and player 2 starting point, and some castle tiles around. If you forgot it, you can open the editor again, or you can also set them from within CampGen.
In that case, click on "Place Items", and find yourself in the items placer dialog. From the drop-down box in the upper right corner now select "Map". Then scroll down over all the terrains in the list to the right, select one with "1" on it, and place it somewhere on the map. Two the same with the tile with "2" on it. These will be where sides 1 and 2 start. If you already placed starting positions in the Wesnoth Map Editorâ„¢, they should have appeared in the map. You can also place castle and other tiles, but it will be harder than in the normal map editor. Click the "Done" button when done and return to the scenario dialog.
Click on "Edit Side" or "New Side" to create a new side. In the latter case, double click on it, or select it and click "Edit Side". In all cases, you will create a new side, and switch to the side dialog.
The Player
In the side dialog, you fill in information about one side. Let's start with the player. Fill in a name, and check the "human" radio button. Then decide on the type of the leader, and what will be possible to recruit. In our case, let's choose elves. In the tree view to the lower right, expand the tree items and go to Elves and Level 2. Find a unit you like, then click the "Leader" button. Next, expand Level 1, and find the units your leader should be able to recruit. In our case, it will be "Elvish Fighter", "Elvish Archer", "Elvish Shaman" and "Elvish Scout". Select those for units, then click on all three "Add" buttons above the tree view. We just allowed the player to recruit the four select units, in all three difficulty levels. Click "Done" to return to the side dialog.
The Enemy
Now it is time to define an enemy. Click on "New Side", then select the unnamed side in the list and click "Edit Side" (or double click). The side dialog will open again. Fill in a name, set the radio box to "AI", and change the side to 2. Then try now for example to make the leader be some level 2 Orc, who can recruit some level 1 Orc units (select the leader unit in the tree view and click "Leader", then select some level 1 units and click the "Add" button for each difficulty level).
That should do as enemy. Just make sure you have given him/her a variety of different units, else the AI might not know what to recruit. Also check that you set side to "2". Then click "Done" to return to the scenario dialog.
The Premiere
Let's add one more thing before running it. Click on the "Times" button to open the time dialog. In the drop-down box below the "Import From" button select "Standard Times", then click the button. The six standard times should appear in the list to the right. Click "Done" to close the time dialog. Now click "Done" in the scenario dialog to return to the campaign dialog. In the menu, use File/Save (or hit Ctrl-S) to save your campaign into the Wesnoth campaigns folder. Now, you can exit CampGen (or leave it open if you want to continue your campaign later).
First though, let's see how it all looks in-game. Start up wesnoth, and select the "Campaigns" button. Your campaign should appear, with the icon you selected, and a description and image to the right. When you select to play it, the difficulty chooser will pop up. It should show the 3 images, names, and descriptions you filled in. Select one, and it should start with your scenario. Your leader will be able to recruit the units as defined earlier. And the enemy will be able to recruit the defined units as well. If the AI doesn't like any of the units you allowed it, it will do nothing - but don't worry about that now, you will soon see how you can tweak the AI in lots of ways to behave like you want.
Story, Objectives, Messages and More
[TODO]
Placing Items, Units and MoveTo Events
Placing initial units
You can place units for each side at the start quite easily, but it's not wholly obvious. In Events and Actions, there should be New Prestart Event listed. Double click it and you will get a map. There is a box in the top-roght that says Map, click on it and choose units. Then you can place units for the side inidicated in the box marked Side #
More on Dialogue
[TODO] assigning roles...
Player choices are an integral part of what makes campaigns in Wesnoth fun and interactive. To present the player of your campaign with a choice, you have to use events. Let's say that you've just finished a scenario and want to give the player a choice as to where to go next (giving the campaign replayability and diversity). First, you want to make sure that the message is triggered at the end of the scenario, so do the following in the events and actions editor (this is assuming that you win when you defeat all enemies - if your scenario has a different win condition, then you'll need to adjust the event type appropriately).
1. In the drop-down box at the top left of the screen, choose "event" from the list.
2. Click on the Create New button at the right and then click on the event in the list.
3. Change the event type by clicking on the drop-down box on the right and choose "enemies defeated" (**NOTE: I do not know what the "first time only" checkbox does)
4. Create a message as a sub under the event you just made and adjust the settings and content to what you want.
5. Now create an "option" as a sub under the message. Each option that you create will be a choice presented to the player. Give two (or more) places to go (like the Caverns of Chaos or the Wild Forest).
6. Under each option that you make, make another sub "command." Command is what makes the events dependent on the option, and without it, nothing will happen.
7. Under the each command, create a message sub announcing your decision. (optional)
8. Again under each command (not under the message) create a sub "endlevel." Under the first command, end the scenario in victory and choose the scenario where you want to go (they would obviously be the two scenarios the player had to choose from). The picture should show you what the final thing should look like:
As you can probably see, this can get a lot more open ended. The example I provided teaches a few other things as well as making choices, and more will be covered in this tutorial as development continues.
--Greywolfexcel 19:32, 13 June 2006 (CEST)
--Version 0.17
Tweaking AI
[TODO]
Some more Useful Events
[TODO] fakemove, removing units, giving gold to player, reacting to die events
Changing the recruits list in the event editor is probably one of the more important actions you need to know how to do in CampGen, especially since it adds variety and a whole host of plot implications you can explore. Fortunately, it is fairly easy. Let's say your hero and his band of followers have run into a group of dwarves that offer their services, and you want the player to be able to recruit dwarvish Fighters and Thunderers.
1. Create a new event and add actions that correspond to your player's interactions with the dwarves.
2. Under the event, create an "allow_recruits" sub. Open it with the edit button on the bottom (or just double-click). Now just click "Add" (making sure you are recruiting for side 1 - yourself) and scroll with the arrow keys to the Dwarvish Fighter and click on it. Do the same with the Dwarvish Thunderer.
3. You can delete any mistakes you've made by just clicking on the unit you accidentally selected and clicking the "Del" button on the bottom.
4. Finish it up and polish it! The picture below should give you an idea of how it's supposed to look:
Note that you can allow the enemy and allies to recruit units as well, giving you more plot/tactical options to consider. You can also disallow recruitment in the same fashion.
--Greywolfexcel 22:06, 13 June 2006 (CEST)
--Version 0.17
My first Unit
As of CampGen 0.24, the unit editor is not finished yet. But here's how you can add a most simple custom unit to your campaign. First, let's assume we have four pictures for it: gnome.png, gnome-attack.png and gnome-defend.png, which are 72x72 pictures of the unit. And gnome-portrait.png, a portrait for our gnome.
Now, in your campaign, go to the initial campaign screen, where you see a button labeled "Files". Click it. Then click on "Campaign specific units". A menu should pop up, with an entry "New Unit". Click it. Then double click the unnamed unit which appears. Now you are inside the unit editor. An alternative way to create a new unit is from the menu, under Data->New Unit.
In the unit editor, let's fill in some basic info:
- Name: Some name, e.g. "Gnome". The button labelled ... let's you copy an existing unit and start from that, but it's not recommended for now.
- Race: Here you can write the race of the unit. You can either create a new race (in the same way you created a new unit), or use an existing one. THe ... button lets you choose any existing race, for now let's use e.g. "dwarf".
- Movetype: Again, you can create your own, or use an existing. For now, let's use "dwarvishfoot".
- Gender: Choose male or female. Units with multiple genders can be created by using the "Variation" button - but that's not important right now.
- HP / MP: Fill in he hitpoints and movement points of the unit, e.g. "20 / 5".
- Alignement: Choose one of the three.
- Cost: How much the unit costs to recruit, e.g. "18".
- Description: Here goes the description of the unit as it will appear in the online help of Wesnoth.
- Default image: Click the image button, and choose the "gnome.png".
- Portrait: Click the big black button, and it will allow you to specify the "gnome-portrait.png" image.
- Usage: This is only important if the AI should use the unit, select what you think how the AI will want to use the unit.
Next, go to the Animation tab. A lof of things are not working yet here, but you need to at least define an attack for the unit. Click on New, then choose "attack" from the menu. Now select the attack in the list to the right. Type in a range for it, usually one of "melee" or "ranged". In our case "ranged" makes sense. Below type in a name, for example "Throw Stones". Next, click the image button, which allows setting the attack icon for this attack. Then choose the type, for example "impact". And most important, fill in the Damage and Number fields, for example 4 / 3, so our gnome will throw 3 stones, each with a damage of 4.
To make the unit look different, we need to give the attack also an animation. Click the "+" icon add the right to add an animation frame, and set it to our "gnome-attack.png". This creates an animation with only one frame - which should be good enough for our case.
Repeat the above to also fill in a melee attack, as a unit with only one attack is a bit boring.
And finally, also add a defense animation, with the "gnome-defend.png" as only frame.
Congratulations! You just created your first own unit. Add it to the recruit list of any side, and run a test game. The unit should be there and work, hopefully.
Advanced tricks
[TODO]
Note(s)
The official comment/suggestion thread is at http://www.wesnoth.org/forum/viewtopic.php?t=9698
The feature request/bug reporting system is at https://savannah.nongnu.org/bugs/?func=additem&group=campgen
