define game <Intro>
asl-version <350>
gametype singleplayer
start <room1>
game author <Tr0n²>
game version <1.00>
game info <Created with Notepad++|n _
© Tr0n (MiNE Inc), 2005|n>
startscript {
set string <text; This is the text which will be output.|nIt sould go through bit by bit but I'm not sure about new lines. _
|crColour's might be able to go through too!|n_
What about bits at the END of a string eh?:|b>
do <intro(#text#)>
msg <|cb |xb>
}
end define
define room <room1>
end define
define procedure <intro>
set string <typeW.text; $parameter(1)$>
set numeric <typeW.text.len; $lengthof(#typeW.text#)$>
for <typeW.loop.A; 1; %typeW.text.len%> {
set string <test; $mid(#typeW.text#; %typeW.loop.A%; 1)$>
if ( $mid(#typeW.text#; %typeW.loop.A%; 1)$ = | ) then {
msg <$mid(#typeW.text#; %typeW.loop.A%; 3)$|xn>
inc <typeW.loop.A; 2>
}
else msg <$mid(#typeW.text#; %typeW.loop.A%; 1)$|xn>
pause <100>
}
end define
As you see, this does the sort of thing, and instead of doing each bit individually you just pass a WHOLE lump of text to the procedure. Then it goes through each letter one by one (or in a lump of 3 if you're doing a |n (newline) |cr (colour) |b |xb (bold on/off).). The only thing it can't handle is sizes...
I didn't want to have such a big gap (doing this would mean a string of:
"hello|nworld" would go through like so:
"h...e...l...l...o...
wo...r...l...d..."
There is a work around - you put a break in:
do <intro(hello|nw)>
msg <|s50|xn>
do <intro(orld)>
Erm, a more thurough explaination of the code will code after work.