Different starting scenario based on campaign difficulty

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.
Post Reply
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Different starting scenario based on campaign difficulty

Post by ILikeProgramming »

A while back, I wrote a piece of code that makes a campaign start on a diffirent scenario based on its difficulty level. Here is the code:

Code: Select all

[scenario]
id=scenario_selection
name="Please wait..."
turns=1
map_data="Gg, Gg, Gg, Gg, Gg
Gg, Gg, Gg, Gg, Gg
Gg, Gg, Gg, Gg, Gg
Gg, Gg, Gg, Gg, Gg
Gg, Gg, Gg, Gg, Gg"
next_scenario=01_The_Elves_Besieged


  [event]
  name=prestart
    [endlevel]
    result=continue_no_save

    #ifdef HARD
    next_scenario=02_Blackwater_Port
    #endif

    [/endlevel]
  [/event]	

[/scenario]
This code works fine with 1.3.6 and many previous versions. On 1.3.7, however, it crashes the game. What is the problem?

(Attached is a mod of httt that illustrates this. It works fine on 1.3.6, but not on 1.3.7)
Attachments
sample_campaign.cfg
Goes in userdata/data/campaigns
(1.32 KiB) Downloaded 221 times
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

I tried you file in SVN trunk and it worked fine for both medium and hard difficulty. Whatever the bug was in 1.3.7, it appears to have already been fixed.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply