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

Pages: 1 [2] 3 4 ... 7
16
I should go through all the SCI0 games and add Test/Set/Clear for them eventually.
But each will need a different shortcut (e.g. in LSL3 alt+f is already taken).

To use the internal debugger you'd need to first know which global the flags start at for each specific game, figure out which subsequent global the flag is stored in, know the existing value of that global, and finally calculate the correct new value to set the proper flag while preserving the other 15 flags.
What do you mean start at VS stored at? All SCI games that have event flags have just a single global for event flags (disregarding alternate dedicated event flags like eco2's Ecorder).
Anyway, in the example of lsl3 if you check global 111 after running various setflag it seems to stay at 0 if the setflag is > 15 (e.g. look at plaque or use binocular at room 200), so how can you tell any flag from a value of 0?

17
IMO, that's way too much work when you can use the script debugger which does all this for you.
Well, all the SCI0 games I know, like QFG1EGA, QFG2 (not the non SCI fan remake) and LSL3 don't have anything like flag control in their script debuggers, despite using flags for everything. I would have mentioned SQ3 too, but judging from its code you seem to be right that it predates flags.

Quote
Edit: LOL, your question made me realize I made a dumb mistake misusing flags in a project last year that I'll need to fix. Never take anything at face value I guess.
At your service...

18
Surprisingly, SCI0 games' internal debugger doesn't offer direct support for the most basic plot features in SCI - teleport and setting event flags.
But at least for teleport the wiki suggests an indirect way - to modify global variable 13 into the desired room number.
Is there a similar indirect way to set/test/clear event flags (the debugger allows changing global, local and temp flags, but not event ones which are a subset of global variables)?

19
I was wondering that myself, how to peek at the value of gCurrentRegionFlags and invoke methods on an object by address instead of name. I don't use the debuggers much lol.
I've explained above the flow to get the address of set/test/clear and then use it in bpa. This should work in 100% of the rooms, but it's not comfortable to work with addresses.
I just look for a bpx alternative with a static name.

20
But in each area it's different. In the initial example of room 840 it's goldFlags, not dockFlags, so it would be:
Code: [Select]
bpx goldFlags::setSo:
  • How to find something like goldFlags or dockFlags via the debugger console (instead of browsing the source code)? It doesn't show up when running commands like selectors or class_table (unlike Flags).
  • Is there any way to use something that's not area dependent (like bpa above)?

21
So any idea why bpa works in this case while bpx doesn't?

22
True, although from what I've seen so far (just a couple of rooms in different areas) they still don't use the same flag number twice, even though you've established they can.
Now I just wonder how to be able catch Flags' set/test/clear with either bpe or bpx instead of having to use bpa which relies on addresses.

23
Quote
Did you report the flag object issue to the ScummVM devs?
Report what? Since the game also uses standard flags, ScummVM is unlikely to add a special secondary support, especially since last time I asked something about the console (to add a basic "clear" console command) they told me to stay away from console requests as it's an "internal" too.

No, gCurrentRegionFlags is a pointer to the currently accessible flags. So if gCurrentRegionFlags is pointing to goldFlags, I can't access batFlags, for instance. That script won't even be loaded, so I can't access its flags.
Of course it's a global variable, because every script needs to be able to dereference it.
In Main.sc it appears as:
Code: [Select]
(local
gCurrentRegionFlags
Where do you see it's a pointer? Other than being declared, it's not defined. It's just used with Flags.sc's set/test/clear.

24
But there's no separation really because while gCurrentRegionFlags is technically a local, it's declared in Main.sc and thus treated like a global anyway - in the console running l 0 150 is equal to running vv g 150 - in either case the output is 002f:0508 (object 'goldFlags').

About question 3, you would think if bpe can't be used, at least Flags::set should work, but it doesn't. This is even though according to this in KQ6 bpx KQ6Print::say works, whereas KQ6Print is a class just like Flags and say is a method just like set (see code). According to this, it should also be similar to Laura Bow 2's bpx bugsWithMeat::cue (see code).

But I've found an interim solution - bpa 000e:00a7 - I don't like it because there's no pasting in ScummVM's console and who wants to type down this address, but it works nonetheless.

Here's how I deduced that Flags' set can be called directly with address 000e:00a7:
  • value_type Flags indeed outputs Object.
  • scro 985 outputs:
    === SCRIPT 985 inside Segment 000e (14d) ===
    001:0154: Flags
  • vo 000e:0154 outputs:
    [000e:0154] Flags :  11 vars,   6 methods
    -- member variables:
      (0000) [1000] -objID- = 0000:1234 (4660)
      (0001) [1001] -size- = 0000:000b (11)
      (0002) [1002] -propDict- = 000e:0008
      (0003) [1003] -methDict- = 0000:001e (30)
      (0004) [1004] -classScript- = 0000:03d9 (985)
      (0005) [1005] -script- = 0000:007d (125)
      (0006) [1006] -super- = 0004:092f (Obj)
      (0007) [1007] -info- = 0000:8000 (32768)
      (0008) [014] name = 000e:016c
      (0009) [056] size = 0000:0000 (0)
      (000a) [1d5] array = 0000:0000 (0)
    -- methods:
      [06e] init = 000e:0038
      [06f] dispose = 000e:0091
      [0ba] setSize = 000e:004a
      [0a0] set = 000e:00a7
      [26c] clear = 000e:00e7
      [26d] test = 000e:0128

      [06d] Obj::new = 0004:02cb
      [039] Obj::doit = 0004:02d2
      [070] Obj::showStr = 0004:02da
      [071] Obj::showSelf = 0004:02e3
      [060] Obj::perform = 0004:02f7
      [072] Obj::isKindOf = 0004:0334
      [073] Obj::isMemberOf = 0004:030a
      [074] Obj::respondsTo = 0004:0302
      [075] Obj::yourself = 0004:036b

25
SCI Syntax Help / Event flags VS Object flags VS ScummVM debugger console
« on: December 30, 2023, 07:53:59 AM »
Unlike most SCI games (including its prequel), EcoQuest 2 barely uses flag events (from global110). It instead mostly uses a Main.sc (script #0) local variable called gCurrentRegionFlags which uses set/test/clear procedures that are defined in Flags.sc (script #985).

Thankfully, the kind people here made EcoQuest2's restored debug smart enough to handle both types using a yes/no question of "Flag Object?" (for alt+b/l/k). If the player chooses yes, it uses gCurrentRegionFlags set/test/clear and if the player chooses no, it uses the standard SetFlag/TestFlag/ClearFlag.

So my questions are:
  • Why would Sierra use 2 different ways to track events possibly only in this game, and why barely using the official way? Because of it ScummVM's console flag feature (sf/tf/cf) can barely discover anything in this game, since they expect only the rarely used official way...
  • Why isn't a global like global110 considered a Flag Object too? After all, it contains multiple flag events inside itself. I mean, why did the people here that restored the debugger consider the answer of "no" to "Flag Object?" to mean using a global that stores many flags?
  • Hope it's okay to ask since it's a bit off-topic, but as far as you know, is there any to use breakpoints to discover such flags in ScummVM's debugger console? The usual way would be bpe 0 3 (since 3 in this game SetFlag is 3), but it isn't worth much due to being barely used. And bpe 0 150 (since gCurrentRegionFlags is 150) is never triggered. Likewise l 150 always shows the same value (assuming because it's an object).
    An easy test is in room 840 - climb the right wall and every time you pull the snake's tale it either runs gCurrentRegionFlags set: 1 or gCurrentRegionFlags clear: 1.

Stats:
  • gCurrentRegionFlags test has 458 matches in 34 files practically in every room
  • isFlag has 65 matches in 18 files out of which just 9 rooms
  • gCurrentRegionFlags clear has 33 matches in 13 files practically in every room
  • ClearFlag has 14 matches in 9 files out of which just 2 rooms

Thanks!

26
What about it?
  • It's closed source, meaning the actual code is unknown (which might be permitted but in my eyes kind of breaks GitHub's spirit).
  • The only related patch there seems to be "170: Fixed a script error where the player was not being forced into the encounter with Manu after the conference" while the request here is asking the exact opposite.

27
v1.1 has no PATCHES subfolder and there are no 170 files. It's 170 that needs changing to stop taking the hero to 700.

28
I've rephrased my OP - 700 is just where 170 takes you. It's 170 that I must assume needs handling. If 170 is handled, 700 shouldn't even take place. 170 should know you already met Johari and thus not redirect you to her again at 700.

29
It's like the "80% of all outcomes are derived from 20% of causes" rule was made for this case.
Everything I've tried with Johari didn't work, I just keep re-meeting her while she's supposed to be long gone.

Once this is solved, then the conversion will need to be dealt with...maybe if I put a working SCI code in the bug report someone there will be kind enough to convert it.

30
1.1

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

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

Page created in 0.068 seconds with 20 queries.