It is currently February 9th, 2010, 2:50 pm

All times are UTC




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [objectives] patch: allows changing objectives mid-game
PostPosted: March 16th, 2005, 8:27 pm 
Developer
Offline

Joined: September 28th, 2004, 10:20 am
Posts: 838
I posted a patch to implement Sanna's [objectives] WML tag to Savannah: http://savannah.nongnu.org/patch/index. ... em_id=3789

This tag allows setting of scenario objectives as events:
Code: [ Select all ]
[scenario]
[event]
   name=prestart
   [objectives]
      summary= _ "Follow instructions"
      [objective]
         description= _ "Move one hex to the north"
         condition=win
      [/objective]
      [objective]
         description= _ "Death of Superelf"
         condition=lose
      [/objective]
   [/objectives]
[/event]
[/scenario]
This tag is backwards compatible with the existing usage:
Code: [ Select all ]
[scenario]
   objectives= _ "Follow instructions
Victory:
@Move one hex to the north
Defeat:
#Death of Superelf"
[/scenario]
Note the special colour indicators and the need to have the string running across newlines. The new tag simply overwrites the value of the string that stores the objectives. Using [objectives] tags, the scenario objectives can be changed as many times as the scenario designer wishes: randomly, every few turns, every step, when reaching a specific hex, on attack, or any other event.

Here is how it can be used in a moveto event:
Code: [ Select all ]
[event]
   name=moveto
   [filter]
      side=1
      x=6
      y=7
   [/filter]

   [objectives]
      summary= _ "Back to the boring stuff"
      show=yes
      victory_string= _ "Win:"
      defeat_string= _ "Lose:"
      [objective]
         description= _ "Defeat all enemy leaders"
         condition=win
      [/objective]
      [objective]
         description= _ "Death of Superelf"
         condition=lose
      [/objective]
   [/objectives]
[/event]


Summary of features:
    requires no changes to existing campaigns,
    fills in the colours for defeat and victory conditions automatically,
    can display objectives when they change (thanks to Invisible Philosopher for suggesting),
    eases translations, and
    adds a "quick summary" line to objectives.


Several campaign developers use hacks to change objectives mid-scenario. Turin has mentioned having a use for changing objectives, but is this patch worth including in the mainline distribution? If you think so, please state your opinion here, or even better, help to improve the patch so it doesn't muck around quite so much with global data structures. Right now the patch is languishing without any serious developer review, and needs to be updated frequently to keep up with CVS.

_________________
This quote is not attributable to Antoine de Saint-Exupéry.


Top
 Profile  
 
 Post subject:
PostPosted: March 16th, 2005, 9:39 pm 
Forum Regular
Offline

Joined: May 12th, 2004, 12:35 am
Posts: 5283
Location: Dulles, VA
Awesome. Is the summary key displayed in addition to the "OBJECTIVES" line or does it replace it? Sounds like it is in addition.

_________________
Hope springs eternal.
Wesnoth acronym guide.


Top
 Profile  
 
 Post subject:
PostPosted: March 16th, 2005, 10:48 pm 
Forum Regular
Offline

Joined: August 30th, 2004, 8:07 pm
Posts: 498
Location: Virginia, USA
I for one would love to see this in the main line. There are three (possibly four) scenarios in The South Guard where I'd use it.

- b.

_________________
La perfection est atteinte non quand il ne reste rien à ajouter, mais quand il ne reste rien à enlever. - Antoine de Saint Exupery (of course)


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 12:55 am 
Forum Regular
Offline

Joined: June 6th, 2004, 3:29 pm
Posts: 1766
Location: Weldyn, Wesnoth
I'd like to see this make CVS too, because I will be able to have Kogw appear on turn 3 (Blue River, FtF), like I had planned.

_________________
"ILLEGITIMIS NON CARBORUNDUM"

Father of the Drake Campaign
http://www.wesnoth.org/wiki/FlightToFreedom
hosted on campaign server


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 5:00 am 
Developer
Offline

Joined: December 22nd, 2003, 4:17 am
Posts: 2258
Location: Boston, MA
This would be awesome. If this gets implemented I could use it a plethora of times in my campaign. Thanks so much for making the patch.

_________________
Creator of Under the Burning Suns


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 9:27 pm 
Developer
Offline

Joined: March 21st, 2004, 2:42 pm
Posts: 461
Location: Germany
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?

Greetings, Fabi


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 10:03 pm 
Forum Regular
Offline

Joined: March 26th, 2004, 10:58 pm
Posts: 1991
Location: New York, New York
fabi wrote:
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?

Greetings, Fabi


Mid-scenario cutscenes? I love that idea.

_________________
"Pure logic is the ruin of the spirit." - Antoine de Saint-Exupéry


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 10:41 pm 
Developer
Offline

Joined: March 21st, 2004, 2:42 pm
Posts: 461
Location: Germany
Sangel wrote:
fabi wrote:
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?

Greetings, Fabi


Mid-scenario cutscenes? I love that idea.

Yes, i had this in mind, but it would have another side effect :

Cutscenes could be taken out of a wml pseudo database.

Greetings, Fabi


Top
 Profile  
 
 Post subject:
PostPosted: March 17th, 2005, 10:56 pm 
Lord of the East
User avatar
Offline

Joined: January 11th, 2004, 7:17 pm
Posts: 11670
Location: Texas
fabi wrote:
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?

Greetings, Fabi

This would also be useful, but it would probably be a different patch, not an extension.

--------

Many campaign developers could use this, and almost all agree it is a good idea. I think it should be implemented as soon as practical.

_________________
For I am Turin Turambar - Master of Doom, by doom mastered. On Wesbreak. Please don't PM me unless you have a question only I can answer.
And I hate stupid people.
The World of Orbivm


Top
 Profile WWW  
 
 Post subject:
PostPosted: March 18th, 2005, 1:44 am 
Forum Regular
Offline

Joined: June 6th, 2004, 3:29 pm
Posts: 1766
Location: Weldyn, Wesnoth
Sangel wrote:
fabi wrote:
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?

Greetings, Fabi


Mid-scenario cutscenes? I love that idea.
Me too.

_________________
"ILLEGITIMIS NON CARBORUNDUM"

Father of the Drake Campaign
http://www.wesnoth.org/wiki/FlightToFreedom
hosted on campaign server


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2005, 6:34 pm 
Developer
Offline

Joined: September 28th, 2004, 10:20 am
Posts: 838
fabi wrote:
Could this patch be enhanced, to use another tag, normally only available at
scenario start:
[story] in an event ?
You seem to be asking for more of the start-of-scenario initializations to be made into events. Perhaps you could start a new thread to discuss that -- seems to be a worthwhile idea, since (as I demonstrate with [objectives]) they can be put into a name=prestart event to achieve the same effect as the current start-of-scenario settings. Being more general, this would probably also simplify the parsing code.

_________________
This quote is not attributable to Antoine de Saint-Exupéry.


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2005, 6:42 pm 
Developer
Offline

Joined: September 28th, 2004, 10:20 am
Posts: 838
scott wrote:
Is the summary key displayed in addition to the "OBJECTIVES" line or does it replace it? Sounds like it is in addition.
The summary is concatenated with the victory and defeat objectives and the result put into the same place that the current objectives= attribute is stored. Forcemstr and Ayin have both taken a serious look at this code, but the exact location in the config data structure of where the objectives= attribute should be stored is currently under debate. It looks like it will be moved to a different place, once Ayin finds time to look at this again.

_________________
This quote is not attributable to Antoine de Saint-Exupéry.


Top
 Profile  
 
 Post subject:
PostPosted: March 19th, 2005, 1:32 pm 
Developer
Offline

Joined: March 30th, 2004, 4:45 pm
Posts: 294
Location: Nîmes, France
ott: Okay, a modified version of your patch has been commited, along with the ability to define per-side objectives.

Code: [ Select all ]
   //provide a means of specifying win/loss conditions:
   // [event]
   // name=prestart
   // [objectives]
   //   side=1
   //   summary="Escape the forest alive"
   //   victory_string="Victory:"
   //   defeat_string="Defeat:"
   //   [objective]
   //     condition=win
   //     description="Defeat all enemies"
   //   [/objective]
   //   [objective]
   //     description="Death of Konrad"
   //     condition=loss
   //   [/objective]
   // [/objectives]
   // [/event]
   //instead of the current (but still supported):
   // objectives= _ "
   // Victory:
   // @Move Konrad to the signpost in the north-west
   // Defeat:
   // #Death of Konrad
   // #Death of Delfador
   // #Turns run out"
   //
   // If side is set to 0, the new objectives are added to each player.
   //
   // The new objectives will be automatically displayed, but only to the
   // player whose objectives did change, and only when it's this player's
   // turn.


The old way of defining objectives, which is to supply an "objectives=" value into the level, is still supported, but is considered obsolete, in favour of using prestart events setting objectives. The old way of setting objectives sets them for all sides.

[objective] events replace the current objectives, and do not merge them.

When the objectives of a player change during his turn, an "objectives" dialog automatically appears.

When the objectives of a player A change during player B's turn, the "objectives" dialog appear only to player A when it's his turn.

Objective changes for other players do never appear (those are, however, sent to clients, so cheaters may see them anyway.)


Top
 Profile WWW  
 
 Post subject:
PostPosted: March 19th, 2005, 2:04 pm 
Forum Regular
Offline

Joined: May 12th, 2004, 12:35 am
Posts: 5283
Location: Dulles, VA
Does side take a list?

For multiple win or loss conditions, do you use multiple [objective] tags or make a multiline string?

edit:
Can you leave out victory_string, defeat_string, and summary and get default values of "Victory:" "Defeat:" and ""?
Or any other keys for that matter?
side?

_________________
Hope springs eternal.
Wesnoth acronym guide.


Top
 Profile  
 
 Post subject:
PostPosted: March 19th, 2005, 2:48 pm 
Developer
Offline

Joined: March 30th, 2004, 4:45 pm
Posts: 294
Location: Nîmes, France
scott wrote:
Does side take a list?

For multiple win or loss conditions, do you use multiple [objective] tags or make a multiline string?


You may do either, but using multiple [objective] tags is strongly recommended: this allows re-using strings, and lessens the work of translators.

scott wrote:
edit:
Can you leave out victory_string, defeat_string, and summary and get default values of "Victory:" "Defeat:" and ""?
Or any other keys for that matter?
side?


If you do not define them, they have the default values. My example was quite bad, indeed: as they are left to default values, they should not have been defined.


Top
 Profile WWW  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group