Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: Pikachu14 on July 31, 2003, 10:00:18 AM

Title: Global actors
Post by: Pikachu14 on July 31, 2003, 10:00:18 AM
K, imagine this. I have my Ego character, we'll call him "Graham" for now, and another actor that's supposed to follow Graham from screen to screen. We'll call this guy "Billy the Goat".

Or, imagine this instead. I have my Ego character, we'll call him "Roger" now, and another actor that's supposed to pop up in the room if Roger loiters too much. We'll call him "Joe the Zombie".

I want Billy and/or Joe to appear in multiple rooms while scripting them only once. I know this is supposed to be done with Regions and stuff, but I'll need some details.
Title: Re:Global actors
Post by: Pikachu14 on August 09, 2003, 07:29:43 AM
Hello? Anybody? Mr. Provinciano? Mr. Cromer? Hello-o?
Title: Re:Global actors
Post by: robingravel on August 09, 2003, 01:06:23 PM
Let me see...

 You wish to someone follows the ego from room to room.
 Is that right?

Robin Gravel
Title: Re:Global actors
Post by: Chris Cromer on August 09, 2003, 01:08:06 PM
Have some patience, I didn't see this post till just now.

We do have lives you know. :P

Anyway... my SCI programming skills are a bit rusty because I havn't worked with it in a long while. So I wouldn't be able to help you much until I get back into SCI. Which I do plan to do because I have a game idea.
Title: Re:Global actors
Post by: Pikachu14 on August 10, 2003, 12:18:38 AM
Let me see...

 You wish to someone follows the ego from room to room.
 Is that right?

Robin Gravel
Yeah! That's it!
Title: Re:Global actors
Post by: lskovlun on August 10, 2003, 02:33:54 PM
Tofu,

I think Robin is implicitly suggesting you look at his game "I want my C64 back," for which I helped him with the region things. Take a look at his web page.

Don't hesitate to ask if you have any specific questions.

Cheers,

Lars
Title: Re:Global actors
Post by: Pikachu14 on August 11, 2003, 12:38:34 AM
IIRC in the C64 game it was just a regional timer, not an actor.
Title: Re:Global actors
Post by: robingravel on August 11, 2003, 09:13:17 AM
I got the message: don't asking questions, try yourself.

I asked a question about palette problem and no one has replied:

http://www.mega-tokyo.com/forum/index.php?board=5;action=display;threadid=3842

All right Tofu Towa. I'm looking for it with no charge (because you're asking money for drawing).


Robin Gravel
Title: Re:Global actors
Post by: robingravel on August 11, 2003, 03:59:07 PM
Try this:

Room 1:
Quote
/******************************************************************************
 SCI Template Game
 By Brian Provinciano
 ******************************************************************************
 rm001.sc
 Contains the first room of your game.
 ******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 1)
/******************************************************************************/
(use "main")
(use "controls")
(use "cycle")
(use "game")
(use "feature")
(use "obj")
(use "inv")
(use "door")
(use "jump")
(use "follow")
/******************************************************************************/
(instance public rm001 of Rm
 (properties
  picture scriptNumber
      // Set up the rooms to go to/come from here
  north 2
  east 0
  south 0
  west 0
 )
 (method (init)
  // same in every script, starts things up
  (aChief: init()
    setCycle(Walk)
    //posn(send gEgo:x gEgo:y)
    setMotion(Follow(gEgo aChief 50))
  )
  (super:init())
   (self:setScript(RoomScript))
        
   // Check which room ego came from and position it
   (switch(gPreviousRoomNumber)
            /******************************************************
             * Put the cases here for the rooms ego can come from *
             ******************************************************/
            // Set up ego's position if it hasn't come from any room
    (case north
      (send gEgo:
       posn(150 30)
       loop(2)
      )
     (aChief:
       posn(150 28)
       loop(2)
     )
      )
    (case 976
      (send gEgo:
       posn(150 130)
       loop(1)
      )
     (aChief:
       posn(150 133)
       loop(1)
     )
      )
   )
      // Set up the ego
   SetUpEgo()
   (send gEgo:init())
  /****************************************
   * Set up the room's music to play here *
   ****************************************/ /*
  (send gTheMusic:
   prevSignal(0)
   stop()
   number(scriptNumber)
   loop(-1)
   play()
  )*/

  /**************************************************
  * Add the rest of your initialization stuff here *
  **************************************************/
 )
)
/******************************************************************************/
(instance RoomScript of Script
 (properties)
 (method (handleEvent pEvent)
  (super:handleEvent(pEvent))

  /*****************************************
  * Handle the possible said phrases here *
  *****************************************/
  (if(Said('look'))
   Print("You are in room 1")
  )
 )
)
(instance aChief of Act
 (properties
  y 100
  x 138
  loop 2
  view 3
  cycleSpeed 2
  moveSpeed 2
 )
)

Room 2:
Quote
/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 2)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
(use "follow")
/******************************************************************************/
(instance public rm002 of Rm
 (properties
  picture 1
  north 0
  east 0
  south 1
  west 0
 )
 (method (init)
  (aChief: init()
   setCycle(Walk)
   setMotion(Follow(gEgo aChief 50))
  )
  (super:init())
  (self:setScript(RoomScript))
  (switch(gPreviousRoomNumber)
            /******************************************************
             * Put the cases here for the rooms ego can come from *
             ******************************************************/
            // Set up ego's position if it hasn't come from any room
   (case south
     (send gEgo:
      posn(150 179)
      loop(3)
     )
    (aChief:
      posn(150 189)
      loop(3)
    )
   )
  )
  SetUpEgo()
  (send gEgo:init())
 )
)
/******************************************************************************/
(instance RoomScript of Script
 (properties)
 (method (handleEvent pEvent)
  (super:handleEvent(pEvent))

  /*****************************************
  * Handle the possible said phrases here *
  *****************************************/
  (if(Said('look'))
   Print("You are in room 2")
  )
 )
)
(instance aChief of Act
 (properties
  y 100
  x 138
  loop 2
  view 3
  cycleSpeed 3
  moveSpeed 3
 )
)

Go to the north, your pal should follow you to the next room and go back to the south.


Robin Gravel
Title: Re:Global actors
Post by: Pikachu14 on August 18, 2003, 01:31:18 AM
Nifty enough, but it doesn't quite use those nifty regions doesn't it? I'll try and figure it out ;)