Dialog & Interjections (Scripts)

Dialog between characters can bring a world to life, and make it much less of a lonely place.

There are two ways in which dialog might be initiated. As the result of a map event (i.e. a dwarf accidentally steps on a pressure plate, his friend yells "Don't touch that!"); or the player clicks on an NPC to initiate dialog themselves.

Dialog as an Event
There are three methods that are used for this purpose: startDialogEvent(owner); startDialogEvent will centre the screen on the owner and force the game to pause until the endDialog method is called or there is no more dialog to display. addDialog("dialog", owner); addDialog will display 'dialog' as text on screen, and highlights the owner so the player knows who's talking. If this owner is off-screen, the view will shift until they are on-screen. addInterjection("personality", "dialog"); addInterjection will display 'dialog' as text on screen for any of the player's characters with the given personality that are nearby the source of the conversation. They will be highlighted automatically. endDialog; endDialog is an important method, as it ensures any further dialog changes are treated as a separate event.

Below is an example script for an event dialog: startDialogEvent(triggerer); addDialog("Whoa, sounds like we've got company!"); addInterjection("benevolent", "Let's tread carefully."); addInterjection("stoic", "Nothing we can't handle."); addInterjection("rational", "Be careful, we don't know what to expect."); addInterjection("passionate", "Sounds like someone's in trouble!"); addInterjection("aggressive", "Let's get em!"); endDialog; Note that the code in this script will all be run before the dialog even starts, so you won't be able to have code run after the dialog finishes, except by using the board.runOnNextUpdate method (for now). A few features are planned that will enable you to run code after or between dialogs, but how they'll work hasn't been established yet.

Below is example code for how to use board.runOnNextUpdate (untested): board.runOnNextUpdate.add(new ActionListener{ 	public void actionPerformed(e) { 		//do stuff in here 	} });