Difference between revisions of "User:Dlr365"

From The Battle for Wesnoth Wiki
([endlevel] giving different results to different sides)
([endlevel] giving different results to different sides)
Line 5: Line 5:
 
=== Current ===
 
=== Current ===
 
==== [endlevel] giving different results to different sides ====
 
==== [endlevel] giving different results to different sides ====
Allows specific sides to be issued victory/defeat in multiplayer, instead of everyone getting the same.  See [http://gna.org/bugs/index.php?4960 bug#4960], [https://gna.org/patch/?1032 patch#1032].
+
Allows specific sides to be issued specific results in multiplayer, instead of everyone getting the same result.  See [http://gna.org/bugs/index.php?4960 bug#4960], [https://gna.org/patch/?1032 patch#1032].
  
If either [victory] or [defeat] tags are found within an [endlevel] tag, the normal ''result='' key will be ignored.  Any sides who are not given a specific [victory] or [defeat] are given a "Game Over" message(includes observers) ''(future: give a summary of the victories/defeats)''.
+
If [result] tags are found within an [endlevel] tag, the normal ''result='' key will be ignored.  If ''summary=yes'' is specified in the [endlevel] tag, then instead of specific victory/defeat messages for only local players, each player is shown the victory/defeat status of all sides.  Any sides who are not given a specific [result] (including observers) are either shown a summary or nothing, and their result is defaulted to ''continue''.
  
 
Example WML syntax:
 
Example WML syntax:
 
  [endlevel]
 
  [endlevel]
 +
 
   next_scenario=
 
   next_scenario=
   bonus=
+
  carryover_percentage=      {this acts as the default for all [victory] tags}
+
   bonus=                     {these are the defaults for all [result] tags}
   carryover_add=             {also default for [victory] tags}
+
  carryover_percentage=
   [victory]
+
   carryover_add=
 +
 +
  summary=                  {controls whether players are shown a summary of all sides, or just their local victory/defeat messages}
 +
 +
   [result]
 
     side=1
 
     side=1
   [/victory]
+
    outcome=victory          {may be victory, defeat, continue, continue_no_save}
   [victory]
+
   [/result]
 +
 +
   [result]
 
     side=4
 
     side=4
     carryover_percentage= {can override the defaults}
+
    outcome=victory
 +
     carryover_percentage=   {can override the defaults}
 
     carryover_add=
 
     carryover_add=
   [defeat]
+
   [/result]
 +
 +
  [result]
 +
    outcome=defeat
 
     side=2,3
 
     side=2,3
   [/defeat]
+
   [/result]
 +
 
  [/endlevel]
 
  [/endlevel]
 
This will issue a victory message for sides 1 and 4, and a defeat message for sides 2 and 3.  Side 1 and 4 will have different carryover amounts.
 
This will issue a victory message for sides 1 and 4, and a defeat message for sides 2 and 3.  Side 1 and 4 will have different carryover amounts.
  
Issues with current implementation:
+
Further discussion needed:
* ''name=victory'' and ''name=defeat'' events are currently ignored
+
* ''name=victory'' and ''name=defeat'' events are currently ignored when using [result] tags (possibly need to re-structure the way these events are handled...)
* only supports [victory] and [defeat]... not sure if [continue] or [continue_no_save] tags would make sense....
+
* could the default for ''summary'' be controlled by a menu option / preference? to allow players to always see a summary...
  
 
=== Need More Thought/Discussion ===
 
=== Need More Thought/Discussion ===

Revision as of 09:02, 6 April 2008

Works in Progress

GSoC Application

I plan to re-write the map editor. (Application Wiki Page)

Current

[endlevel] giving different results to different sides

Allows specific sides to be issued specific results in multiplayer, instead of everyone getting the same result. See bug#4960, patch#1032.

If [result] tags are found within an [endlevel] tag, the normal result= key will be ignored. If summary=yes is specified in the [endlevel] tag, then instead of specific victory/defeat messages for only local players, each player is shown the victory/defeat status of all sides. Any sides who are not given a specific [result] (including observers) are either shown a summary or nothing, and their result is defaulted to continue.

Example WML syntax:

[endlevel]

  next_scenario=

  bonus=                     {these are the defaults for all [result] tags}
  carryover_percentage=
  carryover_add=

  summary=                   {controls whether players are shown a summary of all sides, or just their local victory/defeat messages}

  [result]
    side=1
    outcome=victory          {may be victory, defeat, continue, continue_no_save}
  [/result]

  [result]
    side=4
    outcome=victory
    carryover_percentage=    {can override the defaults}
    carryover_add=
  [/result]

  [result]
    outcome=defeat
    side=2,3
  [/result]

[/endlevel]

This will issue a victory message for sides 1 and 4, and a defeat message for sides 2 and 3. Side 1 and 4 will have different carryover amounts.

Further discussion needed:

  • name=victory and name=defeat events are currently ignored when using [result] tags (possibly need to re-structure the way these events are handled...)
  • could the default for summary be controlled by a menu option / preference? to allow players to always see a summary...

Need More Thought/Discussion

[endlevel] [result] tag

  • The current implementation has a few key issues still... see above for problems/fix ideas... further ideas/discussion will go here.
  • Want to add support for a [summary] tag that simply shows the results of the [victory] and [defeat] tags to observers (or specific sides).

[result] -- new DirectActionWML

This tag would allow scenario authors to issue victory/defeat to specific sides from within events, without the scenario necessarily ending (if it makes sense for it to continue).

Possible Implementation
  • The following keys are valid:
    • endlevel : this key specifies if the level should be ended. Can be either yes or no. Defaults to yes. The following keys may be used if endlevel=yes:
      • next_scenario : the ID of the next scenario that is to be played. Default specified in [scenario] tag.
      • default_result : sides who are not given specific results are issued this result. Defaults to defeat.
  • The following tags are valid:
    • [victory] : issues victory to the specified sides. Can have either zero or one [victory] tag per [results] tag. Valid keys:
      • side : comma-delimited list of the sides to be given victory. If not included, the [victory] tag is ignored. (see note#1)
      • bonus : whether the sides specified in this [victory] tag should get bonus gold. Can be either yes or no. Defaults to yes.
      • carryover_percentage : Amount of gold carried over into the next scenario. Defaults to 80%.
      • carryover_add : if true the gold will be added to the starting gold the next scenario, if false the next scenario will start with the amount of the current scenario (after taxes) or the minimum in the next scenario. Default is false.
    • [defeat] : issues defeat to the specified sides. Can have either zero or one [defeat] tag per [results] tag. Valid keys:
      • side : comma-delimited list of the sides to be given defeat. If not included, the [defeat] tag is ignored.
  • If neither a [victory] nor [defeat] tag is specified, then all sides are issued default_result.
Notes
  1. does having multiple opposing sides with victory make sense??
  2. out of sync problems in MP with bonus gold?
  3. TODO : allow endlevel=no (may require server-side changes...)
    • when someone is issued defeat in MP (when there is 3 or more teams), could they become an observer?