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

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 12, 2019, 05:07:44 AM »
Is $8000 hex?  I know how to convert hex, but I'm a little fuzzy on how it applies here, if so?  I've got no real experience with bitwise operation; I feel like I get the most basic of concepts, but I'm definitely lacking in the applicability department, so I'm kind of slow at translating when it comes up.

SCI Syntax Help / Re: Can someone explain Flags to me?
« on: June 11, 2019, 12:16:13 PM »
Awesome!  I just counted and I've got 70 global binary variables in what's probably a little less than a quarter of the full game.  I can shift quite a few local variables over this way as well, which could help trim the necessary logic from some of the main rooms into the specific room/input scripts.  My heap's shifting further from nightmare to comfortable with each trick you all pass on.

Might not be bad to compile some article on the Wiki for heap management tricks like these for some of us more amateur programmer types.  Perhaps I'll take some time to at least start on something like that; it'd be nice to contribute for sure in content if not coding and ideas.

SCI Syntax Help / Re: Loading External Scripts on the Fly?
« on: June 11, 2019, 12:42:19 AM »
 That's interesting, I'll have to read through and see; that certainly seems like it could be a way of going about it.  Passing a few var copies should still be kinder on the memory for the room in general than a couple lines of logical operations.

I'll have to check into the flag trio, too.  I'm not familiar with them, but see the code bit pasted in the QFG1 thread.  Most of the global variables I've created are TRUE/FALSE so far, so if there's that wide a gap in memory usage, it could definitely be worth implementing, assuming I can sort through it.  A generous assumption, to be sure, but...

SCI Syntax Help / Re: Loading External Scripts on the Fly?
« on: June 10, 2019, 02:45:25 PM »
Excellent, so parsing the input as with the QFG1 sample and Kawa's

((ScriptID 301 0) handleEvent: pEvent)

syntax which was correct, I do seem to be able to do this now.  DisposeScript works after to seemingly free up the space again.

Copied over all the looks for one room; I am receiving a compiler error for events which include variables from the originating script (Undeclared identifiers, Unknown variables, etc).  I can probably chop it so that the bulk of these events are taken care of externally while the ones requiring local variables remain in the original script.  Is that probably the best way to go?  It should certainly help with the space, but I wouldn't be adverse to keeping all of the responses themselves confined to the one script if possible.

SCI Syntax Help / Re: Loading External Scripts on the Fly?
« on: June 10, 2019, 01:31:41 PM »
Nice, thank you both, I'm going to try some of these out.

I kid you not, I took a peek at QFG1 last night thinking they might have done this, including your uploaded decompile files, Charles.  For some reason I looked at "ask" (which seems to occur pretty consistently internally, though I hadn't thought to check with the chatty castle guard) instead the more likely "look."  Probably should have been a little more thorough there.

SCI Syntax Help / Loading External Scripts on the Fly?
« on: June 09, 2019, 09:48:07 PM »
This may be a stupid question, but I've got a couple of rooms that are on the edge in terms of heap space, and it's causing some issues already (like can't open Inventory at times).  The rooms are basically done, but the game itself will probably have more quite a few more global variables and things that will end up pushing them over.  I'm looking into tightening things up, but I was wondering if there is any way to load an external script on the fly?

What I'd really like to do is have, say, one script that deals with 'ask' responses and one that deals with 'look' responses for this room.  I'm trying to account for as much user input as I can, and if I could take even just these two subsets of user inputs and set it in some way that an external script is called when the user 'asks' something then disposed immediately after, for example, I feel like it could go a long way to alleviating heap issues.  It's hacky, but it would get the memory where it needs to be if just the handling of these two inputs could be offloaded and put into memory only on-demand.

I may be grossly misunderstanding things here, but just checking on the possibilities.  I'm looking for ways to legit tighten up and rein in the script as well.  I'm hoping not to have to cut things, though that will probably be the only alternative for at least one of the rooms at this point, if I can't figure something else out, so figured I'd ask at least.

SCI Syntax Help / Re: Dialog Box Edges Hiding Objects Behind
« on: June 08, 2019, 04:47:47 AM »
It seems like adding and initing a PV directly doesn't do anything; no compiler errors or anything, the object just isn't appear.  Strange, I think, but I could just be missing something.

Out of curiosity, what do you mean when you say that PVs exist for automatic re-addition to the background on restore?  I don't know much about the save/restore process, but without this object type specifically, things wouldn't show up?

SCI Syntax Help / Re: Dialog Box Edges Hiding Objects Behind
« on: June 07, 2019, 09:03:33 PM »
That makes sense, then, I didn't realize the Views were added then replaced.  If the PVs utilize less room, do they still end up in the space in memory where the Views were before?  My limited understanding is that heap doesn't get any defragging, so do the deleted Views just leave holes which can be utilized by smaller chunks, if any arise?  I'm not very memory knowledgeable, aside from the bits I've read here, and there may be more for me to read and experiment with to better understand.

As for the animated background objects, makes sense too.  I wasn't sure after reading through the Animate kernel call if it applied to objects added to the pic (and also didn't realize that the Views and Acts were replaced by a different object class).  I can certainly deal with any clipping around text that has to result from background objects anyway, just figured I'd ask.

SCI Syntax Help / Re: Dialog Box Edges Hiding Objects Behind
« on: June 07, 2019, 07:36:51 PM »
Follow up, I also tried this on a second room that had very limited memory just to see if memory usage was really positively affected.  What I found in this case is that the room has just a bit less memory after committing about a dozen view using addToPic: and that it looks like the heap space is way more fragmented than it was before (attached).

Would this be expected using addToPic?  Just about everything should be disposing between each change of the room, and this fragmentation occurs even if I just alt-T directly to the room from the opening, so there shouldn't be junk carrying over.  There were previously only two listings until addToPic was implemented all around.  Is it a matter of ordering things better, or is this just a thing that happens?

SCI Syntax Help / Re: Dialog Box Edges Hiding Objects Behind
« on: June 07, 2019, 07:02:27 PM »
Nice, thanks, addToPic: does seem to do the trick and save a bit on memory to boot.

Some of the backgrounds objects I'd like to add I initially defined as actors so that they could have cycling animations occurring.  I see that I can pull the same trick with Act new: and addToPic, but it doesn't seem that using setMotion in that call

Code: [Select]
((Act new:) view: 532 loop: 2 cel: 0 posn: 83 85 setPri: 1 addToPic: setMotion: Fwd)
works to provide movement.  I'm taking a look at the Animate kernel call, not sure if that could be helpful?  I haven't done any direct work with cast or gCast, though, and haven't figured out yet how it works, if it's even the right thing to look into.  Would this be the right direction to experiment in, or am I going about it all wrong?  I feel like it's probably possible, although it could just be wishful thinking.

SCI Syntax Help / Dialog Box Edges Hiding Objects Behind
« on: June 01, 2019, 12:51:54 PM »
Just going to go for broke and ask this one, slight as it is, since I notice it every time I play through and forays into the two windows scripts haven't made me any smarter.

I've noticed when dialog windows open, they seem to hide objects a few pixels to either side of them.  The attached is an example.

I'm a shitty artist and trying to work around this by creating most background objects as separate views placed onto the scene.  It ain't pretty, but it's prettier than my attempts at vector-based art.

This really isn't a big deal and doesn't affect play at all, I just notice that background objects like the bookcase in the attached get hidden around the left/right sides of each dialog window (showing the yellow wall instead in this case) and was wondering if there's a modification that can be made to prevent this while maintaining pretty much everything else as is about the dialog box?

Pages: [1] 2 3 4

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

Page created in 0.086 seconds with 21 queries.