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

Pages: 1 [2] 3 4 ... 6
SCI Syntax Help / Re: Can someone explain Flags to me?
« on: July 09, 2019, 06:23:09 PM »
Now I'm going crazy.

A month or so ago, I set up flags all around and they all seemed to work without a problem.  I foolishly reverted to globals, but recently began to switch back to flags after figuring out a way to work with scripts to keep them positive heapwise.

But one's giving me trouble now that I can't figure out, and that's only after editing one room script.

Code: [Select]
(procedure (Btst flagEnum)
;Test a boolean game flag
(return (& [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16))))

(procedure (Bset flagEnum  &tmp oldState)
;Set a boolean game flag
(= oldState (Btst flagEnum))
(|= [gameFlags (/ flagEnum 16)] (>> $8000 (mod flagEnum 16)))
(return oldState)

(procedure (Bclr flagEnum  &tmp oldState)
;Clear a boolean game flag
(= oldState (Btst flagEnum))
(&= [gameFlags (/ flagEnum 16)] (~ (>> $8000 (mod flagEnum 16))))
(return oldState)

They are as copied directly from this thread, other than I added the return statements to bypass warnings.

But for example, if I run this:

Code: [Select]
(if (Said 'nudge/bag,trash')
(if (not (Btst fTrashMoved)) (Print 6 23) (theTrashPile ignoreControl: ctlWHITE setMotion: DPath 138 148 loop: 0) (Bset fTrashMoved)
else (Print 6 28))

I get the correct Print statement and theTrashPile moves, BUT it will just let me do this repeatedly and subsequent Btst fTrashMoved indicates it's false.

I have another flag, fAlleyLightBusted, that seems to stick after I throw a rock at the light... until I nudge the trash, at which point it seems to go false. Enter and leave the room multiple times, no problem, until the nudge.  Neither flag even has a related Bclr; once they're set once, they should be set forever.  They're also completely unrelated actions; the only Bset for fTrashMoved is the one above and, again, everything in the "if" statement happens except the flag set.  fAlleyLightBusted doesn't even get set in the RoomScript, it's in a different Script (although same script doc) altogether.

Basically, it all seems fubar, at least when it comes to this damn bag.  I tried setting up a test:

Code: [Select]
(if (Said 'what')
(FormatPrint "Trash Moved: %d" (Btst fTrashMoved))
(FormatPrint "Lights Out: %d" (Btst fAlleyLightBusted))

and find that fAlleyLightBusted does go from false to true (or, more accurately, a very large negative number, is that good?) when the rock is throw.  fTrashMoved remains 0 when the nudge script kicks in.  And fAlleyLightBusted goes back to 0 when the nudge script is run. 

Should the test above accurately reflect flag settings, as I feel like it should?

I've double and triple checked that all previously global variables have been correctly renamed to flags (and these flags/variables only apply to this single room).  The flag names match the enums given in

Is there a way to flush print the contents of gameFlags all over so I can check if the wrong bit is getting set for the bag?  I wouldn't even know how to go about fixing that, but I really just can't see anything that would cause this behavior and it's the only thought I'm having.

SCI Syntax Help / Re: Menu Bar Issues
« on: July 09, 2019, 09:09:04 AM »
That could be it, regarding ScummVM; I've renamed it and now it's saying it can't find game data, so I'll step through that set of stuff to see if I can figure anything out.

I've found that I can reproduce in the template game by copying the and a slightly modified version of (just modded to remove references to globals/publics in my Main).  Attaching here. if anyone's kind enough and inclined to take a look.  From what I can tell, the setup is right, and I'm guessing the problems would be more drastic if not, so that leaves something in MenuBar?

EDIT:  Alrighty, if I comment out this bit:

Code: [Select]
(if (< (Graph grGET_COLOURS) 9)
(SetMenu MENU_COLOURS 32 0)
(SetMenu MENU_COLOURS smMENU_SAID '/color')

the Inventory text is fixed and everything seems to work throughout the menu, except Colors which just does nothing at all.  Colors actually doesn't seem to work whether I leave the code in or not (which I'd failed to notice before), so not sure if it's related.  This bit appears verbatim to the template game, although I'm using Sierra Script here.  Not sure if the difference could be in that?  I'm not really certain what the first condition is checking/doing, so while it seems technically valid, I don't know if it's doing something weird.

Anyway, this seems to be the stomper, or at least it's making all the visible difference when I comment it out so far as I can tell...

SCI Syntax Help / Re: Menu Bar Issues
« on: July 08, 2019, 09:05:43 PM »
Decided to revisit this a bit today, as I'm moving onto a new section of the game and figure it's probably worth figuring out memory issues sooner rather than later...

I've confirmed that DisposeLoad isn't disposing of the MenuBar script in (and double-checked the script constants to make sure I didn't get that confused somewhere.

I made sure the latest ScummVM was installed, but get the following when I try to load it:

Code: [Select]
The game in 'C:\Users\nil_g\Documents\Projects\Games\Sect of Achturan\The Sect
of Achturan\' seems to be an unknown SCI [SCI0, SCI01, SCI10, SCI11, SCI32]
engine game variant.

Please report the following data to the ScummVM team at along with the name of the game you tried to add and
its version, language, etc.:

Matched game IDs: astrochicken, christmas1988, christmas1990, iceman, camelot,
longbow, ecoquest, funseeker, hoyle1, hoyle2, hoyle3, jones, kq1sci, kq4sci,
laurabow, lsl1sci, lsl2, lsl5, cnick-lsl, cnick-kq, cnick-laurabow,
cnick-longbow, cnick-sq, mothergoose256, msastrochicken, pq2, qfg1, qfg2,
sq1sci, sq3, sci-fanmade

  {"resource.001", 0, "ae5701f8065566ae0083be1717c9a7d5", 956919},
  {"", 0, "9ada910254421dc90fe7692567b2c799", 1614},

I've seen this issue noted on the forum, although can't find it for the life of me right now, so I'll take another look when I'm a little more together to see if I can get that running.

I've also plugged in the PrintBadMem procedure, but found it's returning as expected when I call it in the title screen/first room, although the menubar is already displaying wrong by then (so I assume it already should be coalescing).  The string looks right, so I'm not sure if this tells us anything or if, just as likely, I'm doing something wrong.

I did notice that throughout the game the incorrect characters on display within the Inventory text appear to change.  They also changed to a "> " when I added/ran with the PrintBadMem procedure.  Perhaps this can help track down where things are occurring?

Because I'm so green at programming, I'm trying to wrap my head around memory population and order.  Do include and use statements get substituted during preprocessing or linking?  Does this even affect the order of memory population, or am I just wrong altogether?  I've started delving a little deeper into coding, but it's still pretty alien to me.  I'm sure I can find these answers somewhere else, if it's a lot.

But unfortunately, I'm still struggling to figure out where the issue here might lie.  If memory's getting overwritten/corrupted, does the fact that it's only like two or three letters mean that it's just plugging in like 3 bytes where it shouldn't be?  Am I wrong in assuming that that means there's probably something screwed up somewhere else, wherever it's expect that memory to be in line with whatever else it's supposed to be doing?

Sigh.  Guess I won't give up my day job.

I've uploaded the demo for the thing I've been working on...  Unfortunately, I discovered afterwards that some save game files seem to lock up the game when you go to restore.  Most of them seem to be working without issue, but that could definitely be annoying.  That and the Inventory possible-memory menu text aside, though, it should be pretty solid...  If I can sort the occasional save game glitch, it'd be good to reupload.

SCI Syntax Help / Re: Menu Bar Issues
« on: June 25, 2019, 03:32:18 PM »
I'll have to try stepping through as suggested and see what happens.

It hasn't run through ScummVM yet; I used SVM once years ago to play through Sam and Max a bit, but am not super familiar with it.  It seems to play other fan games quite well, but I'm getting some kind of error attempting to load the game, a hashing issue with the resources that's mentioned elsewhere on this forum.  I'll play with it, though; theoretically it's working with fan SCI0 games and has for years, so there's probably something to be done.

Don't *think* DisposeLoad's tanking it from a glance, but I'll definitely take a look through things for that sort of possibility as well, not a thing I'd considered for sure.

SCI Syntax Help / Re: Menu Bar Issues
« on: June 21, 2019, 07:28:42 PM »
I may be way off, bp = base pointer?  Besides pushing and popping, assembly's foreign to me.  Not something I'd be adverse to looking into, though.  But again, I could be way off base in my understanding.

I don't think I have the know how to do anything particularly weird, haha.  I didn't tool with the MenuBar script much beyond necessity.  On the other hand, I very likely have some convoluted code throughout just from inexperience and only a partial grasp of the language.

SCI Syntax Help / Re: Menu Bar Issues
« on: June 21, 2019, 04:45:11 PM »
Oops, my bad.  This means it occurs at runtime?  Which I guess would also point to the memory corruption/conflict?

Code: [Select]
string_06a3 "Pause Game`^p:Inventory`^i:--!:Retype`#3:Look At`^l:Read`^r:Recall`^e:Ask About`^a:Tell About`^t:--! :Colors`^c"
If so, I can begrudgingly move the Inventory option to an inferior position in the list.  Life, somehow, would continue.  Probably.

EDIT:  Soooo, I put Inventory down below the divider before Retype and Tab/Ctrl-I stopped working.  If I stick it below Retype, Tab/Ctrl-I function as retype and F3 does squat.  I guess if there's something causing an issue in the memory there, it's going to cause some kind of tangible issue regardless. 

SCI Syntax Help / Re: Menu Bar Issues
« on: June 21, 2019, 04:20:09 PM »
That sounds fun for sure, ech.  I tried copying just the surrounding Inventory bit from QFG1 or 2 and the issue persists, I really don't see anything wrong with the syntax, as much as I look at it.

I ran a few tests; interestingly, it seems that the third and fourth letters become a capital V and a long space no matter what I put in there.  Intventory, Inmventory, and Invtentory all look like the original picture with the exception of the fact that the "e" then appears such as "InV  entory"

The attached two show if I use just "Inv" which ends up showing the ^i at the end, and "Stuff" for good measure, which shows the same behavior as any of the above "Inventories."

So something's pissing it off about the third and fourth letters, plus it's showing the actual ^i command for some reason if the text is short enough.  Also, both Ctrl-I and Tab do work to bring up the inventory, so it's functionally all there.

Just ran a couple more tests:

1)  Swap Pause Game and Inventory and now Inventory is fine and Pause Game is messed up, except in this case it's the 4th and 5th letters that get screwed up.  Interesting, as both options are the same number of chars.

2)  Stick "Inventory" anywhere in the chain below the divider in with Read, Recall, etc, and it's fine.  The whole damn list shows just fine.

So at least I can do that, but the why of it...

SCI Syntax Help / Menu Bar Issues
« on: June 21, 2019, 11:02:04 AM »
Hi again, a couple of lingering questions I have (and quite possibly the last I'll have, at least for a while).

I'm encountering two problems/unexpected behaviors with my menu bar options:

1)  As the attached image shows, the text for "Inventory" is screwed up.  I've tried changing this text to Inv and a couple of other things, but for reasons I can't figure out, this particular string is consistently getting mangled regardless of what's in it, while the others seem fine.

2)  When I hit Esc throughout play, my Hints On/Off box pops up.  This should be triggered by Ctrl-H, and I don't see any reason that Esc would also trigger.

My best guess for these issues, of course, is coder error, haha.  This is the init for my MenuBar script, where I assume the problems are:

Code: [Select]
(class TheMenuBar of MenuBar
state 0

(method (init)
(AddMenu { Game_} {About Game`^b:Help`#1:Toggle Hints`^h})
{ File_}
{Restart Game`#9:Save Game`#5:Restore Game`#7:--! :Quit`^q}
{ Action_}
{Pause Game`^p:Inventory`^i:--!:Retype`#3:Look At`^l:Read`^r:Recall`^e:Ask About`^a:Tell About`^t:--! :Colors`^c}
{ Speed_}
(if (DoSound sndSET_SOUND)
(AddMenu { Sound_} {Volume...`^v:Turn Off`#2=1})
(AddMenu { Sound_} {Volume...`^v:Turn On`#2=1})
(if (< (Graph grGET_COLOURS) 9)
(SetMenu MENU_COLOURS 32 0)
(SetMenu MENU_COLOURS smMENU_SAID '/color')
(SetMenu MENU_SAVE smMENU_SAID 'save[/game]')
(SetMenu MENU_RESTORE smMENU_SAID 'restore[/game]')
(SetMenu MENU_RESTART smMENU_SAID 'restart[/game]')
(SetMenu MENU_READ smMENU_SAID 'read[/book]')
(SetMenu MENU_HINTS smMENU_SAID 'hint')
(SetMenu MENU_QUIT smMENU_SAID 'done[/game]')
(SetMenu MENU_PAUSE smMENU_SAID 'delay[/game]')

Does anything look off here that could account for either of these issues?  I've got to be missing something.

SCI Syntax Help / Re: Music/Playing Note Sticks When Leaving a Room
« on: June 20, 2019, 05:34:09 PM »
I've tried enabling all tracks for all driver options and all tracks within just the AdLib option in SCIC, but am still running into troubles with both ADL and SNDBLAST.  Am I right in thinking that the SNDBLAST driver works with ADL set tracks?  I did also install the GM Midi/Ad Lib patch Gumby uploaded here some time ago, although I think that's more to improve mapping, rather than to fix any complete lack of sound?

There's only one other instrument I've found that's sticking, so I broke and changed it to an acoustic guitar for now.  The first chunk/part/demo's done, a little QA aside, so that works to at least share what I've got.  Definitely going to take some time to figure out what I'm doing wrong here, though.

SCI Syntax Help / Re: Music/Playing Note Sticks When Leaving a Room
« on: June 17, 2019, 03:40:08 PM »
Ran into this again with another room and decided that I'm not just going to change every brass or woodwind instrument to a plucked instrument as a workaround since I'd eventually like to get past this anyway.

I tried loading up SCI Audio to play around; will it work despite being SCI Script when the rest of the game is Sierra script?  I had some difficulty with it, but may just need to play with it more.  I can try to convert it, but it's size still worries me a bit, even the second, smaller iteration.  It also sounds like there should be some way to get these tracks to play back and end as expected within the newest SCICompanion.  I'm sure there's got to me something.

I tried messing with some other drivers, as well, but what exactly needs to be done to work with these?  ADL.drv just doesn't give me sound; I also copied SNDBLAST.drv from QFG2 and configured that, but receive a "patch.4335" error when I try to start the game.  I'm not sure what that is at all, though it looks like others here have been able to play and experiment with different drivers.

I'm pretty much an idiot when it comes to this stuff, so any help or advice with driver swapping/testing would be excellent.

EDIT:  Regarding the patch.4335 error, looks like that had to do with stealing the QFG2 driver; the one up on the wiki doesn't give that error.  It doesn't work for me yet, either, but not-crashing is a good start, so I'll see what I can do from there.

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 13, 2019, 05:06:14 AM »
Thanks, troflip, not sure how I managed to miss that entire chunk of conversation, but makes sense.

Honestly, I just didn't realize the shorthand was accepted or think to try it out.  I'll def keep that in mind now, though.

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 12, 2019, 10:01:32 PM »
Regarding heap, it seems like memory usage is going up each time I replace (== z TRUE/FALSE) with (Btst z) or = with Bset/Bclr.

It's not a huge difference, but seems counterintuitive to replacing the variables with flags.  Is it plugging in the whole procedure rather than a pointer (or whatever the procedure equivalent would be) each time I reference the call, or is this unexpected?  Logically, it's working fine.  I'm just not sure if the more flag testing/setting I do (as opposed to variable work), the heavier the price should be.  Some variables can pop up a dozen times in a script, so just looking for the best overall path.

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 12, 2019, 07:51:54 PM »
That did it, except for the "oldState" lines in Bset and Bclr.

I found that enclosing "oldState" in a return statement in Bset made that one disappear; doing the same in Bclr did not.

I noticed that oldState isn't even in parentheses in either line, which seems unusual.  Are these what's getting returned?  Seems like it to me, they're the new values getting assigned(?), but making sure.  Any thoughts why Bclr's oldState would still give the "no effect on code" warning?

EDIT:  Must have done something wrong the first time, went back and added the return statement to Bclr again and now no warning.

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 12, 2019, 05:59:25 PM »
One other question from me, too.  I implemented this for one of my globals and it seems to be working great after a couple of initial test runs.  However, when I compile, I get a bunch of "No effect on code" warnings for the new stuff, as in the attached.

The flag and procedures must be working, since the game's responding to events related to the flag.  I've edited the code and commented out the global for the time being while testing.  From the player standpoint, so far so good, but am I missing something?

Pages: 1 [2] 3 4 ... 6

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

Page created in 0.035 seconds with 19 queries.