From d37b37e5631e98f098463195606d13467c334349 Mon Sep 17 00:00:00 2001 From: evktalo Date: Mon, 20 Jul 2009 11:20:55 +0000 Subject: Commit r10308 to 0.5: Milestones for entering Ice Caves, Minitombs and Sewers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10350 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/level_design.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'crawl-ref/docs') diff --git a/crawl-ref/docs/level_design.txt b/crawl-ref/docs/level_design.txt index a20d4e747a..91df249b33 100644 --- a/crawl-ref/docs/level_design.txt +++ b/crawl-ref/docs/level_design.txt @@ -1502,6 +1502,28 @@ You can then use this line in the map definition to execute the lua block: You can also set env.spawn_random_rate() to have monsters generated from the list during play. +Milestones for portal vaults +---------------------------- + +This example is from icecave.des, defined in the lua preludes: + +{{ +function ice_cave_milestone(e) + crawl.mark_milestone("br.enter", "entered an Ice Cave.") +end +}} + +The function is called from each of the destination map definitions: + +: ice_cave_milestone(_G) + +This marks down entering the portal vault in the milestones. When the portal +is entered, the destination map is chosen and the call to crawl.mark_milestone +is executed along with the rest of the map definition. + +Adding milestones in a .des does have the slight catch of creating multiple +milestones if the map fails validation for some reason, so it's best used +in maps that will never fail validation. I. Lua reference =================== @@ -1808,7 +1830,8 @@ provide utility methods. mpr, mesclr, random2, coinflip, one_chance_in, redraw_screen, input_line, c_input_line, getch, kbhit, flush_input, sendkeys, playsound, runmacro, bindkey, setopt, msgch_num, msgch_name, regex, -message_filter, trim, split, game_started, err_trace, args +message_filter, trim, split, game_started, err_trace, args, +mark_milestone Lua API - character information -- cgit v1.2.3-54-g00ecf