campaign stub: Campaign-How-To (A Simple Campaign)

Discussion and development of scenarios and campaigns for the game.

Moderator: Forum Moderators

R3000
Posts: 6
Joined: September 17th, 2011, 9:09 pm

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by R3000 »

Does anyone know a good tutorial for making a campaign? I was attempting to use this but it appears to have all gone away.
User avatar
artisticdude
Moderator Emeritus
Posts: 2424
Joined: December 15th, 2009, 12:37 pm
Location: Somewhere in the middle of everything

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by artisticdude »

The official wiki tutorial on creating single-player campaigns.

Slightly outdated, but it should teach you all you need to know to create a basic campaign. :)
"I'm never wrong. One time I thought I was wrong, but I was mistaken."
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Anonymissimus »

R3000 wrote:I was attempting to use this but it appears to have all gone away.
What do you mean ?
Actually, ASC itsself is intented to be "all you need to know/have". Since imho this is the easiest way of keeping it up-to-date (for me, or we who maintain the wiki and create wml).
But I get *zero* feedback despite ASC seems used a lot, so what do you miss ?
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
R3000
Posts: 6
Joined: September 17th, 2011, 9:09 pm

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by R3000 »

There is a link to download the simple campaign skeleton but it says there is nothing there (I just found it on the add-ons though.) Where can I find the file so I can edit?

Edit: I'm using a Mac
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Alarantalara »

http://wiki.wesnoth.org/EditingWesnoth# ... rectory.3F contains all the locations it could be.
R3000
Posts: 6
Joined: September 17th, 2011, 9:09 pm

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by R3000 »

Found it!!! Thanks for the help. Hopefully I'll be posting a campaign in the future :D
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Crendgrim »

I have a little question concerning conventions. In the wiki page ConventionsWML it is said that macros should be defined inside a folder called utils/ in the add-on directory. However, I saw many user made campaigns in the last time using a directory called macros/ and was confused where that came from. And then I saw that this is also done in ASC.
As ASC is meant to be a campaign with a perfect structure (if I understand its sense correctly) for beginners to adapt, this arises one small convention problem. So, the question is: How should things be done? Should macros be put inside a utils/ or rather inside a macros/ folder?
Either ASC or the wiki page needs to be changed, then.
UMC Story Images — Story images for your campaign!
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Anonymissimus »

Well, does this deserve unification ?
-There is absolutely nothing technically bad about calling the macros dir macros/.
-Looking at the conventions page, I anyway clearly violate the indentation rules since indentation spaces belong into the trashcan. It's just that esr imposed some rule upon the objecting majority of developers by creating wmlindent.
-There are notable campaigns using macros/ (After the Storm)
-Unification/consistency contradicts needed maximum variety of testcases. That is, perhaps by unifying this, a macros/ dir for macros does suddenly not work anymore although should due to a bug and it's not properly detected because all of mainline is using utils/ ? There's many similar issues with wmllint and other unifications. So unless support is actually removed/deprecated, let's not unify something.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Crendgrim »

Well, I thought mainly about new WML authors not being confused by too many different standards floating around.
UMC Story Images — Story images for your campaign!
User avatar
averyimaginativename
Posts: 245
Joined: August 21st, 2010, 12:40 pm
Location: /dev/null

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by averyimaginativename »

Anonymissimus wrote:Well, does this deserve unification ?
When my first _main.cfg didn't work, one of the first things I spotted was this discrepancy between the Wiki and ASC. Which one is right? Change the name of the folder, still doesn't work. Look at other add-ons. They've got this one in utils, and that one in macros. Let's try that. Hmm, still doesn't work. Much messing about later, and the error was, of course, something completely different (it wasn't even in the _main.cfg), but this is a needless source of confusion for newbies.

I understand and accept your point. However, experienced WMLers - especially those with complex campaigns - will split their macros up differently anyway. It's only newbie campaigns that would become homozygous. Existing campaigns would still serve as test cases.

If this difference is going to be kept, I think there should at least be a sentence or two added to the Wiki making it clear that directory structure is just convention and not requirement.
Wesnoth will only recognize a campaign as such if it is placed in a certain location and has a certain structure.
makes it sound as though these directory structures are set in stone.
UMC Story Images web gallery

On an indefinite Wesbreak for health reasons - please only try to get my attention for UMC story images website issues.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Anonymissimus »

And what about making it clear to newbies how the preprocessor works ? In ASC I write
{filepath} loads all files from filepath
This deserves some more explanation maybe, so the newbies understand that they only need to match the way they include a directory to where the directory is and how they name it in their file manager. And that there is actually no difference in including scenario, macro, util or terrain files.

This sentence from the wiki is actually wrong. An addon only needs to have a file named _main.cfg in the add-ons/Your_Addon/ dir. Everything else is up to the author.

I could also place some macro into the macros/ dir and reference it from the scenario, so it's clear that this works.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
Jamie
Posts: 48
Joined: October 30th, 2011, 5:08 pm

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Jamie »

The comments in ASC suggest running wesnoth from a console in order to see error messages. I thought I'd give that a try with Terminal on my Mac running Snow Leopard. But It's a little tricky on a Mac, so I want to share how it's done. The most straightforward way to do it is to open Terminal and type:
"/Applications/Wesnoth.app/Contents/MacOS/wesnoth"
with or without the quotation marks. If your BfW application is located somewhere other than the default location, you can also find the app, right-click it to "show package contents," navigate to the MacOS folder within and drag the 'wesnoth' file in that folder to the Terminal window. That will get the path into terminal without you having to type it. Press <Return> and the program should launch and display errors as described in the ASC file. (You might want to exit fullscreen so you can see what's going on.)

Thanks to Anonymissimus and opensourcejunkie for putting ACS together. It is very helpful.
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by octalot »

The terrain-graphics.cfg file does warn that it's not a good reference, but as it's a working example I tried to start there anyway.

I think these comments would improve it, but they're probably not clear enough either.

Code: Select all

# The ASC_SINGLE_HEX macro uses multi-hex terrain functionality to show an image that's slightly bigger than a single hex.
# If your terrain image fits within its hex, it's simpler to use the single-hex method (put the [image] tag inside the [tile])
Alternatively, would it be better to have a single-hex example and a multi-hex example? I could provide a patch, but am worried that I don't understand it well enough myself.
Currently updating the SurvivalXtreme Collection, and the SXC Pressure scenario. That's about a mermish necromancer, who's just found out that her Tentacles Of The Deep have been nerfed.
Anonymissimus
Inactive Developer
Posts: 2461
Joined: August 15th, 2008, 8:46 pm
Location: Germany

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by Anonymissimus »

I think having more than a single example for custom terrain is beyond the scope of this add-on...
I'm willing to exchange the existing example for a simpler one.
If I add your description and stuff, I should understand it. There is an excellent comprehensive terrain tutorial thread somewhere in this forum, written by Alarantalara.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml startersPlan Your Advancements: mp mod
The Earth's Gut: sp campaignSettlers of Wesnoth: mp scenarioWesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
User avatar
octalot
General Code Maintainer
Posts: 783
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: campaign stub: Campaign-How-To (A Simple Campaign)

Post by octalot »

Here's my simplified version (which needs the altered .png file from the attached zip).

In the .zip file, I've also renamed the terrain to ^Xzg , because the style guide recommends that UMC terrain ids should include at least one Y, y, Z or z. (And X for impassible, g for gate).

Adding the terrain can also be done as a one-liner using the core OVERLAY macro, but I think there's value in A Simple Campaign providing this code as a base to start hacking on.

Code: Select all

#textdomain wesnoth-A_Simple_Campaign

# This macro is for a terrain that fits on a single tile (and its graphics must do too, or the edges will be clipped).
# For more complex tiles, see the terrain tutorial thread: http://forums.wesnoth.org/viewtopic.php?f=21&t=34201

#define ASC_SINGLE_HEX TERRAIN_CODE FLAG TILE_IMAGE
        [terrain_graphics]
                [tile]
                        x=0
                        y=0
                        type={TERRAIN_CODE}
                        set_no_flag={FLAG}
                        [image]
                                name={TILE_IMAGE}
                        [/image]
                [/tile]
        [/terrain_graphics]
#enddef

# This custom terrain is an overlay, because the terrain-type starts with ^
# The text "overlay" is just to stop other overlays drawing on the same hex

{ASC_SINGLE_HEX (*^scG\) "overlay" "door-sw.png"}

# Here's a simpler way to do the same thing, using a core macro:
# {OVERLAY *^scG\ (door-sw)}

#undef ASC_SINGLE_HEX
And an extra bit of documentation for something that I took a while to work out:

Code: Select all

--- a/A_Simple_Campaign/terrain/terrain-definitions.cfg
+++ b/A_Simple_Campaign/terrain/terrain-definitions.cfg
@@ -1,6 +1,7 @@
 #textdomain wesnoth-A_Simple_Campaign
 
 [terrain_type]
+       # symbol_image is the image shown in the editor's tile palette.
        # This image is looked for in the terrain/ subdirectory of the images/ subdirectories specified by all active [binary_paths]. These are data/core/ (always active) and data/add-ons/A_Simple_Campaign/ for this campaign.
        # ".." however tells to step one directory up (from terrain/ into images/) (and then into images/scenery).
        symbol_image="../scenery/gate-rusty-sw"
Attachments
ASC_changes_from_0_2_7.zip
(6.39 KiB) Downloaded 342 times
Currently updating the SurvivalXtreme Collection, and the SXC Pressure scenario. That's about a mermish necromancer, who's just found out that her Tentacles Of The Deep have been nerfed.
Post Reply