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
Sounds good. It certainly doesn't hurt to keep it in, either way, just to be on the safe side.

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

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

4
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:)
            )
        )
    )
)

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

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

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

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

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

10
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

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

12
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,


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

14
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

15
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

Pages: [1] 2 3 ... 44

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

Page created in 0.039 seconds with 21 queries.