This system might be useful in a few instances in single player games, such as making enemies, but it will be most useful in multiplayer games, where things need to be "cloned" all the time. You could use this for mines, building sailing ships, hiring mercenaries, etc.
' "Simple Cloning System"
' Version 0.01 (Initial Release)
' by KlashKnight
' Hand-Coded with WordPad
define game <Simple Cloning System>
asl-version <350>
gametype singleplayer
game version <0.01>
game author <KlashKnight>
game copyright <© 2005 KlashKnight.>
game info <A demo of my cloning system.>
start <Clonesville>
command <clone badger> do <clonebadger>
command <analyze badgers> do <readtheclones>
startscript {
' Initialize clone demo
for each object in game {
if not ( #quest.thing# = game ) then {
' Sets the name for the next clone
set numeric <#quest.thing#clones; 2>
}
}
}
end define
define room <Clonesville>
look <Here is where you clone things!>
define object <badger>
alias <badger>
alt <badger>
prefix <a>
look <A badger, begging to be cloned.>
examine <Hiss!>
article <him>
gender <he>
take msg <Why not clone him?>
end define
end define
define procedure <clonebadger>
clone <badger; badger%badgerclones%>
' Increments the next clone's name
inc <badgerclones>
msg <*POOF!* Another badger appeared!>
end define
define procedure <variablesyntax>
' This is useful for instances, such as, say the player got something from
' some mine. But the possible things you can get from the mine are: big
' valuable rock, diamond, and emerald. So, you don't know what to
' clone! Well, this is the syntax for when the object you want to clone is
' determined by a variable.
clone <#object#; #object#%#object#clones%>
inc <#object#clones>
end define
define procedure <readtheclones>
' Of course, the most important part to clones is reading and writing their
' properties, actions, and stuff. Here is an example of how to mass
' read/write the clones for each object.
for <clonereading; 2; %badgerclones%; 1> {
property <badger%clonereading%; look=His true identity is found to be a clone! AHHH!>
}
msg <Badgers analyzed. Please look at them again.>
end define
define procedure <readtheclonesvariablesyntax>
' And the variable version of the example.
for <clonereading; 2; %#object#clones%; 1> {
property <#object#%clonereading%; look=His true identity is found to be a clone! AHHH!>
}
msg <$capfirst(#object#)$s analyzed. Please look at them again.>
end define
' I think you can take it from here.
' Well, that about wraps this up.
' -- KlashKnight
And there it is.