Just pick a number that isn't taken by a script yet, I guess? As for how to do a custom Dialog, I'd say study the Print function.
The Print function uses temporary variables to hold a Dialog instance, one DText, one icon, one DEdit, and up to six DButtons, plus a bunch of things to track all that. It first instantiates a new Dialog (
(= hDialog (Dialog new:))) and DText, then figures out what text to put in there (is it a Text tuple or a script pointer?), and finally adds the DText to the Dialog (
(hDialog add: hDText)). It then goes through all the other arguments, if any, adding icons, setting titles, adding and tracking buttons, and moving things around. Finally, it opens the Dialog, calls
Dialog::doit to get the user's response, and disposes it again (
(hDialog open: nwNORMAL -1 doit: dispose:), to simplify).
Therefore, here's what I'd do, off the top of my head:
(procedure (DeathReport &tmp hDialog hText [str 512] theY)
(= hDialog (Dialog new:))
(Format @str {You have died %u times:} [gDeaths 0])
(= hText (DText new:))
(hText
text: @str
moveTo: 4 4
font: 0
setSize:
)
(hDialog add: hText)
(= theY (+ 4 (hText nsBottom?)))
;;; The iteration starts here
; Put something new in str
(= hText (DText new:))
(hText
text: @str
moveTo: 4 theY
font: 4
setSize:
)
(hDialog add: hText)
(= theY (+ 4 (hText nsBottom?)))
;;; Repeat that part until you're done.
(hDialog
text: {Death Count}
setSize:
center:
open: nwTITLE -1
doit: ; This should block until you click the dialog. Or a button, which we didn't add.
dispose:
)
)
You might wonder if it's safe to reuse hText like that. Well, SCI10's PrintD does it,
and that does in fact allow more arbitrary layouts than SCI0's Print.