I've now added verb buttons for switching from Beasty to Santa and vice
versa. It's nothing special, though. They appear after you "use" Santa
for the first time. I couldn't figure out how to make verbs with zero
objects, so they are now handled right in the inputHandler block.

It would probably look better if the verbs had the icons of the actors.
I think that is how it was done in MM and DOTT. Do you know how to apply
icons to verbs, and maybe resize or clip them to fit? The verb disk must
surely be initialized with an icon too?
-- 
  Gerrit
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

Index: scummc/trunk/examples/road/road.scc
===================================================================
--- scummc/trunk/examples/road/road.scc	(revision 266)
+++ scummc/trunk/examples/road/road.scc	(working copy)
@@ -22,8 +22,6 @@
 #include "common.sch"
 
 bit welcomed,lost,santaHello,santaPlace,santaReal;
-actor santa;
-#define SANTA_COLOR 14
 
 // our room
 room Road {
@@ -36,9 +34,6 @@
     boxd = "road.box";
     trans = 0;
 
-    //cycle testCycl = { 60, 0, 103, 111 };
-    cost santaCost = "santa.cost";
-
     voice letsgothere = { "letsgothere.voc", 500 };
     voice welcome = { "welcome.voc" };
     voice tv = { "file.voc" };
@@ -300,13 +295,25 @@
             return;
 
         case Use:
-            if(objB == axe)
-                egoSay("Killing him won't help us.");
-            else
-                egoSay("I can't just *use* someone.");
+           if(objB == axe)
+               egoSay("Killing him won't help us.");
+           else {
+               // switch actors
+               egoSay("I will use Santa as my alter ego.");
+               VAR_EGO = santa;
+               cameraFollowActor(VAR_EGO);
+               setCurrentVerb(useActor1);
+               setVerbOn();
+               redrawVerb();
+               setCurrentVerb(useActor2);
+               setVerbOn();
+               redrawVerb();
+
+           }
         }
-    }
 
+   }
+
     local script walkOut(int eff) {
         screenEffect(eff);
         startRoom(Road);
@@ -376,22 +383,6 @@
         // our palette is buggy, fix it
         setRoomColor(0,0,0,0);
 
-        // Setup the santa
-        setCurrentActor(santa);
-        initActor();
-        setActorCostume(santaCost);
-        setActorTalkPos(-60,-60);
-        setActorName("Santa");
-        setActorTalkColor(SANTA_COLOR);
-        setActorAnimSpeed(2);
-        actorObject[santa] = santaObj;
-        // allow it to be outside of the walk boxes
-        setActorIgnoreBoxes();
-        putActorAt(santa,20,90,Road);
-        // run the "standing" anim
-        setActorStanding();
-        setCurrentActor(VAR_EGO);
-
         // init the print slot
         egoPrintBegin();
         actorPrintOverhead();
@@ -399,14 +390,23 @@
         
 
         unless(welcomed) {
-            putActorAt(VAR_EGO,440,0,Road);
+            // put santa in the room at start
+            setCurrentActor(santa);
+            putActorAt(santa,20,90,Road);
+            actorObject[santa] = santaObj;
+            setActorStanding();
+            actorFace(santa,exitSouth);
+            setActorDirection(SOUTH);
+            // walk beasty into the room at start
+            setCurrentActor(beasty);
+            putActorAt(beasty,440,0,Road);
             try {
                 setCameraAt(0);
                 panCameraTo(440);
                 waitForCamera();
-                cameraFollowActor(VAR_EGO);
-                walkActorTo(hero,430,80);
-                waitForActor(hero);
+                cameraFollowActor(beasty);
+                walkActorTo(beasty,430,80);
+                waitForActor(beasty);
                 
                 egoSay("Hello mortal.");
                 waitForMessage();
@@ -429,24 +429,24 @@
                 setCurrentActor(VAR_EGO);
                 setActorDirection(WEST);
                 cameraFollowActor(VAR_EGO);
-                walkActorTo(hero,420,90);
+                walkActorTo(VAR_EGO,420,90);
                 break;
             case 1:
                 putActorAt(VAR_EGO,460,0,Road);
                 cameraFollowActor(VAR_EGO);
-                walkActorTo(hero,450,40);
+                walkActorTo(VAR_EGO,450,40);
                 break;
             case 2:
                 putActorAt(VAR_EGO,60,144,Road);
                 setCurrentActor(VAR_EGO);
                 setActorDirection(NORTH);
                 cameraFollowActor(VAR_EGO);
-                walkActorTo(hero,80,120);
+                walkActorTo(VAR_EGO,80,120);
                 break;
             }
 
             unless(lost) {
-                waitForActor(hero);
+                waitForActor(VAR_EGO);
                 egoSay("I think I'm lost.");
                 lost = 1;
             }
Index: scummc/trunk/examples/road/common.scc
===================================================================
--- scummc/trunk/examples/road/common.scc	(revision 266)
+++ scummc/trunk/examples/road/common.scc	(working copy)
@@ -42,7 +42,10 @@
     chset dialogCharset = "vera-small.char";
     // and the costume for our actor
     cost egoCost = "devil.cost";
+    
+    cost santaCost = "santa.cost";
 
+
     // an object for the cursor image
     object cursor {
         x = 0;
@@ -76,7 +79,7 @@
     // set the actor costume, etc
     script setupActors() {
         // create the actor
-        setCurrentActor(hero);
+        setCurrentActor(beasty);
         initActor();
         setActorCostume(egoCost);
         setActorTalkPos(-60,-60);
@@ -86,7 +89,19 @@
         setActorWidth(40);
         setActorAnimSpeed(2);
         // set VAR_EGO so we can use the *Ego* functions
-        VAR_EGO = hero;
+        VAR_EGO = beasty;
+        
+        // initialize santa
+        setCurrentActor(santa);
+        initActor();
+        setActorCostume(santaCost);
+        setActorTalkPos(-60,-60);
+        setActorName("Santa");
+        setActorWalkSpeed(2,1);
+        setActorTalkColor(SANTA_COLOR);
+        setActorWidth(40);
+        setActorAnimSpeed(2);
+
     }
 
     // setup all the verbs
@@ -212,7 +227,6 @@
         setVerbHiColor(hiColor);
         setVerbDimColor(dimColor);
         //verbCenter();
-        
 
         for(l = 0,vrb = invSlot0 ; l < 2 ; l++)
             for(c = 0 ; c < 4 ; c++, vrb++) {
@@ -223,6 +237,25 @@
             }
         dimInt(invObj,8);
 
+
+        setCurrentVerb(useActor1);
+        initVerb();
+        setVerbName("Use Beasty");
+        setVerbXY(240,156);
+        setVerbColor(color);
+        setVerbHiColor(hiColor);
+        setVerbDimColor(dimColor);
+        //verbCenter();
+
+        setCurrentVerb(useActor2);
+        initVerb();
+        setVerbName("Use Santa");
+        setVerbXY(240,170);
+        setVerbColor(color);
+        setVerbHiColor(hiColor);
+        setVerbDimColor(dimColor);
+        //verbCenter();
+
     }
 
     // turn on all the verb for the interface 
@@ -417,16 +450,33 @@
                 egoSay("I can't pick that up.");
             break;
             
-        case Use:
-            if(objA <= 0xF) {
-                if(objB)
-                    egoSay("I can't use that on someone!");
-                else
-                    egoSay("I can't just *use* someone!");
-            } else
-                egoSay("I can't use that !");
-            break;
-            
+       case Use:
+           if(objA <= 0xF) {
+               if(objB)
+                   egoSay("I can't use that on someone!");
+               else {
+                   // switch to another ego
+                   if( objA == santa || objA == beasty ) {
+                     VAR_EGO = objA;
+                     cameraFollowActor(VAR_EGO);
+                   }
+                   else
+                     egoSay("I can't just *use* someone.");
+               }
+           } else
+               egoSay("I can't use that !");
+           break;
+
+       case Give:
+           if(objB && objA <= 0xF) {
+               egoSay("I'll give it to him.");
+               setObjectOwner(objB,objA);
+               break;
+           }
+           else
+               egoSay("Can't give things to non-persons.");
+           break;
+
         case LookAt:
             if(objA <= 0xF)
                 egoSay("There is nothing special about him.");
@@ -478,7 +528,7 @@
             if(getObjectVerbEntrypoint(objA,SetBoxes))
                 startObject2(objA,SetBoxes, [ vrb, objA ]);
             break;
-                
+
         default:
             egoSay("Hmm. No.");
             break;
@@ -617,6 +667,18 @@
             return;
         }
 
+        if(isAnyOf(cmd, [ useActor1, useActor2 ])) {
+            if( cmd == useActor1 ) {
+                VAR_EGO = beasty;
+                cameraFollowActor(VAR_EGO);
+            }
+            if( cmd == useActor2 ) {
+                VAR_EGO = santa;
+                cameraFollowActor(VAR_EGO);
+            }
+            return;
+        }
+
         // now are left: room click and inventory
         // stop any currently running sentence
         stopSentence();
@@ -671,14 +733,14 @@
         int i, count;
         //unless(obj) return;
 
-        count = getInventoryCount(hero);
+        count = getInventoryCount(VAR_EGO);
 
         dbgPrint("%i{count} obj in inv");
 
 
         for(i = 0 ; i < 8 ; i++) {
             if(i < count) {
-                obj = findInventory(hero,i+1);
+                obj = findInventory(VAR_EGO,i+1);
                 startObject2(obj,Icon, [ setInventoryIcon, invSlot0+i ]);
             } else {
                 setCurrentVerb(invSlot0+i);
Index: scummc/trunk/examples/road/santa.scost
===================================================================
--- scummc/trunk/examples/road/santa.scost	(revision 266)
+++ scummc/trunk/examples/road/santa.scost	(working copy)
@@ -20,17 +20,119 @@
 palette([48-79]);
 
 
+picture walking_e00 = {
+    glob = "santa/walking_e00??.bmp",
+    position = { -25, -35 }
+};
+
+picture walking_w00 = {
+    glob = "santa/walking_w00??.bmp",
+    position = { -25, -35 }
+};
+
+picture walking_n00 = {
+    glob = "santa/walking_n00??.bmp",
+    position = { -25, -35 }
+};
+
+picture walking_s00 = {
+    glob = "santa/walking_s00??.bmp",
+    position = { -25, -35 }
+};
+
+
+picture standE = {
+    path = "santa/stopped0006.bmp",
+    position = { -25, -35 }
+};
+
+picture standW = {
+    path = "santa/stopped0002.bmp",
+    position = { -25, -35 }
+};
+
+picture standN = {
+    path = "santa/stopped0004.bmp",
+    position = { -25, -35 }
+};
+
 picture standS = {
-    path = "santa.bmp",
+    path = "santa/stopped0000.bmp",
     position = { -25, -35 }
 };
 
 
+//limb body = {
+//    standS
+//};
+
 limb body = {
-    standS
+    walking_e0000, walking_e0001, walking_e0002, walking_e0003, // 0-3
+    walking_e0004, walking_e0005, walking_e0006, walking_e0007, // 4-7
+
+    walking_w0000, walking_w0001, walking_w0002, walking_w0003, // 8-11
+    walking_w0004, walking_w0005, walking_w0006, walking_w0007, // 12-15
+
+    walking_s0000, walking_s0001, walking_s0002, walking_s0003, // 16-19
+    walking_s0004, walking_s0005, walking_s0006, walking_s0007, // 20-23
+
+    walking_n0000, walking_n0001, walking_n0002, walking_n0003, // 24-27
+    walking_n0004, walking_n0005, walking_n0006, walking_n0007,  // 28-31
+
+    standE, // 32
+    standW, // 33
+    standN, // 34
+    standS  // 35
+
 };
 
+anim walkE = {
+    body([0-7])
+};
+
+anim walkW = {
+    body([8-15])
+};
+
+anim walkS = {
+    body([16-23])
+};
+
+anim walkN = {
+    body([24-31])
+};
+
+
+anim standE = {
+    body(32)
+};
+
+anim standW = {
+    body(33)
+};
+
+anim standN = {
+    body(34)
+};
+
 anim standS = {
-    body(0)
+    body(35)
 };
 
+
+anim initE = {
+    body(32)
+};
+
+anim initW = {
+    body(33)
+};
+
+anim initN = {
+    body(34)
+};
+
+anim initS = {
+    body(35)
+};
+
Index: scummc/trunk/examples/road/common.sch
===================================================================
--- scummc/trunk/examples/road/common.sch	(revision 266)
+++ scummc/trunk/examples/road/common.sch	(working copy)
@@ -30,6 +30,8 @@
     invSlot4 @ 104, invSlot5 @ 105, invSlot6 @ 106, invSlot7 @ 107;
 // The inventory arrows
 verb invUp, invDown;
+// Switch ego
+verb useActor1, useActor2;
 // The verb colors
 #define VERB_COLOR       6
 #define VERB_HI_COLOR   11
@@ -59,10 +61,13 @@
 #define MAX_DIALOG_LINES    5
 #define MAX_DIALOG_SENTENCE 16
 
-// define an actor for our hero
-actor hero;
+// define beasty
+actor beasty;
 #define BEASTY_COLOR      7
 #define BEASTY_DIM_COLOR 26
+// define santa
+actor santa;
+#define SANTA_COLOR 14
 
 room ResRoom {
     script showVerbs(int show);
_______________________________________________
ScummC-general mailing list
[email protected]
https://mail.gna.org/listinfo/scummc-general

Reply via email to