Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - robbo007

Pages: 1 ... 6 7 [8]
106
SCI Syntax Help / Re: SC0 vRoom view
« on: January 27, 2023, 09:36:47 AM »
ok thanks. Understood.

After playing a bit more I change the code to the following. The SetCycle Forward needed to be Fwd and I had to remove the isExtra TRUE to get the animation of the loop working. Yayeee

Code: [Select]
(method (init)
(super init:)
(self
setCycle: Fwd
setPri: 11
)

Is there any documentation with the parameters that can be used for "Set" stuff like SetCycle etc

107
SCI Syntax Help / Re: SC0 vRoom view
« on: January 27, 2023, 04:38:19 AM »
Deeper I go down that rabbit hole :) So that now compiles, amazing. I need to start documenting all this. So I don't forget.

With regards to a vRoom. Am I right in saying that (define vRoom 350) and (define lWaterfall 4) means use view.350, loop number 4 and define it as "lWaterfull" variable for use later on in the script.

Quote
(define   vRoom         350)
   (define   lWaterfall   4)

And this part below uses the previous defined variable "lWaterfall" and places the view.305 file at the coordinates indicated? Do I need to define a priority colour/area on the room picture I'm using? Reason being is the waterfall view.350 is not displayed on my defined room pic after recompiling everything and running the game.

Code: [Select]
(instance aFountain of Prop
(properties
view vRoom
loop lWaterfall
x 235
y 121
cycleSpeed 1
)

(method (init)
(super init:)
(self
isExtra: TRUE
; setCycle: Not sure what value to put here as "forward" does not work.
setPri: 11
)
)
)



108
SCI Syntax Help / Re: SC0 vRoom view
« on: January 26, 2023, 12:29:36 PM »
Thanks for that. Helps get my head around this. So should every instance be treated like a separately inside the script? IE should I close each instance before opening another or close all the instances at the end of the file?

I've played around with the code and removed the else statements and only used condition. Much better. I've removed the double ending of instance and methods also. That all compiles fine until I add at the end the prop statement. I think I have the closing brackets correct?

Code: [Select]
;;; Sierra Script 1.0 - (do not remove this comment)
(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 350)
(define lWaterfall 0)

(instance rm001 of Rm
(properties
picture 201
north 0
east 002
south 0
west 0
)

(method (init)
(super init:)
(self setScript: RoomScript)
(switch gPreviousRoomNumber
(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 *

; KAWA: This entire block *REALLY* should stay inside of rm001::init
; even though it's commented out, or you're gonna get messy indents
; again, or WORSE.

(instance RoomScript of Script
(properties)

(method (handleEvent pEvent)
(super handleEvent: pEvent)

; 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,
)
)
)

109
SCI Syntax Help / Re: SC0 vRoom view
« on: January 26, 2023, 10:05:06 AM »
I've placed it after the room script instance.

Code: [Select]
;;; 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,
)
)
)

110
SCI Syntax Help / Re: SC0 vRoom view
« on: January 26, 2023, 09:51:59 AM »
You're trying to use a Script when you mean to use a Prop, like it says in the LSL3 code you're copying.

Sorry your right there. I had it as a Prop but was testing to see if that was the error. It still errors though.

Code: [Select]
(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,
)
)
)
) ;End Method
) ;End Instance

111
SCI Syntax Help / SC0 vRoom view
« on: January 26, 2023, 09:34:22 AM »
Hi guys,
I'm trying to work out how to add animated views to my pics. I'm testing with a portion of LSL3 code from the room and the casino fountain view.

I've declared at the start of my script the vRoom:
Code: [Select]
(define vRoom 250)
(define lWaterfall 0)

And at the end of my Instance RoomScript of Script this code:

Code: [Select]
(instance aFountain of Script
(properties
view vRoom
loop lWaterfall
x 194
y 148
cycleSpeed 1
)

(method (init)
(super init)
(self
isExtra TRUE,
setCycle Forward,
setPri 11,
)
)
)
) ;End Method
) ;End Instance

I'm getting an expected an expression error. Is this the correct way to add animated views to pics? Sorry for my basic questions.
Regards,

112
SCI Development Tools / Re: Brackets Bracket and more Brackets errors
« on: January 14, 2023, 02:54:20 AM »
I did try to closed brackets on instance and method but I get different errors when doing that.

SciCompanion seems to show the same error. Its confusing as there is no line number to know where the code is bad and where the missing bracket should go.

doh!!
 

113
SCI Development Tools / Brackets Bracket and more Brackets errors
« on: January 13, 2023, 11:20:40 PM »
Hi guys,
Sorry for the n00b questions. I've assigned some time to try and learn SCI0 using SciStudio 3.0. I've been going through the tutorials that are online and having some issues with testing the said command.

Code: [Select]
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
        (super:handleEvent(pEvent))

(if (Said 'look>')
  (if (Said '/door')
    (Print {The door is blue!})
  else
    (if (Said '/tree')
      (Print {The tree is bright green!})
    else
      (if (Said '[ /* , !* ]')
        (Print {You are in an empty room.})
      )
    )
  )
)
; Cond version
(if (Said 'look>')
  (cond
    ((Said '/door')
      (Print {The door is blue!})
    )
    ((Said '/tree')
      (Print {The tree is bright green!})
    )
    ((Said '[ /* , !* ]')
      (Print {You are in an empty room.})
    )
  )
)

I'm getting the error: Out bracket (')') expected.

I've looked through the code but can't see where the closing bracket is needed? Any help much appreciated.


Pages: 1 ... 6 7 [8]

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.048 seconds with 19 queries.