Where to ask?

The place to post your WML questions and answers.

Moderator: Forum Moderators

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.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Where to ask?

Post by LienRag »

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
Project Manager
Posts: 5496
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Where to ask?

Post by Pentarctagon »

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: 1343
Joined: August 11th, 2011, 9:25 pm
Location: Germany, Karlsruhe
Contact:

Re: Where to ask?

Post by Heindal »

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, UR Epic Era
Dungeonmasters of Wesnoth, Wild Peasants vs Devouring Corpses, Dwarf Dwarfson Dwarvenminer
User avatar
beetlenaut
Developer
Posts: 2813
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Where to ask?

Post by beetlenaut »

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,
and WML Guide
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

It finally worked using relative paths, so thanks to all, but surprisingly it worked only when I put the line {~add-ons/HTTT_LREdition/scenarios} after the [/units], not when this line was before the [+units].

Such unpredictable behaviour should be explained somewhere in the tutorials, imho.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

I tried to test adding loyal 0-level characters in a scenario, and they appeared but they were not loyal.
Is it normal or did I do something wrong?
User avatar
beetlenaut
Developer
Posts: 2813
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Where to ask?

Post by beetlenaut »

Loyal won't have any effect on a level-0 unit because they don't pay any upkeep anyway, but "loyal" should show up in their list of traits on the side panel. If it doesn't, there is a bug somewhere.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Where to ask?

Post by josteph »

When you ask such questions you need to show your code so we know what you've already tried.

To make units loyal there are a few separate macros, one that adds the trait and modifies upkeep, one that adds the ring on the orb. Look at how mainline campaigns spawn such units, for example TSG S1 and S2.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

You are right, here it is (inside an event, and the event triggers and the unit are created, but with no traits).

Code: Select all

[unit]
            id=Tamas
            name= _ "Tamas"
            side=1
            type=Ruffian
            x=20
            y=10
            
                {TRAIT_LOYAL}
                {TRAIT_STRONG}
[/unit]
Yes I did look at how it was done elsewhere, but I get confused by the existence of multiples ways of doing it: {TRAIT_LOYAL}, {IS_LOYAL}, {NAMED_LOYAL_UNIT}, so I thought using one that seemed to work for other scenarios should work in mine?

(and yes I get now that {IS_LOYAL} concerns the orb, it doesn't give the trait to the unit)
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

Oh, and I've read the "WML for Beginners" 12-parts, and I found the CLEAR_FOG macro (for another part of the scenario) but I can't find anything to clear the Shroud for a limited location?
User avatar
James_The_Invisible
Posts: 533
Joined: October 28th, 2012, 1:58 pm
Location: Somewhere in the Northlands, fighting dark forces
Contact:

Re: Where to ask?

Post by James_The_Invisible »

There is remove_shroud tag for this.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Where to ask?

Post by josteph »

LienRag wrote: October 29th, 2018, 7:02 pm You are right, here it is (inside an event, and the event triggers and the unit are created, but with no traits).

Code: Select all

[unit]
            id=Tamas
            name= _ "Tamas"
            side=1
            type=Ruffian
            x=20
            y=10
            
                {TRAIT_LOYAL}
                {TRAIT_STRONG}
[/unit]
You're missing a [modifications] tag. See how the mainline campaigns use TRAIT_LOYAL for examples.

The fact that unexpected tags are ignored without a warning is often annoying in this way. I wonder if there couldn't be a --wml-debug mode that prints log messages about every tag that was parsed but not used.
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

Thanks!
LienRag
Posts: 127
Joined: September 24th, 2018, 4:03 pm

Re: Where to ask?

Post by LienRag »

Working on maps with the map editor I find some tiles named "overlay", and I can't find what they mean?
User avatar
beetlenaut
Developer
Posts: 2813
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Where to ask?

Post by beetlenaut »

The overlays are invisible in the game, but they change the properties of the tile they are on. For example, the village overlay makes any tile into a village without changing the way the tile looks.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply