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 - Doan Sephim

Pages: [1] 2 3 ... 44
1
SCI Syntax Help / Re: Money, cash greenback
« on: August 21, 2025, 10:24:06 AM »
Before I forget to mention, there's a parser command in your main script that I suspect doesn't work as you intend.
Code: [Select]
(cond
((Said 'look>')
(cond
((Said '/carpet,down')
"Look carpet" will work, although I'm not sure why this would be in your main script...unless there's a carpet in every room in the game.
But "look down" doesn't parse as "down" I believe is an adverb. I think the game will just give the standard "look" command if the player types "look down."

Just a small observation.

2
SCI Syntax Help / Re: Money, cash greenback
« on: August 20, 2025, 11:32:21 AM »
The script will produce first what is in the roomscript, but if it is not parsed there, it will check the main script.
I put all the code you posted into my game and tested it without any error. Could you perhaps post more of your code? Sometimes it's just a missing '/' before a noun that can cause problems down the line.
If you could give me your whole main script's handleEvent method, I could take a look.

3
SCI Syntax Help / Re: Money, cash greenback
« on: August 19, 2025, 11:52:32 AM »
If you're getting bad spec returns but only in certain rooms, that would suggest that you only have syntax errors in those specific rooms. I'd look for errors there.

4
SCI Syntax Help / Re: Money, cash greenback
« on: August 14, 2025, 09:57:58 PM »
Yes, Iskovlun is correct. I use something similar in Betrayed Alliance.
Code: [Select]
(if (Said 'inv')
(gInv showSelf: gEgo)
)
(if (Said 'look>')
(cond
((= i (gInv saidMe:))
(if (i ownedBy: gEgo)
(i showSelf:)
else
(PrintDontHaveIt)
)
)
)
)
I'm using "i" instead of "temp2" but they're just variables declared in the the main script's handleEvent method, in my case:
Code: [Select]
(method (handleEvent pEvent inputNumber &tmp i)Kawa is correct that you don't need to overdo the item instances.

5
Sounds good. It certainly doesn't hurt to keep it in, either way, just to be on the safe side.

6
SCI Syntax Help / Re: SCI0 - multiple actors using same changeState
« on: July 03, 2025, 08:49:18 AM »
OK, so the script is not supposed to finish. In that case, you shouldn't dispose the script until a room change. Add it to (yourRoom newRoom:) instead. Something like:
Code: [Select]
(method (newRoom)
(myScript1 dispose:)
(myScript2 dispose:)
(super newRoom: &rest)
)
or maybe even:
Code: [Select]
(method (newRoom)
((myActor1 script:) dispose:)
((myActor2 script:) dispose:)
(super newRoom: &rest)
)
Okay, I tested both of these (and none at all) and ran a memory check in the next adjacent room. In every instance the heap memory was the same. Do you suppose the global disposal cleanup is sufficient and these extra methods are superfluous, or am I simply not using them properly and mininterpreting the data?
For clarity, I had tested them in the "instance rm273 of Rm" where I think they belong.
Thanks for troubleshooting with me.

7
SCI Syntax Help / Re: SCI0 - multiple actors using same changeState
« on: July 03, 2025, 08:32:00 AM »
Okay, got it. So don't dispose until later since I'm continually using the script while in the room. Thank you, this has been very helpful!

8
SCI Syntax Help / Re: SCI0 - multiple actors using same changeState
« on: July 03, 2025, 08:05:53 AM »
Okay. I have set up a basic script to have a couple actors walking back and forth. If I understand correctly, I cannot manually call an actor to a specific state, but everything has to be accounted for in the Script that the the actors of clients of.
Here's what I have - but after looping through the states twice, the program crashes with "Oops" message.
I tried to keep it as barebones as I could for simplicity, perhaps I left out something important?
Code: [Select]
(instance DeadwoodScript of Script
    (method (changeState newState)
        (= state newState)
        (switch state
            (0
            (if (> (client x?) 139)
            (client setMotion: MoveTo (- (client x?) 60) (client y?) self)
            else
            (self cue:)
)
            )
            (1 (= cycles 10)
                (client setMotion: 0)
            )
            (2
            (if (< (client x?) 120)
            (client setMotion: MoveTo (+ (client x?) 60) (client y?) self)
            else
            (self cue:)
)   
)
            (3 (= cycles 10)
                (client setMotion: 0)
            )
            (4
            (self changeState: 0)
                (self dispose:)
            )
        )
    )
)

9
I am trying to trim some code (for heap purposes) and I have 2 actors who rely on the same base coding for their behaviors, but I have two separate changeStates that operate essentially the same (with some minor difference like x and y positions).
I have had one hell of a time trying to figure out how to make 2 (or more) actors use the same changeState (but at different times).
Is this possible?
My idea was to create a class of Script with a changeState method, to set the script to the actors, but whenever I call the actor's script, it crashes the game.
I'm trying to call it with the following: ((actor1 script?) changeState: 1)
SCI doesn't like that at all! makes the whole program crap its pants and die!
Any insight would be greatly appreciated.

10
This was released a few days ago, but wanted to make sure it was known here if it wasn't already.
Thanks so much for announcing this! I've been meaning to do this, but man! There's been a lot going on! Thanks again, Brandon. Also, thanks doomlazer for the very kind words about the game! It is now a far better experience - visually, musically, and gameplay as well!

11
SCI Syntax Help / Re: Trying to sidestep the Restore Menu (SCI0)
« on: March 26, 2024, 10:57:39 AM »
Maybe try setting a flag for "retry", call restore and them modify the restore method like this:

Code: [Select]
(method (restore &tmp gameNum oldCursor hSound)
(= gameNum  -1)
(Load rsFONT gSaveRestoreFont)
(Load rsCURSOR gNormalCursor)
(Load rsCURSOR gLoadingCursor)
(= oldCursor (self setCursor: gNormalCursor))
(= hSound (Sound pause: 1))
(if (GetSaveDisk TRUE)
(if gPrintDlg (gPrintDlg dispose:))
                        ; handle retry
                        (if (btst fRetryFlag)
                                (= gameNum 0)
                                (bclr fRetryFlag)
                        else
        (= gameNum (Restore doit: &rest))
                        )
                        ; end handle retry
(if (!= gameNum -1)
(self setCursor: gLoadingCursor)
(if (CheckSaveGame objectName gameNum gVersion)
(gCast eachElementDo: #dispose)
(gCast eachElementDo: #delete)
(RestoreGame objectName gameNum gVersion)
else
(Print
{That game was saved under a different interpreter. It cannot be restored.}
#font
0
#button
{OK}
1
)
(self setCursor: oldCursor (HaveMouse))
(= gameNum -1)
)
)
(GetSaveDisk FALSE)
)
(Sound pause: hSound)
(return gameNum)
)

The problem is how do you know game 0 is the most recent save?
Seems to have worked simply and easily. Will have to play around a little bit to make sure there are no issues, but seems like a very easy solution. Plus, there should always be a "0" save slot since the autosave triggers at the beginning of each room, so there should be no calling on a non-existent save.

12
SCI Syntax Help / Re: Trying to sidestep the Restore Menu (SCI0)
« on: March 26, 2024, 10:42:57 AM »
The problem is how do you know game 0 is the most recent save?

Ohohohohohohohoh yeeesss X3
That's fair, but I used shorthand. I have an autosave feature that always uses the "0" slot for its save. It autosaves at the beginning of each room. The player could of course choose to save over it, but they would still be in the same room they died, so that is the game I would call.

I will definitely look through this as many people have given info for me to consider!

13
SCI Syntax Help / Re: Trying to sidestep the Restore Menu (SCI0)
« on: March 26, 2024, 10:27:41 AM »
It is worth noting that RestoreGame can fail. Try inserting some Print statements (both before and after RestoreGame) to see if the code gets called at all and to catch any errors from RestoreGame.
I would do that, but I'm not sure where it is defined. I searched for it, but didn't find. I will keep looking.

14
SCI Syntax Help / Re: Trying to sidestep the Restore Menu (SCI0)
« on: March 26, 2024, 10:13:11 AM »
The restore method is part of the "game" object. But whenever I call it using (gGame restore:) it shoots up the restore window.

I am attempting to use (RestoreGame) which I don't exactly know where that's defined, but I am trying to call it in the dying script

15
SCI Syntax Help / Trying to sidestep the Restore Menu (SCI0)
« on: March 26, 2024, 08:42:47 AM »
I'm trying to add a "Retry" button on the death dialog that will automatically restore the most recent save.
Here's what I have tried to no effect:
Code: [Select]
(repeat
(= mbResult
(Print
{Remember:\nsave early, save often!}
#title
{Words to the wise:}
#font
gDeadFont
#button
{Restore}
1
#button
{Retry}
2
#button
{Restart}
3
#button
{__Quit__}
4
)
)
(switch mbResult
(1
(if (!= (gGame restore:) -1) (return))
)
(2
(gCast eachElementDo: #dispose)
(gCast eachElementDo: #delete)
(RestoreGame objectName 0 gVersion)
(return)
)
(3 (gGame restart:) (return))
(4 (= gQuitGame TRUE) (return))
)
)
I simply added a new button called retry, and when it is clicked I copy/pasted some code from the restore method in the game script, but I am clearly missing something. Here is the code from the game script. I'm a bit out of my element when it comes to deciphering the base code, so any help would be appreciated.
Code: [Select]
(method (restore &tmp gameNum oldCursor hSound)
(= gameNum  -1)
(Load rsFONT gSaveRestoreFont)
(Load rsCURSOR gNormalCursor)
(Load rsCURSOR gLoadingCursor)
(= oldCursor (self setCursor: gNormalCursor))
(= hSound (Sound pause: 1))
(if (GetSaveDisk TRUE)
(if gPrintDlg (gPrintDlg dispose:))
(= gameNum (Restore doit: &rest))
(if (!= gameNum -1)
(self setCursor: gLoadingCursor)
(if (CheckSaveGame objectName gameNum gVersion)
(gCast eachElementDo: #dispose)
(gCast eachElementDo: #delete)
(RestoreGame objectName gameNum gVersion)
else
(Print
{That game was saved under a different interpreter. It cannot be restored.}
#font
0
#button
{OK}
1
)
(self setCursor: oldCursor (HaveMouse))
(= gameNum -1)
)
)
(GetSaveDisk FALSE)
)
(Sound pause: hSound)
(return gameNum)
)

Pages: [1] 2 3 ... 44

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

Page created in 0.062 seconds with 20 queries.