Run-time error 10

DShepherd
25 Dec 2005, 05:55
Hey Dune Shepherd here, (as a note, I created two other accounts, DuneShepherd and DesertShepherd... never got emails from those and still haven't so go ahead and delete them alex, thanx.)

I am creating a tutorial file for myself and maybe when I'm done, for others. But I'm having a problem with object creation and cloning scripts run in my "run script when object is taken" section. I know some basic Inform language and I'm getting the hang of the differences of ASL, still not quite enough to write a whole map without the QDK at the moment. (Too bad it didn't support inform language conversion :wink: )

Anyways here's the script. Hope you can help.

As a side question, since I read in another post the limit of objects and rooms is like 27500 or something like that, which is VERY low for my standards, I was wondering how to link two cas files together and carry variables over? if not possible to carry variables, atleast how to link them? I messed around with the execute command but everytime i do, it opens up a new window, and if you don't have the file association then it won't open at all. All help appreciated! Flames accepted welcomingly also incase you've had a bad day and need to take it out on someone with noob questions. :D

' "Tutorial2"
' Created with QDK Pro 3.53

define game <Tutorial2>
asl-version <350>
gametype singleplayer
start <Inn>
game author <DuneShepherd>
game version <1.0>
game copyright <© Sandust Co. all rights reserved 2005>
game info <Created with a full blown $24.00 spent registered version. That's right, Im a good citizen now you all better ooh and wow at me!.>
default fontname <Georgia>
startscript set numeric <RN; 1>
action <take #objname#> give <#objname#>
command <Debug RN> do <MakeRock>
end define

define synonyms
end define

define room <Inn>
alias <Inn>
prefix <the>
out <Outside>
east <Outside>
up <Upstairs>
place <Outside>
place <Upstairs>
description <Its pretty much just basic wood, but what's most annerving is that there's nobody here. All you see is emptiness, nor are there chairs.|n|nInfact, there's even no reason to believe this is an inn. You begin to wonder why that notion is in your mind.>
end define

define room <Outside>
alias <Outside>
prefix < >
north <Magical Forest>
west <Inn>
place <the; Inn>
script {
if not ( #playervisited# = True ) then {
msg <The freshness of the outside air is almost ecstatic to your lungs as you take in a deep breath.>
set string <playervisited; True>
}
msg <You see a box of wheaties and a pile of rocks, to the north is a forest.>
}
description return <false>

define object <Wheaties>
alias <Wheaties>
alt <box>
look <It looks like a normal box of wheaties>
take
speak <Doing nothing, you suspect it probably can't respond being as it's an inanimate object.>
examine <On closer inspection there's nothing inside it. It could be used as a rock container.>
prefix <box>
suffix <of>
action <Eat> {
msg <You munch away on the box of wheaties, feeling very special now, and almost viberant.>
flag on <FreedomEnabled>
move <Wheaties; Inn>
hide <Wheaties>
}
end define

define object <RockProducer>
look <You see a bunch of rocks>
take do <MakeRock>
speak <Getting ready to listen for a responce, you deside to stop with the notion in mind that if you actually did hear something, then you'd've gone crazy.>
examine <WOW AMAZING! Its a rock!>
end define

define object <Rock>
alias <Rock>
alt <Rocks>
look <You see a bunch of rocks>
take
speak <Getting ready to listen for a responce, you deside to stop with the notion in mind that if you actually did hear something, then you'dve gone crazy.>
examine <WOW AMAZING! Its a rock!>
hidden
invisible
end define

end define

define room <Upstairs>
alias <Upstairs>
down <Inn>
place <Inn>
description <Walking up stiars, you see a large wooden room. As you look around you see a ghost.>

define object <Ghost>
alias <Ghost>
look <You see a ghost, but then again, actually you see right through it.>
speak msg <What do you wish to talk about?>
examine <You should probably try speaking to it before staring rudely at it.>
prefix <the>
displaytype <transparent>
article <it>
gender <it>
end define

end define

define room <MForest>
alias <Magical Forest>
north do <MagicForest>
south do <MagicForest>
east do <MagicForest>
west do <MagicForest>
northwest do <MagicForest>
northeast do <MagicForest>
southwest do <MagicForest>
southeast do <MagicForest>
end define

define room <HTFront>
alias <Hidden Courtyard>
north <Maze1>
south <MForest>
description <You arrive in a hidden courtyard. To the south is the magical forest, to the north is a large stone temple compound far ahead, but in order to get there, it seems you must go through a maze.>
end define

define room <Maze1>
alias <Maze>
prefix <the>
north do <Maze>
south do <Maze>
east do <Maze>
west do <Maze>
northwest do <Maze>
northeast do <Maze>
southwest do <Maze>
southeast do <Maze>
description <You are in a maze. pretty a - maze - ing huh.>
end define

define procedure <MagicForest>
if not flag <FreedomEnabled> then msg <Moving in vain, you end up in another clearing that looks exactly like the one you were just in.>
if flag <FreedomEnabled> then goto <HTFront>

end define

define procedure <Maze>

end define

define procedure <MakeRock>
clone <Rock; Rock%RN%>
show <Rock%RN%>
reveal <Rock%RN%>
inc <RN; 1>
end define

define text <intro>

end define

define text <win>

end define

define text <lose>

end define




Oh to be more clear, what I'm trying to do is make it so the player can pickup an infinite, and I mean true solid set infinite, even if it means I have to limit it to 27500 rocks for the first level and then carry on to the second even more, or some up with some sort of way to represent them, whatever, (Im obsessed with infinity, the lack of limits) and it goes into the inventory, well instead of creating infinite rocks inside the pile, i created a script that is supposed to produce a rock whenever the player tries to take one, eventually i want them to be able to enter in a number. (Here's the part where you probably will flame me on if you decide to flame instead of help, no problem I'm okay with it 8) ) I want the player to be able to carry around an infinite number of rocks, go to an infinite number of rooms, do an infinite number of things. I mean that as literally in everyway that I can say it. I plan to do this with a huge random generator that generates random seeds for another random generator to generate seeds and be arrayed to the power of itself for every number it produces. Follow that? doesn't matter

Summarized: All that is my future plans, if you can help, all I need is to know how to fix my run-time error 10. Much thanks and God bless you all.

DShepherd
27 Dec 2005, 19:16
I think I found the problem, but I'm not sure. I think the internal library has the "take" command as an infinite loop sequence, I was looking through the library, and under special take procedure, it has the action to execute take again! So if you want to take something with a script that ends up doing something such as cloning, it will clone that object an infinite number of times!

I'm not positive on this though, and help is still greatly appreciated.. Hope somebody out there can help :roll:

paul_one
28 Dec 2005, 17:04
What library would this be?
Can't comment on code we can't see!
I can't see what that code printed would generate an error just from a take object command. Might try removing the take command from the game block.

To be honest, ASL doesn't have a random seed. - Or if it DOES have a seed that can be set, I don't know about it!

It wouldn't matter much, it doesn't make it much more randomised at all.
Considering it's fake randomisation anyway.

I don't think you'll be getting very close to 32,000 (which is more like the integer limit).
Unless you just create objects/rooms that will never be used!
I do think you can copy variables over - the only problem is that ever since Alex encrypted the save files, you can't change the filenames they are linked to! So if you wish to carry the previous game over (a personal plan of mine) you will need to change the game file/folder/etc.

And also, having room's there just for the hell of it - you could always start looking into ITID's old project, which used a few arrays and only one room. So you could basically square the possible number of rooms straight away!
If you added a third dimension to the arrays, which I don't think he did, that basically cubes the amount of 'rooms' possible.
The only difficulty is objects, characters etc.
Quest's biggest flaw is this number limit. Which I am looking foreward to being raised to a BIG-BIG limit in the future.

You can also already DO infinite things. Just continue typing "look" :P.