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.


Topics - Kawa

Pages: 1 [2] 3
16
The Games and other Sierra Adventure stuff / High-Resolution Packs
« on: November 09, 2015, 05:06:27 PM »
Has anyone else 'round here considered this concept as it might apply to SCI? Like, you'd take ScummVM and alter the graphics and sound code for its SCI engine to detect and substitute external data where available.

Something relatively simple might be like playing hrp/42.ogg instead of 42.snd, while something rather more involved might be drawing hrp/0_2_4.png instead of loop 2 cel 4 of 0.v56.

Just hypothetical I guess, but I doubt I'm the first here.

17
I have, in my closet, a large amount of backup DVDs, since I haven't always had an external HD and such. I thought it lost, but I found it anyway... the design docs for an attempt at a Larry 4 game that Raf wrote after I'd emailed Al Lowe for permission to make it! And god DAMN are these docs Flemish!

And not just that, but the AGS project files and such for the same are here too! Original plan was to write it in SCI, when SCI Studio 4 was released. Of course, we all know how that ended.

...all that hidden in the very first stack of many to boot!

18
SCI Community How To's & Tutorials / SCI1.1: Persistent Settings
« on: November 01, 2015, 03:18:12 PM »
Whenever you start a new game, you get these default settings for your detail, volume, and speed. Three, twelve, six respectively I believe. These values are included in savegames, as a necessity of the savegame design, but what if you have a particular volume preference and start a new game? Bam, it's back to twelve!

That won't do.

What if we could save these things in a separate file, apart from savegames, and detect and reload it when a new game starts?

In ControlIcon.sc, add this to gameControls:
Code: [Select]
(method (dispose &tmp fHnd, value)
(= fHnd FileIO fiOPEN "settings" fCREATE)
(= value (gGame _detailLevel?))
(FileIO fiWRITE fHnd @value 2)
(= value (gGamemasterVolume?))
(FileIO fiWRITE fHnd @value 2)
(= value gGEgoMoveSpeed)
(FileIO fiWRITE fHnd @value 2)
(= value gTextSpeech)
(FileIO fiWRITE fHnd @value 2)
(FileIO fiCLOSE fHnd)
(super dispose:)
)
And in Main.sc, SQ5::play, add this right between the debug trigger and (self newRoom: theStartRoom):
Code: [Select]
(= fHnd (FileIO fiOPEN "settings" fOPENFAIL)
(if (> fHnd 0)
(FileIO(fiREAD fHnd @value 2)
(= _detailLevel value)
(FileIO fiREAD fHnd @value 2)
(self masterVolume: value)
(FileIO fiREAD fHnd @value 2)
(= gGEgoMoveSpeed value)
(FileIO fiREAD fHnd @value 2)
(= gTextSpeech value)
(FileIO fiCLOSE fHnd)
)

If you restore a savegame with different settings and press Play, the saved settings will of course reflect the savegame's settings.

19
SCI Syntax Help / OnMeCheck can't see the forest for the trees
« on: October 26, 2015, 05:13:28 AM »
Picture this: a T-split in a road, leading east-west in the foreground and northbound into the background. At the far end is a building. Tall trees surround the roads, leaving open sky in the middle above the building. The player's car sits on the road in the foreground with an interesting pool of fluid around one wheel. The car, pool, trees and building each have their shapes drawn out on the control screen in red, cyan, and brown respectively, with a little silver box for the building in the distance.

In rm110::init:
Code: [Select]
(trees:init() setOnMeCheck(omcCOLORS ctlBROWN))
(aShop:init() setOnMeCheck(omcCOLORS ctlSILVER))
(aCar:init() setOnMeCheck(omcCOLORS ctlRED))
(aPuddle:init() setOnMeCheck(omcCOLORS ctlCYAN))

Later on:
Code: [Select]
(instance aPuddle of Feature
(properties
sightAngle 40
approachX 132
approachY 172
_approachVerbs V_LOOK
onMeCheck ctlCYAN
noun N_PUDDLE
)
//doVerb omitted, confirmed to work.
)
(instance aCar of Feature
(properties
approachX 160
approachY 160
_approachVerbs V_DO
onMeCheck ctlRED
noun N_CAR
)
//doVerb omitted, confirmed to work.
)
(instance aShop of Feature
(properties
onMeCheck ctlSILVER
noun N_SHOP
)
//These two don't ever trigger.
(method (handleEvent theEvent)
DebugPrint("aShop::handleEvent()")
(super:handleEvent(rest theEvent))
)
(method (doVerb theVerb)
DebugPrint("aShop::doVerb()")
(super:doVerb(rest theVerb))
)
)
(instance trees of Feature
(properties
onMeCheck ctlBROWN
noun N_TREES
)
//testing doVerb and handleEvent omitted, equally dead.
)

I can click anywhere on the actual car (not in a hot rect, but on the actual shape) or puddle to verb them, having played through the little puzzle as far as its implementation allows me to so far. Looking at the trees or shop is supposed to remark that they're "just some trees" and "probably a gas station", but all I get is the room's description.

And I say hey, what's going on?

20
I've been following the development of a certain SNES emulator up close, and earlier today I was reminded of something from a while back. It was a SNES ROM that could identify with a high degree of certainty which emulator or console revision it ran on. The challenge for this certain emulator whose author strives for accuracy was to foil the detection without resorting to blatant lies.

How this ended is ultimately irrevelant.

What is, is that this in turn reminded me of a certain difference between Sierra's SCI terps and ScummVM: the latter supports everything at once, while the former has somewhat game-specific terps. For example, King's Quest 6 has its SEQ videos, while Larry 6 has the old SCI01 menu bar, and there are at least two "magnifying glass" effects that only work in their own respective games. If you run LSL6 on the SIERRA.EXE from KQ6, it outright says AddMenu is not supported.

On the other hand, ScummVM does not seem to care as much, as long as the kernel functions are basically all uniquely numbered. There doesn't seem to be anything stopping you from using SetCursor subop 10, the magnifying glass effect in Freddy Pharkas, and the menu bar code doesn't seem to care at all. Thus, theoretically, one should be able to play videos (both SEQ and AVI?) as well as do a magnification effect, color remapping (thanks QFG4 Demo), and a menu bar to bind them all together... if you run in ScummVM.

Now imagine an SCI11 game that actually does all these things. No single SSCI terp would be able to run it, of course; only ScummVM could. But imagine you want to let those who try it anyway down gently, like a Gameboy Color game in a classic mono Gameboy. Of course, where the GBC actually lets the game ROM know outright that it's a GBC (A=11h from the get-go, easy to check), I can't think of a way for an SCI11 script to tell if it's running on ScummVM or SSCI without deliberately crashing. The first idea I had was to check for a driver file, since ScummVM doesn't use those, but that wouldn't work as well considering they can still be present...

So what method, if any, is there to detect that you're running in ScummVM so that if you're not, you can show a gentle error message and quit again. Showing the message in SCI proper would be preferred, but that's a bit out of scope.

Of course, if all of the above is wrong and I've been misinterpreting the source code all along, that's a valid answer as well ;)

21
Police Quest 3 had these, but that used the old system with Text resources and all that. Here's my take on a no-hassle implementation that supports Messages.

By the end of this, you should be able to make this:




First, define a couple talkers. I called them NEATSPEAK1 through 5.

To main.sc's locals, add these:
Code: [Select]
gNeatSpeaker
[gNeatSpeakers 5]

In Template::init, add this:
Code: [Select]
(= gNarrator templateNarrator)
(= gNeatSpeaker neatSpeaker) ; this bit
(= gWindow mainWindow)

Elsewhere -- I picked between templateNarrator and testMessager -- add this:
Code: [Select]
(class NeatNarrator of Narrator
(properties)
(method (aim target)
(= gWindow gNewSpeakWindow)
(gNewSpeakWindow
tailX: (target nsLeft?)
tailY: (- (target nsTop?) 16)
)
; TODO: detect heads and center on those instead where available.
)
)
(instance neatSpeaker of NeatNarrator
(properties)
(method (init param1)
(= font gFont)
(super init: &rest param1)
)
)

In templateNarrator::init, add
Code: [Select]
(= gWindow mainWindow)If you use other narrators or talkers too, you might want to do similarly for those.

In testMessager::findTalker, add these cases:
Code: [Select]
(NEATSPEAK1
(gNeatSpeaker aim: [gNeatSpeakers 0])
gNeatSpeaker
)
(case NEATSPEAK2
(gNeatSpeaker aim: [gNeatSpeakers 1])
gNeatSpeaker
)
(case NEATSPEAK3
(gNeatSpeaker aim: [gNeatSpeakers 2])
gNeatSpeaker
)
(case NEATSPEAK4
(gNeatSpeaker aim: [gNeatSpeakers 3])
gNeatSpeaker
)
(case NEATSPEAK5
(gNeatSpeaker aim: [gNeatSpeakers 4])
gNeatSpeaker
)

Almost there. Before you display a message, perhaps in your room's init, you can now set the gNeatSpeakers entries you'll use to those views that'll speak like that:
Code: [Select]
(= [gNeatSpeakers 0] gEgo)
(= [gNeatSpeakers 1] neatTest) ; this is the coin in the screenshot.

Of course, this'll invalidate the pointers when you change rooms, but bulletproofing that is a challenge for later.

TODO: protect from stale pointers, allow separate heads, allow speech animation, look into SCUMM-style.

22
SCI Community How To's & Tutorials / Iceman Save Scumming
« on: September 03, 2015, 05:17:18 PM »
In Codename Iceman, there's this minigame wherein your opponent doesn't let you save your way to victory. I thought I'd do a little investigation into how this is done, and it turns out to be pretty simple. Here's how:
  • In Game::replay, right after the (send gSounds:pause(0)) line near the bottom of that method, add (gRegions eachElementDo: #replay).
  • In Game::rgn, add a blank replay method. Just (method (replay)).
  • In your protected room (or region!), add a non-blank replay method. This'll trigger whenever the player restores a saved game that's set in this room.

For completeness' sake, here's basically the replay method from Iceman room 39:
Code: [Select]
(method (replay)
(if (< 2 (++ replays))
(TextPrint {The old salt looks you in the eye and says, \n\"Now lad I won't be playin' with \nye restorin' every time you lose. \nThat be cheatin'!\"})
; Screw over the player here or whatever.
else
(switch replays
(1
(TextPrint {The old salt says, \"well do ye think your little rest has changed your luck?\"})
)
(2
(TextPrint {\"You wouldn't be saving the game just to avoid losing would ye?\"})
)
)
)
)

Relatedly, sites like TVTropes report that the old salt'll remove your save game when you restore too often. I cannot in fact find anything in the actual decompilation to this effect -- only that the rum is gone.

23
SCI Development Tools / SEQ file creation and such
« on: August 15, 2015, 04:40:57 PM »
Technically you don't "import" SEQ files like you would other resources, no?

*studies ScummVM's seq_decoder.cpp*

Edit: Full frames would be the easiest to get started with. The other option is RLE.

24
The Games and other Sierra Adventure stuff / Full motion video
« on: August 15, 2015, 03:21:18 PM »
In my collection, I have exactly one game that has AVI cutscenes: King's Quest 6 CD. For a laugh, I copied HDLOGO.AVI to my SCI Companion scratchpad and removed most of the logo stuff from the title screen, repalcing that with a simple ShowMovie(0 "hdlogo.avi"), then restoring the usual palette in the next state and all that. That works, no problem. So I made it play TOON.AVI, confirming that Media Player Classic doesn't like MS Video 1 files with (certain kinds of) palette changes.

Turns out ffmpeg can't encode to MS Video 1, but luckily I have content creation programs that can export to AVI, including the option to use MS Video 1...
Quote from: ScummVM error log
Unknown tag '....' found!
Oh. What '....' though? There's no such thing in this file, as far as I can see. :-\

Fun exercise: look closely at the JUNK chunks in KQ6CD's HDLOGO.AVI file.

25
SCI Community How To's & Tutorials / SCI1.1: Thank you for playing.
« on: August 15, 2015, 09:56:33 AM »
You know how when you quit certain games you get a cute extra message at the end? That's the SetQuitStr kernel call hard at work. In my collection, I can find this used in Freddy Pharkas and Larry 6.

Quote
(c) 1993 Sierra On-Line, Inc.
Thank you for playing Leisure Suit Larry 6: "Shape Up or Slip Out!"

As always, if you liked our game, tell a friend.

If you didn't like it, keep it to yourself.
No one really values your opinion anyway!

C:\>

Now, ScummVM doesn't do anything with this call -- it's commented out -- but if that won't stop you here's what you can do. In Freddy Pharkas, the quit message is set on init, and in Larry 6 it's set on quit. I like Larry's more because it makes more temporal sense and plays fast and loose.

First, set up some messages. In message.000, add a few cutesy bullshit remarks as N_QUITMENU V_DO, in sequence. Now, in Main.sc, find your game's play method and add these three lines.
Code: [Select]
(while (not gQuitGame)
(self doit:)
)
; Add this bit --v
(= deleteMe (Memory memALLOC_NONCRIT 100))
(Message msgGET 0 N_QUITMENU V_DO 0 (Random 1 3) deleteMe)
(SetQuitStr deleteMe)
You'll notice the deleteMe variable now suddenly has a use. You might want to rename it, it's up to you. At least make sure you change the random number range to match your message file.

Now, the 100 above is straight out of Larry 6, and it slightly worries me because the message I quoted earlier is some 228 characters long not counting the prompt. But it works, so whatever. Freddy Pharkas uses [local0 120] as the target but my copy is incomplete so I can't check.

26
Everything-Else / Some random IRC jackassery
« on: August 05, 2015, 09:46:20 AM »
<HammyHammerGuy> I always follow this thought process for sandbox builders: house today, nuked tomorrow; be it either an update or by some sheer force that decides to impose itself.
<HammyHammerGuy> Always start fresh another day
<Kawa> What is this, King's Quest VI?
<HammyHammerGuy> Not quite King's Quest as there is no heir to be goned.
<Kawa> HammyHammerGuy: actually the reference is to how the KQ titles are all puns.
<Kawa> So "house today, nuked tomorrow" is a pun on "here today, gone tomorrow" -like KQ6's title is-.
<Kawa> You connected them wrong.
<HammyHammerGuy> bah
<Kawa> But oh well... to err is human.


Edit: inspired by the above conversation, here's some attachments.

27
SCI Development Tools / Talkies?
« on: July 23, 2015, 07:22:30 PM »
What, hypothetically speaking, would be required to make an SCI1.1 game with speech? The Narrator and Talker classes are already set, but how would one go about adding (support for adding) the actual lines?



Okay, just the facts I can observe right now from KQ6. Feel free to ignore this and focus on the main question.

Code: [Select]
0.msg, several lines omitted:
1 0 0 1 99 Alexander is already carrying that. 
0 0 0 1 99 There's no reason to use that object there. 
0 0 0 2 99 That would serve no purpose.   
1 1 0 1 99 Alexander searches for a way to reach the black-haired girl whose memory will not escape him.     
1 14 0 8 2 "Phew!  For a minute there I thought....  What if someone ELSE had seen me and thought....  Zounds!"
3 0 8 2 99 ...and stirs the contents gently.
4 0 0 1 99 Taking off your adventurer's cap so soon?

21.msg, for some extra data:
1 1 0 1 99 Reading about the Ancient Ones in the "Guidebook to the Land of the Green Isles" may help a puzzled journeyer.

Looking in SV, in the Audio36 resources, these map to
Code: [Select]
0  0 0 1 --> @0000000.001
0  0 0 2 --> @0000000.002
1  0 0 1 --> @0000100.001
1  1 0 1 --> @0000101.001
1 14 0 8 --> @000010e.008
3  0 8 2 --> @0000300.082
4  0 0 1 --> @0000400.001
--------
1  1 0 1 --> @00l0101.001
Contrary to first glance, these are not in hexadecimal, but hexatrigesimal -- lowercase Base36, from zero to z. Still, there's a pretty clear pattern here:
Code: [Select]
@00l010e.008
 MMMNNVV.CCS -- that's Message, Noun, Verb, Case, Sequence.

Also of note: KQ5, using regular audio resources, does = ticks DoAudio(2 temp0) instead of KQ6 and the template's = ticks DoAudio(2 temp0 temp1 temp2 temp3 temp4) in their respective (startAudio param1) methods. No idea how it maps 1.aud to text.206 #39 though, unlike KQ6.

28
The Games and other Sierra Adventure stuff / Weird asset reuses
« on: July 20, 2015, 05:34:00 PM »
I'm not talking 'bout things like fonts -- those are a given and I might 1252ify the 0.fon from Longbow next, it seems nice -- but who would've expected to find the La Costa Lotta theme from LSL6 in PQ4?

That's right, PQ4's 521.snd is an in my opinion somewhat nicer to listen to version of LSL6's 200.snd.

I have absolutely no context for its use, since I'm really just going through the resources, listening for anything nice. But this is something of a step above QFG1VGA apparently containing all the cursors from LSL5... what is it with that series?

29
SCI Syntax Help / SCI1.1: Riddle me this
« on: July 13, 2015, 10:33:22 AM »
I have in my project:
rm100Title screen
rm102Rating selection and question list
rm103Introduction cutscene
rm104Credits and exposition cutscene
rm110The first playable room that helped find that polygon bug
Normal progression is 100-102-103-104-110. I mean to put a skip feature in there but there's another problem.

I can newRoom(110) from any one of these, except for 104. Calling gGame:newRoom(110) from any point in rm104 causes an Oops error in Sierra SCI, yet passes with no issue in ScummVM.

rm104.sc:
Code: [Select]
(version 2)
(include "sci.sh")
(include "Verbs.sh")
(include "0.shm")
(exports
0 rm104
)
(use "Main")
(use "Controls")
(use "Print")
(use "Cycle")
(use "Game")
(use "View")
(use "DebugOut")
(use "Obj")
(script 104)

(local
creditNum
captionNum
timer
textBuffer[200]
)

(define CREDITS 5)
(define CAPTIONS 2) //Should be 11 but we stop early for testing

(instance public rm104 of Rm
(properties
picture 104
)

(method (init)
SetPort(0 0 200 320 0 0)
//(if (gDialog) (send gDialog:dispose()) )
(super:init())

(send gGame:handsOff())
//(send gSq5IconBar:hide() disable())
//(send gUser:
// canControl(TRUE)
// canInput(TRUE)
//)

(aRoad:init() setCycle(Fwd) setPri(4))
(aCar:init())
= creditNum 0
= captionNum 0
= timer 0

(self:setScript(rmScript))
)

(method (dispose param1)
SetPort(0 0 190 320 10 0)
//(send gSq5IconBar:hide() enable())
//= gCursor 999
//(send gGame:setCursor(996 1))
(super:dispose(rest param1))
)
)

(instance rmScript of Script
(properties)

(method (changeState newState)
(switch (= state newState)
(case 0
//(send gSq5Music1: number(1001) loop(1) play())
= seconds 4
)
(case 1
++timer
(if (== timer 2)
++creditNum
= timer 0
(if (< creditNum CREDITS)
Message(msgGET 104 0 0 0 creditNum @textBuffer)
Display(@textBuffer dsCOORD 8 48 dsCOLOR 7 dsBACKGROUND 0 dsWIDTH 168 dsFONT 0 dsALIGN alCENTER)
)
)
++captionNum
(if (< captionNum CAPTIONS)
Message(msgGET 104 1 0 0 captionNum @textBuffer)
DebugPrint("Caption: %s" @textBuffer)
Display(@textBuffer dsCOORD 8 160 dsCOLOR 7 dsBACKGROUND 0 dsWIDTH 304 dsFONT 7 dsALIGN alCENTER)
--state
)
= seconds 6
)
(case 2
(aCar:setMotion(MoveTo 350 102 self))
)
(case 3
//Play crash
//(send gSq5Music1: number(1001) loop(1) play(self))
= seconds 2
)
(case 4
(send gGame:newRoom(110))
)
)
)
)

(instance aCar of Actor
(properties
view 104
x 240
y 102
)
)

(instance aRoad of Prop
(properties
view 104
loop 1
x 184
y 111
)
)

Excerpt from rm110.sc, which works fine if not coming from rm104:
Code: [Select]
(instance public rm110 of Rm
    (properties
        picture 110
        style (| dpANIMATION_BLACKOUT dpOPEN_FADEPALETTE)
        horizon 50
        vanishingX 130
        vanishingY 50
        east 120
        noun N_ROOM
    )

    (method (init)
//AddPolygonsToRoom(@P_Default110) //commented out for ScummVM's sake
(super:init())
SetUpEgo()
(switch (gPreviousRoomNumber)
(case east
(send gEgo: posn(150 180) loop(3))
)
(default
(send gEgo: posn(150 130) loop(1))
)
)
(send gEgo:init())

(aPuddle:init())
(aCar:init())

(send gGame:handsOn())

(if (not (== (send gSq5Music1: number) scriptNumber))
(send gSq5Music1: number(scriptNumber) loop(-1) play())
)
(if (not Btest(fDayOneStart))
Bset(fDayOneStart)
(send gEgo:get(0 1)) //Give keys and manuscript
(self:setScript(IntroScript))
)(else
(self:setScript(RoomScript))
)
DebugPrint("End of Init.")
)
)

There's a DebugPrint in the first and last case of IntroScript, and one in the first case of RoomScript.
Quote
Start of IntroScript.
End of Init.
Oops!

Strangely, skipping the entire script in rm104 like this
Code: [Select]
(aRoad:init() setCycle(Fwd) setPri(4))
(aCar:init())
= creditNum 0
= captionNum 0
= timer 0

//(self:setScript(rmScript))
(send gGame:newRoom(110))
)
yields no crash at all -- it flashes an empty road for as long as the transitions take, and the game begins just fine:
Quote
Start of IntroScript.
End of Init.
End of IntroScript.
Switched to RoomScript.

And again, the crash does not happen at all in ScummVM -- only in Sierra SCI.

30
SCI Syntax Help / SCI1.1: what in the flying hell is up with walking?
« on: July 09, 2015, 11:08:10 AM »
This is complete horseshit.

I can interact with the car up to and including triggering EnterCarScript, to finally crash on trying to go a not-yet-existing room 120, but walking is completely broken -- I can't move beyond automatic approach, and clicking certain spots causes a crash. Perhaps as a hint, cycling through my verbs with the right mouse button gives a pointer as the last option before walk. That, of course, always crashes.

Code: [Select]
(version 2)
(include "sci.sh")
(include "Verbs.sh")
(include "game.sh")
(include "110.shm")
(include "110.shp")
(exports
0 rm110
)
(use "Main")
(use "DisposeLoad")
(use "Sound")
(use "Cycle")
(use "Game")
(use "Feature")
(use "View")
(use "Obj")
(use "Print")
(use "Polygon")

(script 110)

(local
lSaidNotToLeaveGreen = 0
lSaidNotToLeaveTeal = 0
)

(instance public rm110 of Rm
(properties
picture scriptNumber
style (| dpANIMATION_BLACKOUT dpOPEN_FADEPALETTE)
horizon 50
vanishingX 130
vanishingY 50
east 111
noun N_ROOM
)

(method (init)
AddPolygonsToRoom(@P_Default110)
(super:init())
SetUpEgo()
(switch (gPreviousRoomNumber)
(case east
(send gEgo:
posn(300 128)
loop(8)
cel(1)
)
)
(default
(send gEgo:
posn(150 120)
loop(8)
cel(2)
)
)
)

(aPuddle:init())
(aCar:init())

(send gEgo:init())
//(send gGame:handsOn(TRUE))
(if (not (== (send gSq5Music1: number) scriptNumber))
(send gSq5Music1: number(scriptNumber) loop(-1) play())
)
(if (not Btest(fDayOneStart))
Bset(fDayOneStart)
(send gEgo:get(0 1))
//(send gSq5IconBar:disable())
(self:setScript(IntroScript))
//(self:setScript(RoomScript))
)(else
(self:setScript(RoomScript))
)
)
)

(instance IntroScript of Script
(properties)

(method (changeState newState)
DebugPrint("IntroScript::changeState(%d)" newState)
(switch (= state newState)
(case 0
//Set Ego to play an animation of Ilira getting out of the car.
(send gEgo:view(13) loop(0) setCycle(End self))
//The setCycle(End self) bit does two things:
// ? makes the loop play once (because of the End cycler)
// ? makes End call a cue on IntroScript (self) when it's done
//End result: we switch to the next case when the animation's over.
)
(case 1
//Reset Ego, facing the car (west), and wait a bit
SetUpEgo()
//(send gEgo:view(0) loop(8) cel(1))
= seconds 2
)
(case 2
//Narrate, give the player control, and switch tracks to another script.
(send gTestMessager:say(0 0 0 1 0 scriptNumber))
//(send gGame:handsOn())
(send client:setScript(RoomScript))
//(rm110:setScript(RoomScript))
)
)
)
)

(instance RoomScript of Script
(properties)

(method (changeState newState)
DebugPrint("RoomScript::changeState(%d)" newState)
(switch (= state newState)
(case 0
DebugPrint("eech")
)
)
)

(method (doit)
(super:doit())
(if ((& (send gEgo:onControl()) ctlTEAL) and (== lSaidNotToLeaveTeal 0))
DebugPrint("Teal!")
(send gTestMessager:say(0 0 (if (Btest(fDayOneCarFixed)) C_FIXEDINTAKE)(else 0) 2 0 scriptNumber))
= lSaidNotToLeaveTeal 1
return
)
(if ((& (send gEgo:onControl()) ctlGREEN) and (== lSaidNotToLeaveGreen 0))
DebugPrint("Green!")
(send gTestMessager:say(0 0 (if (Btest(fDayOneCarFixed)) C_FIXEDINTAKE)(else 0) 3 0 scriptNumber))
= lSaidNotToLeaveGreen 1
return
)
)

(method (handleEvent pEvent)
DebugPrint("handleEvent $%x" (send pEvent:type))
(super:handleEvent(pEvent))
)
)

(instance EnterCarScript of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(case 0
= seconds 1
)
(case 1
(send gTestMessager:say(N_CAR V_DO C_FIXEDINTAKE 1 0 scriptNumber))
(send gSq5Music2: number(8) loop(-1) play())
= seconds 4
)
(case 2
(send gTestMessager:say(N_CAR V_DO C_FIXEDINTAKE 2 0 scriptNumber))
= seconds 1
(send gSq5Music2: fade())
(send gGame:newRoom(120))
)
)
)
)
 
(instance aPuddle of Feature
(properties
//x 248
//y 65
nsLeft 80
nsTop 125
nsRight 125
nsBottom 133
sightAngle 40
approachX 128
approachY 126
_approachVerbs V_LOOK
noun N_PUDDLE
)

(method (doVerb theVerb)
(switch (theVerb)
(case V_LOOK
(send gTestMessager:say(N_PUDDLE V_LOOK (if (Btest(fDayOnePuddleChecked)) C_CHECKEDPUDDLE)(else 0) 1 0 scriptNumber))
Bset(fDayOnePuddleChecked)
)
(default
(super:doVerb(rest theVerb))
)
)
)
)

(instance aCar of Prop
(properties
view 111
loop 0
cel 0
x 114
y 128
approachX 128
approachY 126
_approachVerbs V_DO
noun N_CAR
signal (| fixPriOn ignAct)
priority 0
)

(method (init)
DebugPrint("aCar::init()")
(super:init())
)

(method (doVerb theVerb param2 param3)
DebugPrint("aCar::doVerb(%d %d %d" theVerb param2 param3)
(switch (theVerb)
(case V_DO
(if (not Btest(fDayOnePuddleChecked))
(send gTestMessager:say(N_CAR V_DO 0 1 0 scriptNumber))
)(else (if (not Btest(fDayOneCarFixed))
(send gTestMessager:say(N_CAR V_DO C_CHECKEDPUDDLE 1 0 scriptNumber))
//Show inset
DebugPrint("Pretending you fixed it now.")
Bset(fDayOneCarFixed)
)(else
(send gGame:handsOff())
(rm110:setScript(EnterCarScript))
))
)
(case V_TALK
(send gTestMessager:say(N_CAR V_TALK (if (Btest(fDayOneCarFixed)) C_FIXEDINTAKE)(else 0) 1 0 scriptNumber))
)
(default
(super:doVerb(rest theVerb))
)
)
)
)

Pages: 1 [2] 3

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

Page created in 0.134 seconds with 19 queries.