Recent Posts

Pages: [1] 2 3 ... 10
1
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by AGKorson on Today at 10:15:05 AM »
Yeah I may have missed some things in editing.

Maybe you should have used AI to check for errors...
2
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by Kawa on Today at 10:02:27 AM »
Yeah I may have missed some things in editing.

I feel like the Display call may have broken in auto-translation. Here's a corrected version.
Code: [Select]
(Display
text
dsCOORD
(+ nsLeft (>> (- w [rect rtRIGHT]) 1))
(+ (+ nsTop (>> (- h [rect rtBOTTOM]) 1)) 1)
dsCOLOR gWndColor
dsBACKGROUND clTRANSPARENT
dsFONT font
dsWIDTH [rect rtRIGHT]
)

I think I'll go edit my first post to match.
3
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by robbo007 on Today at 09:53:50 AM »
Chapter 7

Change: (= nsBottom (+ nsTop [rect rtBOTTOM]))
To: = nsBottom (+ nsTop (| (& rect[rtBOTTOM] $FFFC) 7))
and change: (= nsRight (+ [rect rtRIGHT] nsLeft))
To: = nsRight (+ (| (& rect[rtRIGHT] $FFFC) 7) nsLeft)

Add the following code to the DButton class.
Code: [Select]
(method (draw &tmp x y x2 y2 w h [rect 4])
; Calculate the areas
(= x2 (- nsRight 8))
(= y2 (- nsBottom 8))
(= w (- nsRight nsLeft))
(= h (- nsBottom nsTop))
(TextSize @rect text font)
; Draw the side borders
(for ( (= y (+ nsTop 8))) (< y y2)  ( (= y (+ y 8))) (DrawCel 900 0 4 nsLeft y -1) (DrawCel 900 0 6 x2 y -1))
; Draw the top and bottom borders
(for ( (= x (+ nsLeft 8))) (< x x2)  ( (= x (+ x 8))) (DrawCel 900 0 5 x nsTop -1) (DrawCel 900 0 7 x y2 -1))
; Draw the corners
(DrawCel 900 0 0 nsLeft nsTop -1)
(DrawCel 900 0 1 x2 nsTop -1)
(DrawCel 900 0 2 nsLeft y2 -1)
(DrawCel 900 0 3 x2 y2 -1)
; Draw the text
(Display
text
dsCOORD
(+ nsLeft (>> (- w [rect rtRIGHT]) 1))
(+ (+ nsTop (>> (- h [rect rtBOTTOM]) 1)) 1 dsCOLOR)
gWndColor
dsBACKGROUND
clTRANSPARENT
dsFONT
font
dsWIDTH
[rect
rtRIGHT]
)
)

To go with the default custom button, we'll make the window silver.
Change: (= gWndBack clWHITE)
To: (= gWndBack clSILVER)


I think there is an issue with this. As I don't get the text on the actual buttons. (See screenshot)

I had to change the square brackets on this as it would not compile:
Code: [Select]
(= nsBottom (+ nsTop (| (& [rect rtBOTTOM] $FFFC) 7)))
(= nsRight (+ (| (& [rect rtRIGHT] $FFFC) 7) nsLeft))

4
Everything-Else / Re: ChatGPT is WRONG!
« Last post by Kawa on Today at 08:11:45 AM »
I do understand your example. You cannot possibly deny that. You yourself admit your example is simplistic, but won't (can't?) come up with a better example.

I've been claiming you don't need AI and gave several practical examples, which you conceded were true (at least "in its current form"). You're the one claiming AI is this absolutely wonderful tech that'll help devs, so the burden is on you to support your argument in turn. But all I've seen so far to that effect is a feeble attempt involving Pong ending in "no you're just blind to the brilliance".

So... whose loss?
5
Everything-Else / Re: ChatGPT is WRONG!
« Last post by cosmicr on Yesterday at 11:20:12 PM »
No you still don't understand lol.

Imagine my example, but instead of pong, it's something much more complicated, where the error isn't implicit in the output. That's why I said it was simplistic.

Nevermind, noone is forcing you to like AI models, your loss really. :D
6
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by Kawa on Yesterday at 06:50:40 PM »
I have corrected the syntax error in the fancier Gauge script, allowing it to be converted to Sierra Script, and attached it. And that concludes the first post's workload.
7
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by Kawa on Yesterday at 10:49:21 AM »
It would be good to include this post from Gumby as well

NONE OF THIS IS TESTED TO COMPILATION. I DID THIS MANUALLY.

Part 1: Parse the Verb
Code: [Select]
(= Verb UNSET) ; initialize it to 'nothing' before each parse

(if (Said 'dig/*/*>') ; ex: dig in ground with shovel
(= Verb VERB_DIG)
)

(if (Said 'dig/*[/!*]>') ; ex: dig in ground
(= Verb VERB_DIG)
(= needSecond TRUE) ; what do you want to dig in the ground with?
)

(if (Said 'dig[/!*]>') ; ex: dig
(= Verb VERB_DIG)
(= needNoun TRUE) ; what do you want to dig in?
)

Part 2: Parsing the noun & 'second' noun
Code: [Select]
(= noun UNSET) ; initialize it to 'nothing' before each parse
(if (Said '*/ground>')
(= noun GROUND_OBJ)
)

(if (Said '*/shovel>')
(= noun SHOVEL_OBJ)
)
and:
Code: [Select]
(= second UNSET) ; initialize it to 'nothing' before each parse
(if (Said '*/*/ground>')
(= second GROUND_OBJ)
)
(if (Said '*/*/shovel>')
(= second SHOVEL_OBJ)
)

Part 3: A robust 'pragmaFail' method
Code: [Select]
(procedure (RobustPragmaFail)
(if (and (== needNoun TRUE) (== noun UNSET))
(FormatPrint "What do you want to %s?" VERB_NAMES Verb)
(return TRUE)
)

(if (and (== needSecond TRUE) (== second UNSET))
(FormatPrint "What do you want to %s the %s with?" VERB_NAMES Verb NOUN_NAMES noun)
(return TRUE)
)

(if (and (== unneededNoun TRUE) (!= noun UNSET))
(FormatPrint "I understood only as far as you wanting to %s." VERB_NAMES Verb)
(return TRUE)
)

(if (and (== unneededSecond TRUE) (!= second UNSET)
(FormatPrint "I understood only as far as you wanting to %s the %s." VERB_NAMES Verb NOUN_NAMES noun)
(return TRUE)
)

(return FALSE)
)

Part 4: Are the nouns here?
Code: [Select]
;;; *************** Main.sc *************
;; global variables
Verb
noun
second
needNoun
needSecond
unneededNoun
unneededSecond

;; The array that will track where our objects are
[objectLocations10] ; one for each object in our game

;; in the init method of Main.sc
(= [objectLocations TREE_OBJ] TREE_ROOM)
(= [objectLocations SAW_OBJ] NOWHERE)
(= [objectLocations GROUND_OBJ] EVERYWHERE)
(= [objectLocations SHOVEL_OBJ] HOUSE_ROOM)
(= [objectLocations BIRD_OBJ] TREE_ROOM)
(= [objectLocations HOUSE_OBJ] HOUSE_ROOM)
(= [objectLocations DOOR_OBJ] HOUSE_ROOM)
(= [objectLocations KEY_OBJ] INVENTORY)

Code: [Select]
;; Rooms
(define INVENTORY -2)
(define EVERYWHERE -1)
(define NOWHERE 0)
;; From here, the number should match the room script numbers
(define HOUSE_ROOM 1)
(define TREE_ROOM 2)
Here's the procedure that does the checking for whether the nouns are 'in-scope':
Code: [Select]
(procedure (ValidateNouns)
(if (!= noun UNSET)
(if (and
(!= [objectLocations noun] gRoomNumber)
(!= [objectLocations noun] INVENTORY)
(!= [objectLocations noun] EVERYWHERE)
    )
(FormatPrint "I don't see any %s here." NOUN_NAMES noun)
return FALSE)
)
)

(if (!= second UNSET)
(if (and
(!= [objectLocations second] gRoomNumber)
(!= [objectLocations second] INVENTORY)
(!= [objectLocations second] EVERYWHERE)
    )
(FormatPrint "I don't see any %s here." NOUN_NAMES second)
(return FALSE)
)
)

; All the nouns are here
(return TRUE)
)

Part 5:  Call the action script
Code: [Select]
(procedure (CallAction)
(if (== Verb VERB_CUT)       (CutAction) (return))
(if (== Verb VERB_CLIMBUP)   (ClimbUpAction) (return))
(if (== Verb VERB_CLIMBDOWN) (ClimbDownAction) (return))
(if (== Verb VERB_DIG)       (DigAction) (return))
(if (== Verb VERB_LISTEN)    (ListenAction) (return))
(if (== Verb VERB_LOOK)      (LookAction) (return))
(if (== Verb VERB_RUN)       (RunAction) (return))
)
(KAWA NOTE: I'd rewrite that as a switch but maybe that's just me lol.
Code: [Select]
(procedure public (DigAction)
; Could be "dig ground with shovel"  or "dig with shovel in ground"
(if (and (!= second SHOVEL_OBJ) (!= noun SHOVEL_OBJ))
Print "That doesn't have a blade adequate for digging.")
(return)
)

(if (and (!= second GROUND_OBJ) (!= noun GROUND_OBJ))
(Print "It would be best if you dug in something sensible!")
(return)
)

(Print "Nice hole. What next?")
)

NONE OF THIS IS TESTED TO COMPILATION. I DID THIS MANUALLY.
8
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by Collector on Yesterday at 10:26:28 AM »
If I had access to edit the wiki I would help update it.

PM me your real name and an email address and I'll create an account for you.
9
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by robbo007 on Yesterday at 10:22:58 AM »
Amazing, Thanks again Kawa. Yeah the Gauge script had some changes in it. I need to go through it to find out what exactly was changed. 

If I had access to edit the wiki I would help update it.

I've converted the "Chapter 2 - Oh, yeah? Well, "%s" this!" but that was pretty easy. :http://sierrahelp.com/SCI/Tutorials/Tutorial2/chapter02.html

If someone wants to update the wiki also with this. It would be good to include this post from Gumby as well: https://sciprogramming.com/community/index.php?topic=603.msg3346#msg3346

Code: [Select]
(method (wordFail theString)
  (switch (Random 0 4)
    (0
      (FormatPrint {Oh, yeah? Well, %s this!} theString)
    )
    (1
      (FormatPrint {You may know the word %s but it's beyond the game's vocabulary!} theString)
    )
    (2
      (FormatPrint {Oh, yeah? Well, I've got your %s right here!} theString)
    )
    (3
      (FormatPrint {You don't need to type the word %s to complete this game!} theString)
    )
    (else
      (FormatPrint {Don't you ever say the word %s again!} theString)
)
)
)

(method (syntaxFail theString)
  (switch (Random 0 2)
    (0
      (Print {That doesn't appear to be a proper sentence.})
    )
    (1
      (Print {What in the hell are you talking about?})
    )
    (else
      (Print {That's probably something you could do, but this game won't!})
    )
  )
)

(method (pragmaFail theString)
  (switch (Random 0 2)
    (0
      (Print {The hell you say?})
    )
    (1
      (Print {You're too smart for this game!})
    )
    (else
      (Print {Congratulations! You have dumbfounded this game!})
    )
  )
)
10
SCI Syntax Help / Re: SCI0 - Custom buttons, windows and gauges
« Last post by Collector on Yesterday at 10:01:19 AM »
True. It is something that I have been meaning to get around to doing at some point, but never find the time. The Wiki needs this done as well.
Pages: [1] 2 3 ... 10

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

Page created in 0.047 seconds with 16 queries.