109
« on: January 26, 2023, 10:05:06 AM »
I've placed it after the room script instance.
;;; Sierra Script 1.0 - (do not remove this comment)
;
; SCI Template Game
; By Brian Provinciano
; ******************************************************************************
; rm001.sc
; Contains the first room of your game.
(script# 1)
(include sci.sh)
(include game.sh)
(use main)
(use controls)
(use cycle)
(use game)
(use feature)
(use obj)
(use inv)
(use door)
(use jump)
(use dpath)
(public
rm001 0
)
(define vRoom 250)
(define lWaterfall 0)
(instance rm001 of Rm
(properties
picture 201
; Set up the rooms to go to/come from here
north 0
east 002
south 0
west 0
)
(method (init)
; same in every script, starts things up
(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 *
;
; (case north
; (send gEgo:
; posn(210 110)
; loop(2)
; )
; )
; Set up ego's position if it hasn't come from any room
(else
(gEgo posn: 150 130 loop: 1)
)
)
; Set up the ego
(SetUpEgo)
(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>')
(if (Said '/plaque')
(Print {Oh no. test.})
(gGame changeScore: 3) ; Will add 3 to the players current score
else
(if (Said '/ocean, beach, point, lagoon, bay, water')
(Print 1 2)(Print 1 2)
;(Print {From up here the polluted lagoon looks even more polluted than you remember. Hey surfs up though})
else
(if (Said '/grass, ground, sidewalk')
(Print {grass})
else
(if (Said '/rail, railing, fence')
(Print {fence.})
else
(if (Said '[ /* , !* ]')
(Print {look room reponse})
)
)
)
)
(if (Said 'laugh>')
(Print {hahahaha})
)
) ;End Method
) ;End Instance
; Cond version
(if (Said 'look>')
(cond
((Said 'plaque')
(Print {plaque response})
)
((Said '/water')
(Print {water response})
)
((Said '/grass')
(Print {grass response})
)
((Said 'rail')
(Print {rail response})
)
((Said '[ /* , !* ]')
(Print {hello world})
)
)
)
) ;End Method
) ;End Instance
(instance aFountain of Prop
(properties
view vRoom
loop lWaterfall
x 194
y 148
cycleSpeed 1
)
(method (init)
(super init)
(self
isExtra TRUE,
setCycle Forward,
setPri 11,
)
)
)