Scenario doesn't load (details provided)

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
User avatar
Lord-Knightmare
Forum Regular
Posts: 1156
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Scenario doesn't load (details provided)

Post by Lord-Knightmare »

Hello, I need help with a problem:

On loading a new recently-coded scenario, I encountered a bug:
Screen Shot 2014-06-11 at 23.08.37.png
The cause of the bug was this line:

Code: Select all

{FORCE_CHANCE_TO_HIT side=1,2,8,9,10,11,12 id="Devan" 0 (
        [variable]
            name=turn_number
            greater_than=1
        [/variable]
    )}
I removed it and then reloaded the save file and astonishingly, Wesnoth crashed.
I carried out the same procedure with launching Wesnoth from Terminal and got this:

Code: Select all

Wesnoth(2337,0xacda6a28) malloc: *** mmap(size=536870912) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Wesnoth(2337,0xacda6a28) malloc: *** mmap(size=143360) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Wesnoth(2337,0xacda6a28) malloc: *** mmap(size=268582912) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Ran out of memory. Aborted.
My campaign repository
It's dependency
The save file:
TLB-3-Retribution.gz
(61.54 KiB) Downloaded 51 times
Link to the scenario file that caused the error.

User avatar
Dugi
Posts: 4957
Joined: July 22nd, 2010, 10:29 am
Location: Carpathian Mountains
Contact:

Re: Scenario doesn't load (details provided)

Post by Dugi »

I haven't looked into it properly, but do you remember that nested quoted string problems (quotation mark missing somewhere) is usually reported in a completely different line? FORCE_CHANCE_TO_HIT macro invocation is unlikely to be the cause, because it looks correct and the game crashes even without it (the malloc problem from terminal looks like some sort of obscure broken cycle, probably something got stuck while loading the WML code). Aren't you using a syntax highlighter that marks the places that are in quotation marks? It's excellent to find these problems.

If you still can't find it, I recommend this procedure, it never fails.

User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Scenario doesn't load (details provided)

Post by zookeeper »

Well, there's a missing closing quote on line 205.

User avatar
Lord-Knightmare
Forum Regular
Posts: 1156
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Scenario doesn't load (details provided)

Post by Lord-Knightmare »

@zookeeper: I fixed that, loaded the scenario and got this:
Screen Shot 2014-06-11 at 23.08.37.png
Removed that FORCED_CHANCE_TO_HIT macro and then reloaded. This time I got another error:
Screen Shot 2014-06-12 at 17.19.48.png
Removed those #ifver WESNOTH_VERSION and the second #endif from that file and then reloaded the same file. This time the game crashed without an error message.

@Dugi: That sounds like a good method. I shall try it out and let you guys know what is actually behind this.

EDIT: Tried it out and found the corrupted code:

Code: Select all

{ON_SIGHTING One 1 id="Devan" (
        [message]
            speaker="Fardin"
            message= _ "Hey, everybody, that accursed demon lord is on that floating castle!"
        [/message]
        [message]
            speaker="Jahin"
            message= _ "What is the matter, Devan? Are you too cowardice to face me in direct combat?"
        [/message]
        [message]
            speaker="Devan"
            message= _ "Jahin of Irdya, I am astonished that you have arrived here at the very moment I was summoning an entire army to destroy you!"
        [/message]
        [message]
            speaker='Rharcyn"
            message= _ "Jahin, what should we do? We cannot reach him and our aerial forces are insufficient for battle against him."
        [/message]
        [message]
            speaker="Jahin"
            message= _ "Rharcyn, I know that he is an inaccessible location and thus, we don't have to attack him at all. Our main goal is to close this portal and in doing that, we send Devan away for good."
        [/message]
    )}
The rest of scenario had bugs, but I have already fixed them.

User avatar
Iris
Site Administrator
Posts: 6692
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Scenario doesn't load (details provided)

Post by Iris »

This is kind of off-topic, but...

Is there a particular reason you are posting screenshots of the error message instead of using the convenient Copy button in it and pasting the resulting text? As the author of the relevant code, I would like to know if there’s an issue with the dialog on platforms other than Linux and Windows (besides the obvious issue with the add-on name not being displayed like it should for some reason — do you have an _info.cfg file sitting in the add-on dir that doesn’t have a title= attribute?).

EDIT: Some quick testing revealed that the add-on name indeed isn’t displayed for that reason and I have committed a fix to both master and 1.12 accordingly. Please confirm if my suspicion was correct.
Last edited by Iris on June 13th, 2014, 6:42 am, edited 1 time in total.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14).

User avatar
Lord-Knightmare
Forum Regular
Posts: 1156
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Scenario doesn't load (details provided)

Post by Lord-Knightmare »

shadowm wrote: Is there a particular reason you are posting screenshots of the error message instead of using the convenient Copy button in it and pasting the resulting text?
Wait, there was a Copy button...? :augh: :doh: :shock:
As the author of the relevant code, I would like to know if there’s an issue with the dialog on platforms other than Linux and Windows (besides the obvious issue with the add-on name not being displayed like it should for some reason — do you have an _info.cfg file sitting in the add-on dir that doesn’t have a title= attribute?).
Yes, the _info.cfg file of my add-on does not have a title= attribute.
EDIT: Some quick testing revealed that the add-on name indeed isn’t displayed for that reason and I have committed a fix to both master and 1.12 accordingly. Please confirm if my suspicion was correct.
Yes, your suspicion was correct. Thank you for fixing that. :D

User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: Scenario doesn't load (details provided)

Post by 8680 »

Lord-Knightmare wrote:Wait, there was a Copy button...? :augh: :doh: :shock:
Yes, it’s the button with the “two pages of paper” icon. Unfortunately, this “copy” icon, while apparently standard in the graphical user interfaces of (at least) Microsoft Windows and Android, does not appear to be used in graphical user interfaces native to (at least) your computer’s operating system.

Post Reply