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 ... 43
1
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!

2
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.

3
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!

4
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.

5
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

6
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)
)

7
SCI Syntax Help / Re: SCI0: right click to look like in QFG2
« on: March 18, 2024, 11:49:08 AM »
Here's what I do in Betrayed Alliance. It might not be the most efficient code, but it works for me well enough.
First I will make a procedure:
Code: [Select]
(procedure (checkEvent pEvent x1 x2 y1 y2)
(if
(and
(> (pEvent x?) x1)
(< (pEvent x?) x2)
(> (pEvent y?) y1)
(< (pEvent y?) y2)
)
(return TRUE)
else
(return FALSE)
)
)
I will reference this procedure in the handleEvent method in this way:
Code: [Select]
(if (== (pEvent type?) evMOUSEBUTTON)
(if (& (pEvent modifiers?) emRIGHT_BUTTON)
(if (checkEvent pEvent 92 123 65 117) ; clicked within the box of these coordinates
(PrintOther 18 6)
)
You can also reference the coordinates of a view this way:
Code: [Select]
(checkEvent pEvent (mapItem nsLeft?) (mapItem nsRight?) (mapItem nsTop?) (mapItem nsBottom?))
(PrintOther 18 24)
)
You can also check to see if the click happened on a control color:
Code: [Select]
(if
(== ctlGREY (OnControl ocSPECIAL (pEvent x?) (pEvent y?)))
(PrintOther 18 77)
)
Or on a priority color:
Code: [Select]
(if
(== ctlYELLOW (OnControl ocPRIORITY (pEvent x?) (pEvent y?)))
(PrintOther 18 78)
)
This is what works for me. Perhaps when I start a new project, I'll look into having something more global, but this does the trick for now,


8
SCI Syntax Help / Re: Parsing lone nouns
« on: February 02, 2024, 02:56:58 PM »
It appears the answer may just be '/somenoun', considering how Rumplestiltskin is implemented in KQ1.
Wow! Sometimes I feel SOOOOO dumb! That works easily. Thank you for the prompt answer.

9
SCI Syntax Help / [SOLVED] Parsing lone nouns
« on: February 02, 2024, 02:24:48 PM »
Does anyone know how to parse lone nouns without using a verb?

I want the player to be able to answer a question by just answering with a noun, but it gets caught up in a syntax error since it's not a complete command.

Thanks

10
SCI Syntax Help / Re: Is there no cond in Studio Script?
« on: July 15, 2023, 12:23:19 AM »
Did you use the conversion built into Companion? Probably a lot of work to fix what gets broken by it, but it might do a lot of the work for you.
Yes, I had tried that in the past but it was quite a lot of headache...too much for me at the time... probably too much work still. But now I'm feeling like I'm missing out on something important not being able to use cond to make this simple and elegant code for looking at inv items

11
SCI Syntax Help / Re: Is there no cond in Studio Script?
« on: July 14, 2023, 02:04:46 PM »
Ah, how regrettable...serves me right for never converting to Sierra Script!

12
SCI Syntax Help / Is there no cond in Studio Script?
« on: July 13, 2023, 07:22:27 PM »
Don't crucify me here! Yes, I'm coding Betrayed Alliance Book 1 is Studio Script, but only because the project is older than Sierra Script and the migration process would be more burdensome than it's worth. Don't worry, Book 2 is in Sierra Script!

All that said. I was trying to migrate the "look/item" from Book 2 into book 1 and hit a snag...apparently there is no "cond" conditional in Studio Script! Does anyone know if there is a functional alternative? I'm trying to migrate the following code over:
Code: [Select]
(if (Said 'look>')
(cond
((= i (gInv saidMe:))
(if (i ownedBy: gEgo)
(i showSelf:)
else
(PrintDontHaveIt)
)
)
)
)

13
SCI Syntax Help / Re: [SOLVED] SCI0 - Autosave
« on: July 12, 2023, 07:49:51 PM »
Does the change directory button in the restore dialog cause the same crash?
Yes it does...well, it did until I removed it

14
SCI Syntax Help / Re: [SOLVED] SCI0 - Autosave
« on: July 12, 2023, 07:07:00 PM »
Yeah, it sounds like removing that button is really just papering over a latent problem.
I agree, but it's the best available solution for now, and it's one that is easy to reverse if/when the time comes. It's also a very low cost to pay seeing as how I think it is very few people who even use that availability. Plus it does save ever so slightly on heap  ;D

15
SCI Syntax Help / Re: [SOLVED] SCI0 - Autosave
« on: July 12, 2023, 10:48:34 AM »
Thanks Kawa! With you pointing me to the correct script, I was able to remove the change directory stuff. Loses a touch of old school authenticity but I don't think anyone will mind. Also, can't crash the game if you can't push the button  ;D

Pages: [1] 2 3 ... 43

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

Page created in 0.061 seconds with 20 queries.