Keywords: Stendhal sato simplified.png Stendhal with three internal states It normally is in state IDLE But a player can start a conversation by saying Hi The NPC will reply and then go to state ATTENDING In ATTENDING he will answers questions about his work or general game help If the player says that he wants to sell a sheep he will check whether the player actually owns one If that is not the case he will simply reply But in case the player has a sheep it will calculate the price it is going to offer and move to state SELL_PRICE_OFFERED In state SELL_PRICE_OFFERED it will wait for the player to decide whether to accept the deal or decline it In the first case the deal is commited using the program function transfer_sheep_and_money In both ATTENDING and SELL_PRICE_OFFERED the NPC will accept the trigger bye and end the conversation own created using graphviz Hendrik Brummermann 2009-10-25 Source Code digraph finite_state_machine rankdir LR IDLE -> ATTENDING label hi hello A1 ; ATTENDING -> ATTENDING label job work A1 ; ATTENDING -> ATTENDING label help A1 ; ATTENDING -> ATTENDING label C1 sell A1 ; ATTENDING -> SELL_PRICE_OFFERED label C2 sell A2 ; SELL_PRICE_OFFERED -> ATTENDING label yes ok A3 ; SELL_PRICE_OFFERED -> ATTENDING label no A1 ; ATTENDING -> IDLE label bye A1 ; SELL_PRICE_OFFERED -> IDLE label bye A1 ; captionCondition label Pre Conditions C1 player_has_no_sheep C2 player_has_a_sheep shape record ; captionAction label Post Action A1 trigger_based_reply A2 calculate_sheep_price A3 transfer_sheep_and_money shape record ; Check categories 2009 October 29 en wikipedia Non-player_character 2 Tabletop games Video game development |