Recent Posts

Pages: [1] 2 3 ... 10
1
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Collector on January 14, 2020, 09:44:22 AM »
I donít have the code snippets in front of me right now, but QFG1VGA and QFG3 also both move the mouse cursor programmatically (when clicking the ďotherĒ menu for running/sneaking/magic).

This reminds me of a quirk of the game in DOSBox. If the mouse is not set to be captured the popup menu would disappear the instant the mouse was moved.
2
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Doan Sephim on January 14, 2020, 09:35:31 AM »
It's very strange. The code I'm using does move the cursor and if I click on where I put the cursor it will trigger for that area, but when I move the mouse it snaps back to where I had the cursor before.

This isn't a big issue, it was just a small quality of life issue that I'm fine not implementing, but it does make me curious as to what's going on in the code. But I'm still very much an amateur in coding, so it's beyond me.
3
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Charles on January 13, 2020, 11:05:34 PM »
I donít have the code snippets in front of me right now, but QFG1VGA and QFG3 also both move the mouse cursor programmatically (when clicking the ďotherĒ menu for running/sneaking/magic).  I would expect those to also be similar code to the above.

So as far as I can tell, there arenít two sets of variables ó one for visual one for actual cursor placement.

The thing thatís occurring to me now is that the QFG1EGA code only sets cursor coordinates if it detects no mouse. That uses SCI0, like your Betrayed Alliance, while the other examples use SCI1. Itís possible SCI0 interpreters donít actually let you position the actual cursor.

Iím racking my brains trying to think of an SCI0 example, but the closest I can get is vaguely recalling being annoyed when QFG2 used to move my mouse back to the corner after cutscenes. And even then, thatís technically SCI1, too.
4
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Kawa on January 13, 2020, 09:05:30 AM »
I was hoping there'd be something about the part in Larry 5 where when you click during the intro, it offers to show you how to fast forward. Looking there I find that it sets the Fast Forward icon as current and fakes a "pressed Escape" event:
Code: [Select]
(gIconBar curIcon: (gIconBar at: 5) handleEvent: (pEvent type: evKEYBOARD message: KEY_ESC yourself:))Undeterred, I drill down to IconBar::handleEvent:
Code: [Select]
(gGame setCursor:
gCursorNumber
true
(+ (curIcon nsLeft?) (/ (- (curIcon nsRight?) (curIcon nsLeft?)) 2))
(- (curIcon nsBottom?) 3))
)

That basically matches the QFG1 snippet.

Importantly, the "show me" button is roughly dead center on the screen, so that's where the cursor goes. If this were to only change the visuals, moving the cursor should snap it back to where the "show me" button was, right? But it doesn't.
5
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Doan Sephim on January 12, 2020, 09:38:50 PM »
Yes, I'm running in dosbox.

Since my code does successfully move the visual cursor, all I need is to simultaneously move the variables associated with the cursor. I just am not sure where those are held.
6
SCI Syntax Help / Re: Setting a Cursor's location
« Last post by Charles on January 11, 2020, 08:41:33 AM »
I don't know much about Studio syntax, but looking at QFG1's code they did:

Code: [Select]
(theGame setCursor: normalCursor TRUE 304 174)

which in turn called the setCursor precedure on the Game object in script 994:
Code: [Select]
(method (setCursor cursorNumber &tmp oldCursor)
;
; Set the cursor form, returning the previous form

(= oldCursor theCursor)
(= theCursor cursorNumber)
(SetCursor cursorNumber &rest)
(return oldCursor)
)

which is calling the kernel command SetCursor http://scicompanion.com/Documentation/Kernels/SetCursor.html?highlight=setcursor

I'm sorry it's not a solution to your problem, but maybe it's a start to help debug it?

[EDIT: Just to confirm, you're seeing this behaviour when running in DosBox?]
7
SCI Syntax Help / Setting a Cursor's location
« Last post by Doan Sephim on January 10, 2020, 11:27:37 AM »
I'm trying to put the cursor in a certain location, but am having some trouble.

I've used the following code:
Code: [Select]
(send gGame:setCursor(gNormalCursor SET_CURSOR_VISIBLE 279 31))This works in as much as it moves the cursor to the numbers specified, but the problem is that while it moves the cursor to that location, when the player moves the mouse, the cursor jumps back to where it was before I set it. So, the setting of the cursor to a location is only cosmetic and not influencing the actual variables involved.

I've looked and cannot find where the cursor variables are held. Can anyone help with this?

Edit: Sorry for the Studio syntax...I'm working on the patch of my old game, so I'm using the old syntax
8
SCI Development Tools / Re: Decompilation Archive
« Last post by EricOakford on January 05, 2020, 03:33:14 PM »
And here are decompiles of SQ4 CD, Ms. Astro Chicken, and the LSL1 and LSL5 demos!

The LSL1 demo has wide exports, but SCICompanion didn't realize this at first. That confused me when I found that all the procedures were even-numbered. Once I checked the "Wide exports" option in the version detector, the scripts decompile fine.
The demos and Ms. Astro Chicken play through to completion, and SQ4 CD seems to work okay, with a few bugs related to the fact that the game still uses some of the older dialog classes and procedures (moved into their own scripts)

So, what's next? I guess I'll work on LSL1VGA!
9
SCI Development Tools / Re: Decompilation Archive
« Last post by EricOakford on December 18, 2019, 08:35:08 PM »
Here are new decompiles of the QFG2 demo and full game (1.105).

The demo plays to completion without any known issues.
The full game, however, is a different story. Script 2 causes the game to glitch up when restoring a save, and 702 (the alley index) freezes the game when entering the alleyways.
It's not possible to visit the Moneychanger without debug (decompilation error in alley 151?), and the prompt to input gold to exchange doesn't appear (this seems to be an issue with INTRFACE.SC)

On the plus side, I did manage to recreate a few disassembly blocks in script code, such as BlueFrogTP, script 810's chAlloc cue: method, and Talker's messages: method. Much of the defines in GAME.SH have been placed into enums, and more global variables have been identified.

And since it's a week away from Christmas, here's a new decompile of Seasoned Professional! It's been tested to compietion.
Now there are no disassembly blocks in this or the QFG2 demo. The reason some functions would not decompile is because they relied on scripts that the game doesn't have. With those scripts spliced in, those functions decompile as intended.

Time for me to move on to SQ4...
10
Just cleaned up the game's Wiki entry. I had updated some of the templates for uniformity between the Wikis, which broke a couple of things on the game pages. You can update the Wiki entry when you release the new version.
Pages: [1] 2 3 ... 10

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

Page created in 0.119 seconds with 16 queries.