Added an easy-to-use macro that can be used in scenarios...

...to display a warning when the AI is playing a side it doesn't know
how to play.
This commit is contained in:
Lari Nieminen 2008-05-14 12:52:28 +00:00
parent e7d41dfd80
commit 50978161c6

View file

@ -109,3 +109,45 @@ Gg , 1 Gg , 2 Gg , Gg
Gg , Gg , Gg , Gg
"
#enddef
#define AI_CANT_PLAY SIDES
# Displays a standard warning at the start of the first AI turn for each
# given side about the AI not knowing how to play this side properly. Use
# this to tag sides intended solely for human players in special multiplayer
# scenarios (ones with shops, custom right-click options and such).
#
# Example:
# ! {AI_CANT_PLAY 1,2,3,4}
[event]
name=ai turn
first_time_only=no
[if]
[have_unit]
side=$side_number
[and]
side={SIDES}
[/and]
[/have_unit]
[variable]
name=side_$side_number|_ai_warning_displayed
not_equals=yes
[/variable]
[then]
[message]
speaker=narrator
message= _ "The computer player might not be able to play side $side_number properly in this scenario. Side $side_number is intended to be played by a human player."
image=icons/icon-ai.png
[/message]
[set_variable]
name=side_$side_number|_ai_warning_displayed
value=yes
[/set_variable]
[/then]
[/if]
[/event]
#enddef