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] 4 5 ... 33
31
SCI Syntax Help / [SOLVED] SCI0 - Autosave
« on: December 27, 2020, 10:42:15 AM »
How difficult would it be to create an autosave function that runs whenever the player enters a new room?

Ideally, it would always replace the previous autosave file and be located at the top of the restore window with the name "autosave"

I'm looking in the Game script and found the Save method, but I'm not sure how to call this method without producing a window. I'd like this to go on "behind the scenes," as it were.

Code: [Select]
(method (save &tmp [strDescBuf 20] gameNum oldCursor hSound)
(Load rsFONT gSaveRestoreFont)
(Load rsCURSOR gLoadingCursor)
(= oldCursor (self setCursor: gNormalCursor))
(= hSound (Sound pause: 1))
(if (GetSaveDisk TRUE)
(if gPrintDlg (gPrintDlg dispose:))
(= gameNum (Save doit: @strDescBuf))
(if (!= gameNum -1)
(= oldCursor (self setCursor: gLoadingCursor 1))
(if
(not (SaveGame objectName gameNum @strDescBuf gVersion))
(Print
{Your save game disk is full. You must either use another disk or save over an existing saved game.}
#font
0
#button
{OK}
1
)
)
(self setCursor: oldCursor (HaveMouse))
)
(GetSaveDisk FALSE)
)
(Sound pause: hSound)
)

Not having a feature like this isn't a big deal and I place a low priority on implementing it, but it certainly would be nice!

I'm going to experiement with this bit of code here, but if anyone has better ideas or guiding thoughts, let me know.

Code: [Select]
(SaveGame objectName gameNum @strDescBuf gVersion))

32
SCI Syntax Help / Re: Telephones
« on: December 17, 2020, 08:51:56 AM »
Thanks! Yes the buttons press in with a satisfying glitchy 8-bit clicking sound.
Also thanks for your constructive criticism, I've added some lines of dark grey + black dithering and it looks much better!
Nice! I'm looking forward to seeing more of your project as things develop!

33
Sorry I'm so late, but I was playing through SoA the other day and wanted to leave my impressions.

Disclaimer - I never finished the demo and since there was 0 out of 0 puzzle points, I have no idea if I was even close to the end. My guess was I wasn't. I made it as far as I could without looking into the game's code.

Things I loved:
- Music - The music was really well done. It was understated and I felt it worked really well in not "getting in the way." I also thought the way it transitioned from the first room to the cutscene where the elder of the Sect gives you your marching orders blended really well.
- The Abilities - The Nudge, Cool, Heat, Sense, and Recall abilities are a really cool gameplay mechanic.
- The Hint System - I love having this as an option as I found the difficulty of this game to be fairly high, and the hint system was very nice. It's great you can toggle it on and off as well.
- The First Room in Llieven - Having a simple room with something to do to familiarize the player with the abilities was nice.

Small things I noticed while playing:
- The opening room has 2 items - the Psiblade and Reader. These were both fairly arcane objects and I didn't know what to do with them, if anything. Having my first inventory items strange things I didn't know what to do with I found a little disorienting.
- The opening room also had a drawer, which the game says is the only drawer he used for his meager possessions. When opened, I coudln't quite make out what was inside the drawer, and when I typed "look in drawer" it said something like, "It's already open." I left the room without taking anything from the drawer (and I don't think there was anything in there I needed!). I felt like I was missing something because the game dismissed two drawers, but made the top one feel important, so when I left without taking anything from it, it felt like I was doing something wrong.
- The first time I played, I left the first room in Llieven not knowing what to do about the bag and the ice, if anything. I didn't really understand the abilities, so I didn't try them. I didn't know if I needed to come back later with an item or what. I wonder if it would be good to somehow trap the player in the first room and the only way to get out would be to nudge something, and hint fairly obviously at that. That way the first room would teach them to use the abilities, which then might in turn click their aha! button to use those abilities on the bag and ice.
- I found the machine with the controls, spider release, and buttons a little confusing.
- At some point a transport appeared and when I looked in I got the idea that there was a code I was supposed to get, but I couldn't figure out how.
- I remember getting something with the coin...it must've been a tool of some kind, but after getting the coin, unlocking the bathroom, washing hands, and buying the tool, I don't think I got any farther. I never discovered what I was supposed to do in the food area or with the transport.

Even with the hint system I ended up getting stuck. That being said, I am VERY bad at adventure games in general, so treat me like an 8-year old when it comes to adventure game puzzles. I don't think I've ever beaten a single one with outside help.

34
SCI Syntax Help / Re: Telephones
« on: December 16, 2020, 08:24:38 AM »
Great artwork! That looks really fantastic! Do the buttons press in when you click on them?

One small critique - the bottom left corner of the phone stand looks much more squared than the bottom right corner, which looks rounded.
EDIT: I think it's actually not the corner itself, but that there is no gradient in the shading underneath

35
SCI Community How To's & Tutorials / Re: Retry/Restore/Quit Death Dialog
« on: December 14, 2020, 03:55:33 PM »
Inspired by what Charles posted here, but hopelessly frustrated by the errors due to naming conventions and other problems I was encountering, I set to work on making my own version of the death page. And as you can see from the attached picture, I've come up with something that essentially works! Charles' code was very helpful of course, and even though it doesn't have the red letters, I'd prefer a small script anyway.

The only problem, I set it up in a regular old Room Script. Anything more complicated than a Room or Region, and I'm fairly out of my depth. I did make a small effort to translate this to the main Script, but I failed.

The script uses just one global variable - an array with numbers that starts off (0) and turns on (1) when ego dies. To keep these variables true after restoring the game, I write them to an external file (thanks kawa).

So here is my request if anyone is willing to help. Could someone help me transcribe this to a non-Room Script, something that I can call from the Menubar?

Code: [Select]
;;; Sierra Script 1.0 - (do not remove this comment)
; Broken Bridge Forest
(script# 210)
(include sci.sh)
(include game.sh)
(use controls)
(use cycle)
(use feature)
(use game)
(use inv)
(use main)
(use obj)
(use window)
(use menubar)

(public
rm210 0
)

(local
deathWindowOpen = 0 ; Used as a switch to determine when you can close the deathWindow
deathWindow ; Used to open the display window
i = 0 ; Used in the "for"
textDown = 7 ; Used to place statements progressively lower than earlier statements
textRight = 20 ; Used to move statements right, once y-axis full - NOT YET IMPLEMENTED
[str 30] ; String for pulling text resources
)

(instance rm210 of Rm
(properties
picture scriptNumber
north 0
east 211
south 0
west 215
)

(method (init)
(super init:)
(self
setScript: RoomScript
)
(switch gPreviousRoomNumber
(else
(gEgo init: posn: 32 96)
)
)
(SetUpEgo)

)
)

(instance RoomScript of Script
(properties)

(method (changeState mainState)
(= state mainState)

)

(method (handleEvent pEvent)
(super handleEvent: pEvent)

; removes the window AND dsiplay text! I'm not sure why it disposes the display though.
(if (== deathWindowOpen 1)
(DisposeWindow deathWindow)
(= deathWindowOpen 0)
(= textDown 7)
)
(if (== (pEvent type?) evMOUSEBUTTON)
)
(if(Said 'show/death')
(= deathWindowOpen 1)
(= deathWindow (NewWindow
0
0
190
318
{Death Count}
nwNORMAL
15 ; priority
7
15
))
; For loop to run through the gDeath array and print a statement of death for each that is true
(for ( (= i 0)) (< i 9)  ( (++ i)) (if (> [gDeaths i] 0)
(switch i
(0
(Display
(Format @str {You have died %u times:} [gDeaths 0])
dsCOORD 10 textDown
)
(= textDown (+ textDown 12))
)
(1
(deathCountIterator)
)
(2
(deathCountIterator)
)
(3
(deathCountIterator)
)
(4
(deathCountIterator)
)
(5
(deathCountIterator)
)
(6
(deathCountIterator)
)
(7
(deathCountIterator)
)
)
)
)
)
)
)

(procedure (deathCountIterator)
(Display
(Format @str 650 i)
dsCOORD 20 textDown
dsFONT 4
)
(= textDown (+ textDown 9))
)

36
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 13, 2020, 02:38:25 PM »
I'm going to go ahead and call this on solved! Thanks to Kawa who did all the heavy lifting. You have now provided me with 1 more tool to play with  ;D

37
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 13, 2020, 01:54:37 PM »
Okay! I have the code reading the file numbers into the variables now, so that's good! I'm just not finding the right place to PUT that code. I originally was putting in the Game script's "replay" method, but I don't think that's the right place. I'll keep looking.

So this is getting tricky. Basically, I don't think there is any method or procedure that runs exclusively when you restore the game, which is where I would need to put the code to re-orient the variables.
But Game::replay (in game.sc) is almost explicitly what the engine invokes when you restore a game.

It actually invokes Template::replay (in main.sc, class name may vary), but that calls Game::replay at the end. Either one of them should be a fine place to put the "reload variables from persist.tmp" code.

Sounds good! I'll defer to your knowledge and give it another looking into. It would obviously be far superior than my convoluted workaround!

EDIT: Success! It does seem to work just right in the Main Script. Although I think I tried it before, I must have put the code in the wrong place:

Code: [Select]
(method (replay)
(TheMenuBar draw:)
(SL enable:)
        ; PUT IT HERE
(if (DoSound sndSET_SOUND)
(SetMenu MENU_TOGGLESOUND #text {Turn Off})
else
(SetMenu MENU_TOGGLESOUND #text {Turn On})
)
(super replay:)
; DON"T PUT IT HERE

)

38
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 13, 2020, 11:50:41 AM »
Okay! I have the code reading the file numbers into the variables now, so that's good! I'm just not finding the right place to PUT that code. I originally was putting in the Game script's "replay" method, but I don't think that's the right place. I'll keep looking.

So this is getting tricky. Basically, I don't think there is any method or procedure that runs exclusively when you restore the game, which is where I would need to put the code to re-orient the variables.

So the work-around would be to set up a variable (gRestoringTheGame) which I set to TRUE when I restore the game. Then in the Main Script's doit method, I check if this variable is true, run the "read the variable from the temp file" code, then set gRestoringTheGame back to FALSE.

Of course, the obvious hurdle I forgot about was that gRestoringTheGame ITSELF would be set back to FALSE upon the restore of the game, and then the doit method wouldn't read it as TRUE and run the code.

So, I have to write gRestoringTheGame into the Temp file also, then in the Main Script's doit method, read the Temp file for gRestoringTheGame to make it TRUE, which will in turn trigger to read the rest of the Temp file for the other variables, then set gRestoringTheGame to false, so it's not repeating this process every cycle of the game...and while I know this sounds superfluous, it's not.

If you start a new game and there is not gRestoringTheGame flag to stop the constant writing of variables from the temp file, the new game's variables will be overwritten before the player even does anything.

39
SCI Syntax Help / Re: SCI01 Game Using SCI0 Template?
« on: December 13, 2020, 11:13:03 AM »
Is it that different? I figured everything would be mostly the same apart from additional features like scrolling screen transitions and stuff.
Maybe I oversimplified. Eric had mentioned this in the Betrayed Alliance 2 Development Journal post:
An idea could be to move to SCI0.1 (which is what QFG2 uses). It fully supports SCI0 views and pics, but sounds will need to be upgraded to the SCI1 format. It also manages memory much more efficiently - between my SCI0 and SCI01 templates, SCI0 has 20618 bytes of free heap space in the test room, while SCI01 has 29456 bytes of free heap - nearly a 9000 byte difference!
SCI01 also has the doVerb method, which can be mapped to parser commands, as used in KQ1SCI and QFG2, as well as support for polygon-based paths.
Just an idea if it turns out heap space will be a problem.
So maybe it doesn't *have* more space, but manager the space it has better? But I guess I would be running into some weird internal problems if I tried to use the SCI0 scripts in the SCI01 frame. I should just stick with what I know and not make things overly complicated for myself

40
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 08:39:10 PM »
You're a wealth of knowledge! I'll keep muddling

41
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 07:32:35 PM »
One thing you could try is to open the persist file in Notepad to check what's actually in there.

I viewed the tmp file with notepad and it looks like it recorded the variables perfectly! the first value was 3 and the other two values were 1's (which is what they were originally designated as in the main script). So it looks like all I need to do is get the inputting of these values correctly in the replay method.

The current code only pulls "0" values for the variables. I'm not sure what's going wrong though

Code: [Select]
(= fileHandle (FOpen "persist.tmp" 1)) ;there's a historical typo in SCI.SH
(if (!= fileHandle -1)
(= gPersistMe (ReadNumber (FGets @str 8 fileHandle)))
(= gAlsoMePlz (ReadNumber (FGets @str 8 fileHandle)))
)
(FClose fileHandle)

Does it have anything to do with the "historical typo"? Mentioned in the comment?

42
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 06:01:29 PM »
This is about as far as I can help.
Thanks. I appreciate all the help. I'm going to tinker about with it to see if I can get it running smoothly

43
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 05:14:24 PM »
Right. I was missing something obvious.

Code: [Select]
(= fileHandle (FOpen "persist.tmp" 1)) ;there's a historical typo in SCI.SH
(if (!= fileHandle -1)
(= gPersistMe (ReadNumber (FGets @str 8 fileHandle)))
(= gAlsoMePlz (ReadNumber (FGets @str 8 fileHandle)))
)
(FClose fileHandle)

With this in the replay method, I also need to add str as a variable correct?

Also, what does the 8 stand for in the FGets?

Assuming I am saving 3 variables, how does it know which value to assign to each variable? Or does it just go in order?

EDIT: Good and bad news. I succesfully restored the game with a variable of a different value than saved. Bad new? It was the wrong value. I assigned it to 3 just before running the save to file code, but when I checked it after restoring, it said the value was 0. (I had the value set to 1 originally)

44
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 04:59:33 PM »
That's good to know. I'm glad I won't be making tons and tons of new files.

Having some trouble with the code though

Code: [Select]
  [Error]: Expected something to which we could get a pointer: str  Line: 215, col: 15
  [Error]: Expected something to which we could get a pointer: str  Line: 216, col: 25

These errors are in reference to:
Code: [Select]
(Format @str "%6d %6d %6d" gPersistMe gPersistMeToo gGuessWhat)
(FPuts fileHandle @str)

I simply added the variables to the main Script without definition. Am I missing an obvious step?

45
SCI Syntax Help / Re: SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 04:42:38 PM »
...and then I realize there is apparently no "delete" in SCI0, so you're stuck with a leftover file. Hm.
I look forward to tinkering around with this. Thank you for doing the leg-work, because there is 0.01% chance I would arrive at this info on my own.

As to your comment about no "delete" mechanism in SCI0 - would that suggest that it would create a new file every time there was a restore? I guess this wouldn't be terrible if I just created a folder that stored them...but then again, how would it know which file to read from on the restore?

Pages: 1 2 [3] 4 5 ... 33

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.118 seconds with 21 queries.