macro maintenance

This commit is contained in:
Scott Klempner 2006-06-02 20:51:33 +00:00
parent f2ca94054f
commit b49481c525
3 changed files with 173 additions and 78 deletions

View file

@ -5,26 +5,8 @@
################################
#
# This music macro ensures that the correct music is selected
# for a scenario just in case it is changed by [story].
# It should be positioned at the top of the scenario file
# so it can be overridden by other prestart or start events.
# Nothing yet
#
# It also allows for the convenient use of a standardized
# intra-scenario music, should we decide to use one.
#
#define SCENARIO_MUSIC MUSIC
[music]
name="wesnoth-2.ogg"
[/music]
[event]
name=prestart
[music]
name={MUSIC}
[/music]
[/event]
#enddef
################################
#

View file

@ -66,7 +66,7 @@
background=story/the_great_continent.png
music=main_menu_new.ogg
[image]
x,y=192,0
x,y=110,0.0
file=story/trow-logo.png
[/image]

View file

@ -1,4 +1,60 @@
#this file contains utility macros
# This file contains utility macros for scenario writers
#### TABLE OF CONTENTS ####
# variable operations
# RANDOM
# VARIABLE
# VARIABLE_OP
# CLEAR_VARIABLE
# FOREACH
# NEXT
# IF_TERRAIN
# DEBUG_MSG
# scenario/campaign setup
# DEFAULT_MUSIC_PLAYLIST
# SCENARIO_MUSIC
# STARTING_VILLAGES
# DOT
# CROSS
# MENU_IMG_TXT
# MENU_IMG_TXT2
# side setup
# TURNS
# GOLD
# INCOME
# ATTACK_DEPTH
# NO_SCOUTS
# in-scenario actions
# PLACE_IMAGE
# TREMOR
# IS_HERO
# UNIT
# UNDEAD_UNIT
# MOVE_UNIT
# MODIFY_UNIT
# STORE_UNIT_VAR
# PUT_TO_RECALL_LIST
# utilities not intended for general use
# QUANTITY
# MAGENTA_IS_THE_TEAM_COLOR
# COLOR_HEAL
# COLOR_HARM
# COLOR_WHITE
# IMAGE_DEFENSIVE
# IMAGE_DEFENSIVE_RANGE
# IMAGE_DEFENSIVE_SHORT
#### END OF TABLE OF CONTENTS ####
#macro to define a 'quantity' differently based on difficulty levels
#define QUANTITY ATTRIBUTE ON_EASY ON_NORMAL ON_HARD
@ -15,28 +71,11 @@
#endif
#enddef
#macro to define AI attack depth for different difficulty levels
#define ATTACK_DEPTH ON_EASY ON_NORMAL ON_HARD
{QUANTITY attack_depth {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#macro to define number of turns for different difficulty levels
#define TURNS ON_EASY ON_NORMAL ON_HARD
{QUANTITY turns {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#macro to make an AI team not recruit scouts
#define NO_SCOUTS
villages_per_scout=0
#enddef
#macro to add a hero icon to the unit
#define IS_HERO
overlays="misc/hero-icon.png"
#enddef
#macro which will let you go {GOLD x y z} to set
#the gold depending on easy/medium/hard - x/y/z
@ -45,17 +84,22 @@ overlays="misc/hero-icon.png"
#enddef
#define INCOME ON_EASY ON_NORMAL ON_HARD
#ifdef EASY
income={ON_EASY}
#endif
{QUANTITY income {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#ifdef NORMAL
income={ON_NORMAL}
#endif
#macro to define AI attack depth for different difficulty levels (set it to 1-6)
#define ATTACK_DEPTH ON_EASY ON_NORMAL ON_HARD
{QUANTITY attack_depth {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#ifdef HARD
income={ON_HARD}
#endif
#macro to make an AI team not recruit scouts
#define NO_SCOUTS
villages_per_scout=0
#enddef
#macro to add a hero icon to the unit
#define IS_HERO
overlays="misc/hero-icon.png"
#enddef
#define DOT X Y
@ -86,7 +130,6 @@ random={RANGE}
#enddef
#macro to initialize a variable
#define VARIABLE VAR VALUE
[set_variable]
name={VAR}
@ -95,7 +138,6 @@ value={VALUE}
#enddef
#macro to do mathematical operations on variables
#define VARIABLE_OP VAR OP ARG
[set_variable]
name={VAR}
@ -470,36 +512,107 @@ name=prestart
flag_rgb=244,154,193,63,0,22,85,0,42,105,0,57,123,0,69,140,0,81,158,0,93,177,0,105,195,0,116,214,0,127,236,0,140,238,61,150,239,91,161,241,114,172,242,135,182,246,173,205,248,193,217,250,213,229,253,233,241
#enddef
# Music macros. As of 1.1.3, music is parsed as follows:
# 1. the [scenario]-level [music] tag
# 2. the [story]-level music key
# 3. any [event]-level [music] tags
#
# If you change the music at a lower level, the tags above it will NOT be re-parsed
# and your scenario will sound wrong. For example, if you set scenario music
# with the normal [scenario]-level music tag but change the music during the [story],
# it is never reset back to normal. Therefore, these macros are intended to catch
# instances like that. Of course, if you want something more elaborate, code it
# manually.
# A macro to define a standard playlist suitable for any level. The music is defined
# twice to catch instances where music is changed in a story and not set back.
#define DEFAULT_MUSIC_PLAYLIST
[music]
name=gameplay01.ogg
ms_before=12000
[/music]
[music]
name=gameplay02.ogg
ms_before=12000
append=yes
[/music]
[music]
name=gameplay03.ogg
ms_before=12000
append=yes
[/music]
[music]
name=main_menu.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-1.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-2.ogg
ms_before=12000
append=yes
[/music]
[music]
name=gameplay01.ogg
ms_before=12000
[/music]
[music]
name=gameplay02.ogg
ms_before=12000
append=yes
[/music]
[music]
name=gameplay03.ogg
ms_before=12000
append=yes
[/music]
[music]
name=main_menu.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-1.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-2.ogg
ms_before=12000
append=yes
[/music]
[event]
name=prestart
[music]
name=gameplay01.ogg
ms_before=12000
[/music]
[music]
name=gameplay02.ogg
ms_before=12000
append=yes
[/music]
[music]
name=gameplay03.ogg
ms_before=12000
append=yes
[/music]
[music]
name=main_menu.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-1.ogg
ms_before=12000
append=yes
[/music]
[music]
name=wesnoth-2.ogg
ms_before=12000
append=yes
[/music]
[/event]
#enddef
#
# This music macro ensures that the correct music is selected
# for a scenario just in case it is changed by [story].
# It should be positioned at the top of the scenario file
# so it can be overridden by other prestart or start events.
#
# It also allows for the convenient use of a standardized
# intra-scenario music, should we decide to use one.
#
#define SCENARIO_MUSIC MUSIC
[music]
name="wesnoth-2.ogg"
[/music]
[event]
name=prestart
[music]
name={MUSIC}
[/music]
[/event]
#enddef
#define COLOR_HEAL