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 - MusicallyInspired

Pages: 1 ... 102 103 [104] 105 106 ... 118
1546
SCI Syntax Help / Re: Is my game corrupt?
« on: August 26, 2010, 07:55:36 PM »
Well, not exactly. But I think we're closer now. I tried sending it straight to the third room and it doesn't crash. But I remembered that it doesn't crash in the second room either when there are no instances at the bottom of the script.

So I removed ALL music references (cuing, fading, stopping, everything. no music) from both scripts to see what happens. And the result is when it switches to room 2 the output is a stack overflow at titleTwo. Any idea what that could mean?

1547
SCI Syntax Help / Re: Is my game corrupt?
« on: August 26, 2010, 07:43:07 PM »
Ah that could be it! Thanks, I'll try it!

1548
SCI Syntax Help / Re: Is my game corrupt?
« on: August 26, 2010, 03:51:34 PM »
I'm getting some really strange debug window characters here. Something is definitely wrong. Maybe I should start over again with a brand new template game.

EDIT: ARGGG. I tried starting from scratch with a new template game and I'm STILL getting these bizarre crashes. It must be a scripting issue but I just don't see anything that could possibly be crashing the game and I don't know how else to script these things.

1549
SCI Syntax Help / Cuing code with sound resource cues
« on: August 26, 2010, 02:51:39 PM »
So I'm playing around with sound resources and scripts. After successfully creating a custom sound resource in Soundbox fully compatible with Adlib, MT-32, Tandy 3-Voice, and the PC Speaker, I wanted to start utilising the sound resource's cue ability. You can set the Sound resource's cue points and their data with Soundbox. That I did no problem. What I have a problem with is figuring out how to use this in a script. I've been mulling over the Sound class and sound-related kernel functions but it's not coming easy to me.

I'll be using this thread to post any of my findings and discoveries. If anybody else has some insight please feel free to post it here.

1550
SCI Syntax Help / Re: Question re: SCI Studio Help code snippet
« on: August 26, 2010, 11:41:03 AM »
I just tried compiling my Main script with  inventory instances that use a similar Said property and it failed saying that "~" and "AND" aren't in the vocabulary. Strange.

1551
SCI Syntax Help / Re: Is my game corrupt?
« on: August 25, 2010, 05:38:33 PM »
Code: [Select]
sciv.exe -d
When it crashes it brings up the debug mode and shows exactly what object crashes the game. Problem is it doesn't help with my issue as it just seems like a bunch of random characters...leading me to believe that it's being compiled incorrectly somehow.

1552
SCI Syntax Help / Re: Is my game corrupt?
« on: August 25, 2010, 05:21:06 PM »
I copied those codes from Companion's "View Syntax Tree" function so it probably added those extra parentheses. Yes, if I don't do debug mode it gives me the "Oops!" message.

As far as the bits of code I removed, I removed them because they give away stuff. I suppose I can just rename them.

Thanks for the DrawPic thing. I don't remember why I used Animate. It was suggested to me years ago for KQ2SCI. Probably on the Mega-Tokyo boards.

The View Syntax Tree function is also responsible for creating two Local sections. They shouldn't even be in that script, actually. So I've removed them. Here is the unadulterated scripts that crash the game when compiled with Companion and run just fine when compiled with Studio.

Code: [Select]
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script TITLESCREEN_SCRIPT)
/******************************************************************************/
(use "main")
(use "game")
(use "menubar")
(use "obj")
(use "cycle")
(use "user")
(use "controls")
(use "feature")
/******************************************************************************/
(instance public TitleScreen of Rm
(properties
picture scriptNumber
)
(method (init)
        // Set up the title screen
ProgramControl()
= gProgramControl FALSE
(send gGame:setSpeed(7))
(SL:disable())
(TheMenuBar:hide())

(super:init())
(self:setScript(RoomScript))

DrawPic(800 dpOPEN_CENTEREDGE)

(send gEgo:
init()
hide()
)
 
        /****************************************
         * Set up the room's music to play here *
         ****************************************/
(send gTheMusic:
prevSignal(0)
stop()
number(0)
loop(0)
play()
)       

        /**************************************************
         * Add the rest of your initialization stuff here *
         **************************************************/
         (Wolf:init()hide()setLoop(0))
)
)
/******************************************************************************/
(instance RoomScript of Script
(properties)     
    (method (changeState newState)
= state newState
(switch(state)
(case 0
(= cycles 1)
ProgramControl()
= gProgramControl TRUE
)
(case 1 = cycles 1
(send gGame:setCursor(997 0))
)
(case 2 = seconds 6

)
(case 3
(Wolf:show()setCycle(Fwd)setMotion(MoveTo 215 156 RoomScript))
)
(case 4 = cycles 30
(Wolf:loop(1)cel(0)cycleSpeed(1)setCycle(End))
)
(case 5 = cycles 15
(Wolf:dispose())
DrawPic(801 dpOPEN_TOP dpCLEAR gDefaultPalette)
(Moon:init())
)
(case 6 = cycles 10
(Moon:setCycle(End))
)
(case 7 = seconds 2
(Infamous:init())
)
(case 8 = seconds 4
(Adventures:init())
)
(case 9 = seconds 1
(Infamous:dispose())
(Adventures:dispose())
)
(case 10
(Moon:setLoop(0)setCel(4)setCycle(Beg RoomScript))
)
(case 11 = cycles 10
(Moon:hide())
)
(case 12
(send gGame:newRoom(803))
)
)
)
(method (doit)
(super:doit())
// code executed each game cycle
)
(method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if (== (send pEvent:type) evKEYBOARD)
            (switch(send pEvent:message)
            (case KEY_ESCAPE
            (send gTheMusic:fade())
(send gGame:newRoom(803))
)
(case KEY_RETURN
(send gTheMusic:fade())
(send gGame:newRoom(803))
)
)
)
)
)
/******************************************************************************/
(instance Wolf of Act
(properties
view 903
x 310
y 156
loop 0
cycleSpeed 0
)
)
(instance Moon of Prop
(properties
x 160
y 60
view 900
loop 1
cel 0
cycleSpeed 0
)
)
(instance Infamous of Prop
(properties
x 160
y 146
view 901
)
)
(instance Adventures of Prop
(properties
x 160
y 178
view 902
)
)

The crash room:

Code: [Select]
/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 803)
/******************************************************************************/
(use "Controls")
(use "Cycle")
(use "Door")
(use "Feature")
(use "Game")
(use "Inv")
(use "Main")
(use "Obj")
/******************************************************************************/
(instance public rm803 of Rm
(properties
picture scriptNumber
north 0
east 0
south 0
west 0
)
(method (init)
(super:init())
(self:setScript(RoomScript))
(titleOne:init()setCel(0))
(titleTwo:init()setCel(1))
(titleThree:init()setCel(2))

(switch(gPreviousRoomNumber)
(default
DrawPic(803 dpOPEN_CENTEREDGE)
)
)
(send gEgo:init()hide())
)
)
/******************************************************************************/
(instance RoomScript of Script
(properties)

(method (doit)
(super:doit())
// code executed each game cycle
)

(method (handleEvent pEvent)
(super:handleEvent(pEvent))
// handle Said's, etc...
(if (== (send pEvent:type) evKEYBOARD)
            (switch(send pEvent:message)
            (case KEY_ESCAPE
            (send gTheMusic:fade())
(send gGame:newRoom(802))
)
(case KEY_RETURN
(send gTheMusic:fade())
(send gGame:newRoom(802))
)
)
)
)

(method (changeState newState)
(= state newState)
(switch (newState)
(case 0
(= cycles 1)
ProgramControl()
= gProgramControl TRUE
)
(case 1 = cycles 1
(send gGame:setCursor(997 0))
)
(case 2 = seconds 5

)
(case 3
(send gGame:newRoom(802))
)
)
)
)
/******************************************************************************/
(instance titleOne of Prop
(properties
x 76
y 139
view 904
)
)
(instance titleTwo of Prop
(properties
x 158
y 139
view 904
)
)
(instance titleThree of Prop
(properties
x 235
y 134
view 904
)
)

Neither program gives a compiling error. It's just bizarre. I don't see anything that could possibly break it either. Unless there's something in another script (like main or game or something) that screws things up. But I haven't made any big changes anywhere else...

1553
SCI Syntax Help / Re: The Toggle Sound Issue (F2)
« on: August 25, 2010, 04:05:53 PM »
Ok, never mind. It seems to work now. Just last week it wasn't working at all. Weird.

1554
SCI Syntax Help / Re: Is my game corrupt?
« on: August 25, 2010, 02:45:19 PM »
Hmm, actually that second room had some Instances at the bottom that weren't being used yet so I just deleted them from the code snippet I posted. When I actually commented them out the room loaded fine. Soon as I put them back in the game crashes again. Even if I do something with them in the script. Any idea why that would happen?

EDIT: I tried compiling the same script in SCI Studio and the game runs flawlessly. It must be an issue with SCI Companion. The first one I've ever run into.

1555
SCI Syntax Help / Is my game corrupt?
« on: August 25, 2010, 02:19:02 PM »
This game I'm working on crashes consistently when making a seemingly routine switch to a new title screen room after the initial logo screen. I ran it in debug mode and this is what it gives me:




And it seems to be random every time depending on if I skip the sequence with enter, skip it with escape, or let it play through:





Here are the scripts for the previous room and the room it crashes on when it switches:

Code: [Select]
(include "sci.sh")
(include "game.sh")
(use "main")
(use "game")
(use "menubar")
(use "obj")
(use "cycle")
(use "user")
(use "controls")
(use "feature")
(script TITLESCREEN_SCRIPT)

(instance TitleScreen of Rm
    (properties
        picture scriptNumber
    )
    (method (init)
        ProgramControl()
        = gProgramControl FALSE
        (send gGame:setSpeed(7))
        (SL:disable())
        (TheMenuBar:hide())
        (super:init())
        (self:setScript(RoomScript))
        (Animate((DrawPic(800 dpOPEN_CENTEREDGE))))
        (send gEgo:init() hide())
        (send gTheMusic:prevSignal(0) stop() number(0) loop(0) play())
        (Wolf:init() setLoop(0) hide())
    )


)
(instance RoomScript of Script
    (properties)
    (method (changeState newState)
        = state newState
        (switch ((state))
            (case0
                (= cycles 1)
                ProgramControl()
                = gProgramControl TRUE
            )
            (case1
                = cycles 1
                (send gGame:setCursor(997 0))
            )
            (case2
                = seconds 6
            )
            (case3
                (Wolf:show() setCycle(Fwd) setMotion(MoveTo 215 156 RoomScript))
            )
            (case4
                = cycles 30
                (Wolf:setLoop(1) setCel(0) cycleSpeed(1) setCycle(End))
            )
            (case5
                = cycles 15
                (Wolf:dispose())
                DrawPic(801 dpOPEN_TOP dpCLEAR gDefaultPalette)
                (Moon:init())
            )
            (case6
                = cycles 10
                (Moon:setCycle(End))
            )
            (case7
                = seconds 2
                (Infamous:init())
            )
            (case8
                = seconds 4
                (Adventures:init())
            )
            (case9
                = seconds 1
                (Infamous:dispose())
                (Adventures:dispose())
            )
            (case10
                (Moon:setLoop(0) setCel(4) setCycle(Beg RoomScript))
            )
            (case11
                = cycles 10
                (Moon:dispose())
            )
            (case12
                (send gGame:newRoom(803))
            )
        )
    )


    (method (doit)
        (super:doit())
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if (== (send pEvent:type) evKEYBOARD)
            (switch ((send pEvent:message))
                (caseKEY_ESCAPE
                    (send gTheMusic:fade())
                    (send gGame:newRoom(803))
                )
                (caseKEY_RETURN
                    (send gTheMusic:fade())
                    (send gGame:newRoom(803))
                )
            )
        )
    )


)
(instance Wolf of Act
    (properties
        view 903
        x 310
        y 156
        loop 0
        cycleSpeed 0
    )
)
(instance Moon of Prop
    (properties
        x 160
        y 60
        view 900
        loop 1
        cel 0
        cycleSpeed 0
    )
)
(instance Infamous of Prop
    (properties
        x 160
        y 146
        view 901
    )
)
(instance Adventures of Prop
    (properties
        x 160
        y 178
        view 902
    )
)

The room it crashes on upon loading:

Code: [Select]
(include "sci.sh")
(include "game.sh")
(use "Controls")
(use "Cycle")
(use "Door")
(use "Feature")
(use "Game")
(use "Inv")
(use "Main")
(use "Obj")
(script 803)
(local dGrahamYolk = 0 )
(local dFortuneYolk = 0 )


(instance rm803 of Rm
    (properties
        picture scriptNumber
        north 0
        east 0
        south 0
        west 0
    )
    (method (init)
        (super:init())
        (self:setScript(RoomScript))
        (switch ((gPreviousRoomNumber))
            (default
                (Animate((DrawPic(803 dpOPEN_CENTEREDGE))))
            )
        )
        (send gEgo:init() hide())
    )


)
(instance RoomScript of Script
    (properties)
    (method (doit)
        (super:doit())
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if (== (send pEvent:type) evKEYBOARD)
            (switch ((send pEvent:message))
            )
        )
    )


    (method (changeState newState)
        (= state newState)
        (switch ((newState))
            (case0
                (= cycles 1)
                ProgramControl()
                = gProgramControl TRUE
            )
            (case1
                = cycles 1
                (send gGame:setCursor(999 0))
            )
            (case2
                = seconds 2
            )
            (case21
                (send gGame:newRoom(802))
            )
        )
    )


)

1556
SCI Syntax Help / The Toggle Sound Issue (F2)
« on: August 24, 2010, 11:36:53 PM »
So in the Template Game, toggling sound is broken and has been since day one. Since barely anybody really pays much attention to sound support in SCI games I doubt anyone's noticed. But when you disable sound (whether with F2 or the menubar) you can never enable it again. I'm not sure why, but I'm looking into it. Perhaps a new set of eyes would reveal something I'm not seeing.

1557
SCI Syntax Help / Re: Question re: SCI Studio Help code snippet
« on: August 24, 2010, 11:31:37 PM »
I think it's the string which defines an inventory object when you try to interact with it with the parser. So "look gem" and "look glowing gem" will function. Otherwise it won't work (which it doesn't for any of my current inventory items in KQ2SCI). Also, Inventory items are somehow tied to props which can be on the screen. The way Brian did it (or Sierra?) was that a player could drop an inventory object and it would appear on screen. So there might be some kind of shared script stuff there....as opposed to the natural way I'd look at it as completely separate bits of code that look like they belong together to the player.

I don't know if I'm making any sense.

A little snip from the SCI Studio help file regarding the InvI class:

Quote
bool saidMe()
Returns TRUE is the user's input "Said" the name of the inventory item. Otherwise, FALSE.
 

This doesn't seem to work in the template game even if the said property is defined.

1558
SCI Syntax Help / Re: Question re: SCI Studio Help code snippet
« on: August 23, 2010, 12:25:56 PM »
Hey! Maybe that has something to do with the said words in the Inv script for each inventory obeject that didn't ever seem to do anything! You can't just type "look at gem" if you have it in your inventory. You have to actually open your inventory window and select it to look at it. I was going to program a bunch of global said statement procedures to get it to work.

Brian! Why didn't you document these things????

1559
SCI Syntax Help / Re: How to use Qualifying Adjectives with the parser?
« on: August 21, 2010, 11:10:42 PM »
you can't "take" it but you do "buy" it from Fester's store. And on a recent playthrough test for ScummVM I did indeed type "buy orat on a stick" and it worked.

1560
SCI Syntax Help / Re: Disabling Save/Restore
« on: August 20, 2010, 01:24:39 PM »
Never mind, I've figured it out. You have to go to the Game header file (game.sh) and renumber the menu functions there. This'll be handy for others who can't figure it out...

Pages: 1 ... 102 103 [104] 105 106 ... 118

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

Page created in 0.074 seconds with 20 queries.