This will actually make it harder for the programmer, too ;-)
This time, the player will have to talk to someone in order to get an item.
ROOM main { IMAGE { "gr/street_2.gif" } WALK { "gr/street_2_bm.gif" } ITEM Indy // My hero :) { ANIMATION { // --- standby images --- 0 0 "gr/indy_d.gif" 1 // Looking South 0 1 "gr/indy_r.gif" 1 // Looking West 0 2 "gr/indy_u.gif" 1 // Looking North 0 3 "gr/indy_l.gif" 1 // Looking East // --- walking animation --- 1 0 "gr/indy_wd.gif" 4 // Looking South 1 1 "gr/indy_wr.gif" 6 // Looking West 1 2 "gr/indy_wu.gif" 4 // Looking North 1 3 "gr/indy_wl.gif" 6 // Looking East // --- talking animation --- 2 0 "gr/indy_td.gif" 7 // Looking South 2 1 "gr/indy_tr.gif" 4 // Looking West 2 2 "gr/indy_tu.gif" 1 // Looking North 2 3 "gr/indy_tl.gif" 4 // Looking East } POSITION { 140 140 0 } } ITEM sophia { ANIMATION { // --- standby images --- 0 1 "gr/sophia_r.gif" 1 // Looking West 0 3 "gr/sophia_l.gif" 1 // Looking East // --- walking animation --- 1 1 "gr/sophia_r.gif" 1 // Looking West 1 3 "gr/sophia_l.gif" 1 // Looking East // --- talking animation --- 2 1 "gr/sophia_tr.gif" 4 // Looking West 2 3 "gr/sophia_tl.gif" 4 // Looking East } INK { 3 } // Sophia's speech will be pink :) POSITION { 250 143 0 } ITEM medallion { ICON { "gr/medalion.gif" } } INTEGER { f } // a simple flag COMMAND "look at" sophia { SAY indy "My favorite girl" } COMMAND "talk to" sophia { IF { EQ f 0 // ( f=0 ?) Did he talk to her before? } THEN { MOVE indy 210 142 0 // Move to her left. WAIT indy TURN indy sophia // Look at her. TURN sophia indy // Look at him! SAY indy "Sophia! I missed you so much since Atlantis!" WAIT indy // Wait for his sentence to finish. SAY sophia "You? But you almost let me die there!" WAIT sophia SAY sophia "I will never play any adventure with you again!" WAIT sophia SAY indy "Sophia! wait!" } IF { EQ f 1 // f=1 ? } THEN { MOVE indy 210 142 0 // Move to her left. WAIT indy TURN indy sophia // Look at her. TURN sophia indy // Look at him! SAY indy "I need you. Give me another chance." WAIT indy SAY sophia "Mmmmm..." WAIT sophia SAY sophia "Take this, it might help you today." GIVE indy medallion // Bingo! SOUND "snd/medal.au" } IF { EQ f 2 // ( f=2 ?) Did he already get the medalion from her? } THEN { SAY indy "Better let her alone for now." } ADD f 1 // (f=f+1) Increase variable "f" } } } COMMAND "look at" * { SAY indy "Nothing special" } COMMAND * * { SAY indy "I can't do that" } COMMAND * * * { SAY indy "I can't do this" }
Look at the COMMAND block that handle the conversation through the use of an integer
variable.
Variable f indicates the progression level reached within the
conversation. The player will have to talk to the girl several times to get something.
All variables (whether global or local) are always "static", meaning that they
retain their values during the whole game. Also, integer variables are all equal to 0 at
the beginning of the game.
The WAIT keyword is essential in cutscenes. It freezes execution, taking control out of
the player, while the orator finishes his sentence.
The speech text color can be specified for each character (see the Reference
Manual for the list of color codes in SETINK). Using different colors makes it easier
for the player to follow the conversation.