adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-wastesedge-commits] Release_0-3-1 7b028da 127/237: UPDATED in


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 7b028da 127/237: UPDATED intro sequence
Date: Mon, 25 Jul 2016 18:15:06 +0000 (UTC)

tag: Release_0-3-1
commit 7b028dad34bc71241d5543599900824e4bdd4791
Author: adondev <adondev>
Commit: adondev <adondev>

    UPDATED intro sequence
    FIXED oliver's script
---
 scripts/init.py                           |    6 +-
 scripts/modules/intro.py                  |  190 +++++++++++++++++++----------
 scripts/modules/main_menu.py              |    2 +-
 scripts/schedules/mapcharacters/oliver.py |   12 +-
 4 files changed, 134 insertions(+), 76 deletions(-)

diff --git a/scripts/init.py b/scripts/init.py
index 9a7770f..975946a 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -67,21 +67,21 @@ class title_screen:
 
         # -- load our images
         self.bag_o = win_image ()
-        self.bag_o.load_pnm ("gfx/cutscene/jewelbag_open.pnm")
+        self.bag_o.load_raw ("gfx/cutscene/jewelbag_open.img")
         self.bag_o.set_alpha (0)
         self.bag_o.move (0, 0)
         self.bag_o.pack ()
         self.bag_o.set_visible (0)
 
         self.bag_c = win_image ()
-        self.bag_c.load_pnm ("gfx/cutscene/jewelbag_closed.pnm")
+        self.bag_c.load_raw ("gfx/cutscene/jewelbag_closed.img")
         self.bag_c.set_visible (1)
         self.bag_c.set_alpha (0)
         self.bag_c.move (0, 0)
         self.bag_c.pack ()
 
         self.bag_t = win_image ()
-        self.bag_t.load_pnm ("gfx/cutscene/adonthell_03.pnm")
+        self.bag_t.load_raw ("gfx/cutscene/adonthell_03.img")
         self.bag_t.move (33, 86)
         self.bag_t.pack ()
         self.bag_t.set_visible (0)
diff --git a/scripts/modules/intro.py b/scripts/modules/intro.py
index 83c3407..cc53115 100644
--- a/scripts/modules/intro.py
+++ b/scripts/modules/intro.py
@@ -14,18 +14,19 @@ da = drawing_area ()
 da.resize (screen_length (), screen_height ())
 da.move (0, 0)
 
-# The 3 forest images...
+# The images...
 im1 = image ()
 im2 = image ()
 im3 = image ()
 bg = image ()
+inn_close = image ()
 
-im1.load_pnm ("gfx/cutscene/forest3.pnm")
-im2.load_pnm ("gfx/cutscene/forest2.pnm")
+im1.load_raw ("gfx/cutscene/forest3.img")
+im2.load_raw ("gfx/cutscene/forest2.img")
 im2.set_mask (1)
-im3.load_pnm ("gfx/cutscene/forest1.pnm")
+im3.load_raw ("gfx/cutscene/forest1.img")
 im3.set_mask (1)
-bg.load_pnm ("gfx/cutscene/intro_bg.pnm")
+bg.load_raw ("gfx/cutscene/intro_bg.img")
 bg.set_alpha (0)
 
 imblack = image ()
@@ -45,7 +46,7 @@ o3 = 0
 
 # The text window.
 theme = win_manager_get_theme ("original")
-font = win_manager_get_font ("original")
+font = win_manager_get_font ("white")
 cont = win_container ()
 cont.resize (250, 100)
 cont.move ((screen_length () - cont.length ())/2,
@@ -73,13 +74,38 @@ business in her name,\ntrusting me to follow in good 
speed.",
            "A lone Half-Elf, may travel with much\nmore speed than an Elven 
lady and her\nservants, so she \
 was now only a day\nahead.  The thought nearly caused me\nto forget \
 the harshness of the road.",
-           "Still, Waste's Edge was a welcome sight.")
+           "Still, Waste's Edge was a welcome sight.",
+           "As you approach the trading post, there\nseems to be little sign 
of life. Eventually\nyou find the \
+Redwyne Inn, which seems\nto be the main building here.",
+           "The heavy wooden doors are closed,\nand no one is there \
+to let you in. As you\napproach the gate, you suddenly hear a voice from 
within.")
 
 cont.set_visible_background (0);
 cont.set_visible_border (0);
 cont.set_visible_all (1);
 cont.set_activate (1)
 
+# Images for the speech
+bubbg = (image (), image(), image())
+bubbg[0].load_raw ("gfx/cutscene/intro_inn.img")
+bubbg[1].load_raw ("gfx/cutscene/intro_guard.img")
+bubbg[2].load_raw ("gfx/cutscene/intro_player.img")
+
+# Text for the speech
+bubtext = (("Halt! Stand and declare yourself, stranger!", "red", 25, 5, 350, 
1),
+           ("I am $name, come as an agent for my employer. Tell me, is this 
the trading \
+post of Waste's Edge?", "yellow", 130, 5, 500, 2),
+           ("That it is, but this is all you'll see of it.", "red", 25, 5, 
300, 1),
+           ("If you turn now and make haste, you should be able to make safe 
camping \
+before dark.", "red", 25, 5, 400, 1),
+           ("Turn back?  Whatever for?  And why is the gate of a free trading 
post locked \
+against a footsore traveller?", "yellow", 130, 5, 500, 0),
+           ("I am sorry, traveller, but the post is barred and you must be 
off.", "red", 25, 5, 300, 0),
+           ("There has been trouble inside and I have instructions to turn 
away all who \
+need not be here.", "red", 25, 5, 400, 0),
+           ("Trouble?  Why then, I must get inside.  My employer will need me 
close at \
+hand!", "yellow", 130, 15, 500, 0))
+
 wintextocc = 0
 wincpt = 0
 windelay = 0
@@ -87,73 +113,100 @@ bgcpt = 0
 
 status = -1
 
+letsexit = 0
+
 screen_clear ()
 
 gametime_start_action ()
 
-while not input_has_been_pushed (SDLK_ESCAPE) and not input_has_been_pushed 
(SDLK_SPACE):
+while not input_has_been_pushed (SDLK_ESCAPE) and not input_has_been_pushed 
(SDLK_SPACE) and not letsexit:
     # Update the stuff
     input_update ()
     for i in range (0, gametime_frames_to_do ()):
-        # Magic number
-        if o1 >= 4:
-            x1 = update_im (im1, x1)
-            o1 = 0
-        else: o1 = o1 + 1
-
-        # Magic number
-        if o2 >= 2:
-            x2 = update_im (im2, x2)
-            o2 = 0
-        else: o2 = o2 + 1
-
-        # Magic number
-        if o3 >= 1:
-            x3 = update_im (im3, x3)
-            o3 = 0
-        else: o3 = o3 + 1
-
-        # Update the label text
-        if wintextocc < len (wintext):
-            if wincpt < len (wintext[wintextocc]):
-                windelay = windelay + 1
-                if windelay >= 10:
-                    if wincpt == 0: lab.set_text ("")
-                    lab.add_text (wintext[wintextocc][wincpt])
-                    wincpt = wincpt + 1
-                    windelay = 0
-                else:
+
+        # 1st part: forest scrolling and fade to the inn, with
+        #the text appearing letter-by-letter
+        if status < 4:
+            # Magic number
+            if o1 >= 4:
+                x1 = update_im (im1, x1)
+                o1 = 0
+            else: o1 = o1 + 1
+
+            # Magic number
+            if o2 >= 2:
+                x2 = update_im (im2, x2)
+                o2 = 0
+            else: o2 = o2 + 1
+
+            # Magic number
+            if o3 >= 1:
+                x3 = update_im (im3, x3)
+                o3 = 0
+            else: o3 = o3 + 1
+
+            # Update the label text
+            if wintextocc < len (wintext):
+                if wincpt < len (wintext[wintextocc]):
                     windelay = windelay + 1
-                    # Shall we fade to the Inn view?
-                    if status == 0 and wintextocc == len (wintext) - 1 and 
windelay == - 250: status = 1
+                    if windelay >= 10:
+                        if wincpt == 0: lab.set_text ("")
+                        lab.add_text (wintext[wintextocc][wincpt])
+                        wincpt = wincpt + 1
+                        windelay = 0
+                    else:
+                        windelay = windelay + 1
+                        # Shall we fade to the Inn view?
+                        if status == 0 and wintextocc == 5 and windelay == - 
250: status = 1
+                else:
+                    wintextocc = wintextocc + 1
+                    wincpt = 0
+                    windelay = -500
             else:
-                wintextocc = wintextocc + 1
-                wincpt = 0
-                windelay = -500
+                # Switch to close inn view?
+                if windelay == -300:
+                    status = 4
+                    windelay = 0
+                    wintextocc = 0
+                else: windelay = windelay + 1
             
-        cont.update ()
-
-        # Fade to the forest
-        if status == -1:
-            if (imblack.alpha ()) > 0:
-                imblack.set_alpha (imblack.alpha () - 1)
-            else: status = 0
-
-        # Fade to the Inn view.
-        if status == 1 or status == 2:
-            if (bg.alpha ()) < 255:
-                bg.set_alpha (bg.alpha () + 1)
-                if bg.alpha () == 150:
-                    # Start scrolling
-                    status = 2
-
-        if status == 2:
-            if bgy < bg.height () - screen_height ():
-                bgcpt = bgcpt + 1
-                if bgcpt == 2:
-                    bgy = bgy + 1
-                    bgcpt = 0
-            else: status = 3
+            cont.update ()
+
+            # Fade to the forest
+            if status == -1:
+                if (imblack.alpha ()) > 0:
+                    imblack.set_alpha (imblack.alpha () - 1)
+                else: status = 0
+
+            # Fade to the Inn view.
+            if status == 1 or status == 2:
+                if (bg.alpha ()) < 255:
+                    bg.set_alpha (bg.alpha () + 1)
+                    if bg.alpha () == 150:
+                        # Start scrolling
+                        status = 2
+
+            if status == 2:
+                if bgy < bg.height () - screen_height ():
+                    bgcpt = bgcpt + 1
+                    if bgcpt == 2:
+                        bgy = bgy + 1
+                        bgcpt = 0
+                else: status = 3
+
+        # 2nd part: speech between Talan and the player.
+        if status >=4:
+            if windelay >= 0 and wintextocc < len (bubtext):
+                windelay = -bubtext[wintextocc][4]
+                bub = text_bubble (bubtext[wintextocc][0], 
bubtext[wintextocc][1], "original")
+                bub.move (bubtext[wintextocc][2], bubtext[wintextocc][3])
+                windelay = windelay + 1
+                currentbg = bubtext[wintextocc][5]
+            else:
+                windelay = windelay + 1
+                if windelay >= 0:
+                    wintextocc = wintextocc + 1
+                    if wintextocc == len (bubtext): letsexit = 1
     
     # Draw the entire scene
     if status < 3:
@@ -161,13 +214,18 @@ while not input_has_been_pushed (SDLK_ESCAPE) and not 
input_has_been_pushed (SDL
         draw_im (im2, x2)
         draw_im (im3, x3)
 
-    if status > 0:
+    if status > 0 and status < 4:
         bg.draw (0, -bgy, da)
 
     if status == -1:
         imblack.draw (0, 0)
 
-    cont.draw ()
+    if status < 4:
+        cont.draw ()
+
+    if status >= 4:
+        bubbg[currentbg].draw (0, 0)
+        bub.draw ()
     
     screen_show ()
     gametime_update ()
diff --git a/scripts/modules/main_menu.py b/scripts/modules/main_menu.py
index 09cff53..3a9d794 100755
--- a/scripts/modules/main_menu.py
+++ b/scripts/modules/main_menu.py
@@ -48,7 +48,7 @@ class main_menu (win_container):
         self.py_signal_connect (self.on_update, win_event_UPDATE)
         
         self.a_title = win_image()
-        self.a_title.load_pnm ("gfx/cutscene/adonthell_green.pnm")
+        self.a_title.load_raw ("gfx/cutscene/adonthell_green.img")
         self.a_title.set_mask (1)
         self.a_title.move ((self.length() - self.a_title.length())/2, y_pos)
         self.a_title.thisown = 0
diff --git a/scripts/schedules/mapcharacters/oliver.py 
b/scripts/schedules/mapcharacters/oliver.py
index a9b374c..1fb90c7 100755
--- a/scripts/schedules/mapcharacters/oliver.py
+++ b/scripts/schedules/mapcharacters/oliver.py
@@ -47,7 +47,7 @@ class oliver:
                 x, y = self.offsets[i][:2]
                 x = x + orloth.posx ()
                 y = y + orloth.posy ()
-                if myself.set_goal (x, y, NO_MOVE): break
+                if myself.set_goal (x, y): break
                 i = i + 1
 
             myself.set_val ("goto_players_room", 2)
@@ -65,23 +65,23 @@ class oliver:
 
             # -- Player's room
             if location == 12:
-                myself.set_goal (5, 1, NO_MOVE)
+                myself.set_goal (5, 1)
 
             # -- First floor
             elif location == 9:
-                myself.set_goal (8, 1, NO_MOVE)
+                myself.set_goal (8, 1)
 
             # -- Second floor (this shouldn't happen, but it once did ...)
             elif location == 14:
-                myself.set_goal (4, 1, NO_MOVE)
+                myself.set_goal (4, 1)
 
             # -- Common Room
             elif location == 1:
-                myself.set_goal (13, 8, NO_MOVE)
+                myself.set_goal (13, 8)
 
             # -- Yard, our final goal (for now)
             elif location == 0:
-                myself.set_goal (25, 15, NO_MOVE)
+                myself.set_goal (25, 15)
                 myself.set_val ("goto_barn", 0)
 
             myself.set_val ("todo", 2)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]