Where to ask?

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
LienRag
Posts: 8
Joined: September 24th, 2018, 4:03 pm

Where to ask?

Post by LienRag » October 13th, 2018, 11:15 pm

I've read the "sticky" threads of Scenario&Campaign Development subforum but didn't find where one is supposed to ask questions about scenario and campaign development in general (like when the wiki leaves holes in its explanations and how-to's)?

My first problem right now is about relative and absolute paths; when to use which?
I tried to copy HTTT to the add-on folder I created per the Wiki's instructions, but BfW can't find my scenarios when I change the paths in the main.cfg (and of course if I don't change it it looks in the campaign folder, not the add-on one).

User avatar
Pentarctagon
Forum Administrator
Posts: 3543
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Where to ask?

Post by Pentarctagon » October 14th, 2018, 12:31 am

Moved to WML Workshop, since this would relate to the scripting of the scenario(s)/campaign.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Heindal
Posts: 893
Joined: August 11th, 2011, 9:25 pm
Location: Germany

Re: Where to ask?

Post by Heindal » October 14th, 2018, 10:14 am

It took me a while to find this out. Reading through the wiki, source code of other campaigns.
So this might be helpful for you:

After defining your campaign, you will have to add the paths to your campaign. These are always relative paths, as add-ons are saved in different locations, based on your settings while installing or your operating system.

E.g. in windows this can be C:\Users\YOURNAME\Documents\my games\Wesnoth1.14\data\add-ons

or

C:\games\wesnoth\userdata\data\add-ons

when C:\games\wesnoth is the path where you have installed the game.
When installing the game via Steam, the add-ons will always be saved in the C:\Users\YOURNAME\Documents, which is nasty.


So after [/campaign] you need to define the paths like this:

#ifdef CAMPAIGN_YourCampaignName

[binary_path]
path=data/add-ons/YourCampaignName
[/binary_path]
{~add-ons/YourCampaignName/utils}
{~add-ons/YourCampaignName/scenarios}
{~add-ons/YourCampaignName/terrain}

[+units]
{~add-ons/YourCampaignName/units}
{~add-ons/YourCampaignName/units/outlaws}
{~add-ons/YourCampaignName/units/projectiles}
{~add-ons/YourCampaignName/units/Dark_Blood_Alliance}
{~add-ons/YourCampaignName/units/animals}
{~add-ons/YourCampaignName/units/mechanic}
{~add-ons/YourCampaignName/units/summons}
{~add-ons/YourCampaignName/units/undeadpirates}
{~add-ons/YourCampaignName/units/pirates}
{~add-ons/YourCampaignName/units/khalifate}
{~add-ons/YourCampaignName/units/orcs}
{~add-ons/YourCampaignName/units/naga}
{~add-ons/YourCampaignName/units/heroes}
{~add-ons/YourCampaignName/units/epic}
{~add-ons/YourCampaignName/units/south-seas}
{~add-ons/YourCampaignName/units/phantom}
{~add-ons/YourCampaignName/units/wolves}
{~add-ons/YourCampaignName/units/deathelves}
{~add-ons/YourCampaignName/units/dwarves}
[/units]

#endif

As you see, each new folder you want to use in your campaign has to defined.
To define units is not enough. However you don't have to define the "images".

If you want to use images only used in your campaign, just add an images folder and refer to your images.
The images folder hasn't to be referred here.
The future belongs to those, who believe in the beauty of their dreams.
Developer of: Trapped, Five Fates, Strange Legacy, Epical
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses

User avatar
beetlenaut
Developer
Posts: 2217
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Where to ask?

Post by beetlenaut » October 15th, 2018, 5:52 am

LienRag wrote:
October 13th, 2018, 11:15 pm
BfW can't find my scenarios
I'm not sure this is a problem with relative vs. absolute paths. If there is an error in the campaign, BfW will refuse to load it, and the game will report that the scenarios can't be found. That might be the actual problem. Maybe you have a typo in your _main.cfg file. If you post it, and there is an error, someone will spot it pretty fast.

To see if you really have a path problem, you could download any add-on on the server and take a look at the structure--where they used "~add-ons" and where they used "data/add-ons/Campaign_Folder"
Campaigns: Dead Water
The Founding of Borstep
Secrets of the Ancients

Post Reply