Help: my campaign always crashes
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.
Help: my campaign always crashes
I can't figure out the reason. It is not the scenario's fault, because when I made the second scenario the first, it still crashes. And in the first scenario, I commented everything out(in hope to find the error then)
The paths to include the scenarios seem right. Can there be other reasons?
The paths to include the scenarios seem right. Can there be other reasons?
First read, then think. Read again, think again. And then post!
By crash do you mean the game quits or the preprocessor give you errors?
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
The game quits, I don't get errors by the preprocessor.scott wrote:By crash do you mean the game quits or the preprocessor give you errors?
BTW, I don't like the new behavior of the game to quit when an error appears. I liked it more when I got back to the main menu. Is it to avoid freezes or harder crashes?
(even if I don't have to quit wesnoth to correct the bug now

First read, then think. Read again, think again. And then post!
The only time I know when a campaign can cause a crash like that is with text encoding and weird UTF character combinations.
For example, I wanted to get the game to display a right arrow character, which is accomplished with a ü and a square root symbol, but those characters together caused the game to crash every time because of how they were encoded. You may have a stray character or something encoded weirdly. If it's not a text issue, I don't know what it would be. I would re-write the scenario from scratch.
For example, I wanted to get the game to display a right arrow character, which is accomplished with a ü and a square root symbol, but those characters together caused the game to crash every time because of how they were encoded. You may have a stray character or something encoded weirdly. If it's not a text issue, I don't know what it would be. I would re-write the scenario from scratch.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
Remove half of the code, check if it still crashes. If yes, then remove another half, test if it crashes, and so on, until you find the spot that makes it crash. Then just go through that spot with plenty of thought and see how it links to other parts of the code (since the error isn't usually on the line that seems to cause it), and you should the problem eventually.
That's what I tried before. Because it also crashed when I took another scenario as the first one, I suspect that the campaign file is not alright.
It might be a bug too, should I try again with the next version? (I use 1.1.2, and decided to download 1.2)
Code: Select all
[campaign]
id=campaign_scout
icon=elvish-rider-attack.png
image=elvish-scout-moving.png
name=_"Scout"
#first_scenario=undead_attack
first_scenario=prologue
difficulties=EASY,NORMAL,HARD
difficulty_descriptions="&elvish-scout.png=Scout=(easiest);*&elvish-rider.png=Rider;&elvish-outrider.png=Outrider=(hardest)"
define=CAMPAIGN_SCOUT
description= _ "Eldromir,a elvish scout is sent to the green isle by the elven Kali'an because the elves want to steal the ruby of fire from the undead lords. The storyline isn't changed because he doesn't get the ruby in the end.
Play to find it out..."
[/campaign]
#ifdef CAMPAIGN_SCOUT
[units]
{@campaigns/Scout/units}
[/units]
{@campaigns/Scout/utils/main.cfg}
{@campaigns/Scout}
{@campaigns/Scout/scenarios}
#endif
First read, then think. Read again, think again. And then post!
You want to use [+units] not [units]. There might be more, but that jumped out at me. I always use the MENU_IMG_TXT2 macro so I don't know the correct syntax for the difficulty descriptions off the top of my head, but you might double check that too.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
I would say start with this and add keys until it breaks. However, it's possible something changed in another file somewhere completely unrelated (like you installed an add-on) that is causing problems. If you want to PM me the files you're using I can test them out on this end.
Code: Select all
[campaign]
id=campaign_scout
name= _ "Scout"
first_scenario=prologue
define=CAMPAIGN_SCOUT
[/campaign]
#ifdef CAMPAIGN_SCOUT
[binary_path]
path=data/campaigns/Scout
[/binary_path]
[+units]
{@campaigns/Scout/units}
[/units]
{@campaigns/Scout/utils}
{@campaigns/Scout/scenarios}
#endif
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.
I can get it to show up on the menu with what I suggested, but I can't get it to load without the 2 difficulty keys.toms wrote:With your change it doesn't show up in the menu at all.
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.