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.


Topics - Doan Sephim

Pages: [1] 2 3 ... 5
1
SCI Syntax Help / [SOLVED] SCI0 - Globalizing my local death sheet Script
« on: February 20, 2022, 02:25:28 PM »
Last year, inspired by Charles "retry/restore/quit" thread, I put together a death window to show the various deaths the player has suffered in the game to the current point. I had to do a lot of things differently, such as saving variables to an external file so that restoring doesn't remove them, to make this possible.

I've put together a bare bones script in a random room's script to test getting it up and running, but now I need to make it global so that the sheet can be accessed anytime (preferably in the menubar). Here's where the problem presents itself - while migrating the code to the main script, I can get everything up and running except the ability to remove the window. I think the problem may rest with my use of the Display command, but I'm not 100% certain.

My question is should I try to make a new script for this (and how), or does it belong in an existing script (Window, User), or is the Main script a fine place for and there are just some bugs? And finally, should I not be using "display" at all and keep it all a "Print" command? If that's the case, how do I argue how to print some things and not others in a Print? Perhaps FormatPrint first?

Here is how it presented in the Roomscript:
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))
)
Attached is how the window looks in the roomscript, and the termination command works just fine (but doesn't work well at all in the Main)

2
SCI Syntax Help / SCI0 - How to check if right-click on a control color?
« on: January 04, 2022, 02:04:29 PM »
I've actually never done this before. I've only verified for clicking within a box or on a view's box dimensions.
I tried something like:
Code: [Select]
(method (handleEvent pEvent)
(super handleEvent: pEvent)
(if (== (pEvent type?) evMOUSEBUTTON)
(if (& (pEvent modifiers?) emRIGHT_BUTTON)
(if (== pEvent ctlFUCHSIA)

But that doesn't return true

I also tried
Code: [Select]
(if (pEvent onControl: ctlFUCHSIA)and
Code: [Select]
(if (== (pEvent onControl: ctlFUCHSIA) TRUE)But both crash the game because I clearly don't know the proper syntax for this.

I know a lot of this is common knowledge for people who have looked through decompiled scripts, but every time I've tried that, I end up more confused than ever!

3
SCI Syntax Help / SCI0 - Pic Size Maximum?
« on: December 09, 2021, 09:15:52 PM »
A friend of mine did a rework of an image for Betrayed Alliance Book 1, but he's using Photoshop. When I converted the image into SCI0, its size clocked in at 43 MB.

I wonder, is there a maximum size for these resources and if, so, how close am I to it (as I'll still need to add Priority and Control lines).

4
SCI Syntax Help / xStep, yStep and the edge of the screen
« on: December 03, 2021, 09:26:44 PM »
I'm having an issue with actors moving at certain x or y steps not hitting edge of screens or triggering thin control lines.

Most of this I can work around without too much difficulty, but my character running speed is xStep 5 and the fact that the character isn't triggering the edge of screen room change is becoming a problem.

Has anyone else had this issue and/or know an easy solution?

I am a little confused on how I didn't have this issue with Betrayed Alliance Book 1, which uses the same character sprite and xStep running speed.  :o

5
SCI Syntax Help / [Solved] changeState question
« on: December 01, 2021, 01:58:07 PM »
If I have a state set to run for so many cycles then move to the next state, is there a way to nullify that if I manually change to a different state in the same script. I feel like this is a very simple thing, but I don't know how to do it.

6
SCI Syntax Help / SCI0 - Text window vanishing cutouts of Views
« on: September 10, 2021, 01:00:11 PM »
Does anyone know why this happens? This particular text box reveals a "hidden" area behind a breakable wall.

This isn't a super high priority as I can just move the location of the text box, but this is an issue I don't think I've ever seen anyone talk about before.

7
SCI Syntax Help / SetMotion: End and animation hiccups
« on: July 17, 2021, 06:37:18 PM »
I have an animation that goes through various stages, so I have it scripted out in a changeState method.

I have the cycleSpeed set to 4, but when the animation reaches its final cel and moves on to the next state, the last cel lasts for only 1 game cycle before moving on to the next state.

This makes sense because it moves to the next state when it reaches the end because I told it to with SetCycle: End self.

Is there an elegant solution to this to make the last cel last for the full amount of gameCycles (according to what cycleSpeed is set at) before moving to the next state?

8
I understand how to "FormatPrint" to allow for variable values to be imbedding in a print command, but I'm not sure how to do that with the Inventory's "description." I looked in the Inv script and there's something about IconPrint in the showSelf method, but I confess, I'm a bit baffled.

9
SCI Syntax Help / SCI0 - Is the Template broken for togglesound?
« on: February 05, 2021, 02:21:44 PM »
I just noticed I can't seem to change the audio volume of the snd resources I'm using in the game and the menubar's toggle for sound doesn't seem to do anything (nor does the manual gauge for setting volume)

I'm using MT-32 as the SCI-synth in Companion and as the driver, if that matters.

10
SCI Syntax Help / SCI0 - Death Icon always set to loop indefinitely
« on: January 21, 2021, 09:42:20 PM »
I'd like to have some more flexibility with the death handler icon, if possible. It seems to be set to always cycle forward indefinitely.

Is there a way for me to just run the Cels ONCE, like you can do with setCycle: End.

The Method is here, but it's not clear to me how to allow a choice between cycling once or infinite:
Code: [Select]
(instance deadIcon of DCIcon
(properties)

(method (init)
(super init:)
(if (== gRoomNumberExit 540)
(= cycler (End new:))
(cycler init: self)
)
)
)

11
SCI Syntax Help / SCI0 - Icon location in Print window
« on: January 21, 2021, 09:07:17 AM »
The default position on an icon in a window is top left. Is there an easy way to manipulate this? All I really would like to do would be able to center it in the y-axis. Keeping it on the left is fine, but it looks wrong in my death window.

12
SCI Syntax Help / [SOLVED] SCI0 - Death Icon at Top of Window
« on: January 11, 2021, 08:40:28 AM »
Does anyone have any ideas how I can edit the Template to display the death icon at the top of the window instead of always on the left-hand side? Ideally, I'd like to be able to switch this, but I'm having trouble finding out even where to look.

13
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))

14
SCI Syntax Help / [SOLVED] SCI0 - Variables that aren't reset by Restore
« on: December 12, 2020, 12:39:56 PM »
Is it possible to tweak Restore in such a way that it doesn't reset certain variables?

Code: [Select]
(method (restore &tmp gameNum oldCursor hSound)
(= gameNum  -1)
(Load rsFONT gSaveRestoreFont)
(Load rsCURSOR gNormalCursor)
(Load rsCURSOR gLoadingCursor)
(= oldCursor (self setCursor: gNormalCursor))
(= hSound (Sound pause: 1))
(if (GetSaveDisk TRUE)
(if gPrintDlg (gPrintDlg dispose:))
(= gameNum (Restore doit: &rest))
(if (!= gameNum -1)
(self setCursor: gLoadingCursor)
(if (CheckSaveGame objectName gameNum gVersion)
(gCast eachElementDo: #dispose)
(gCast eachElementDo: #delete)
;(= saved 1)
;(FormatPrint {Saved %u} saved)
        (RestoreGame objectName gameNum gVersion)

This is in the "Game" script and I have set a test global variable there "(saved =1)" and I test a print to make sure it works before the "RestoreGame" is called. I do get confirmation that the variable is set to 1 before the restore, but after the restore it is predictably set back to its original value.

I looked everywhere in vain to find where "RestoreGame" is set up. It looks like a procedure to me, but I can't find it anywhere.

15
SCI Syntax Help / SCI01 Game Using SCI0 Template?
« on: December 11, 2020, 08:32:07 AM »
Quick counter-intuitive question: Is it possible to make an SCI01 game using the standard SCI0 Template?

I know it's counter-intuitive and it'd make more sense just to use the SCI01 Template that Eric has provided, but not being a programmer and there being no tutorials or anything for the SCI01 template, I have found it to be too difficult for me.

That being said, the additional 9000 byte increase in heap space SCI01 offers is something that would make my life a lot easier!

So the question is, can I get that heap while also using the older SCI0 Template?

Pages: [1] 2 3 ... 5

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

Page created in 0.144 seconds with 20 queries.