Simple cloning system for those who want to use it

Anonymous
22 May 2005, 22:45
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.

francisstokes
23 May 2005, 06:54
Thats cool klashnight.Nicely done with the badgers.

You havent by any chance seen this have you? http://www.badgerbadgerbadger.com

Anonymous
24 May 2005, 00:06
Thanks! Naw, I haven't seen that, I just needed an object to clone. Badger was the first thing that popped into my head. It could have been robots, guns, or even rocks.

Elexxorine
24 May 2005, 10:02
yeah but badgers are cool...... a badger, badger, badger, badger, badger, badger, badger, badger, mushroom, mushroom, a badger, badger, badger, badger, badger, badger, badger, badger, mushroom, mushroom..... and so on....

francisstokes
24 May 2005, 16:01
And they say pot is bad for you......

Elexxorine
24 May 2005, 17:17
oh, haha. i do not smoke pot, or ever have and in fact i have given up smoking. (parents found out)

francisstokes
24 May 2005, 17:44
Ok What happened to "ever had a herbal?".

Anyway.........

Anonymous
25 May 2005, 03:09
Well, I'm planning to use it to clone dwarves. What would happen is that when the player would enter certain rooms, the script procedure would do some random thing to see if a dwarf should enter the room. If a dwarf wasn't in the room, it would simply move the dwarf from the storage room into the room where the player was. If the dwarf was in the room, it would make a clone of the dwarf object so that you could fight more than one dwarf at a time.

paul_one
25 May 2005, 18:00
Sound's alot like how I designed my RPG battle system.


You can have 5 clones in the same room, or bomb1, bomb2, lizard1, lizard2 and bomb3, or other combinations. When the battle starts objects that already exist are moved in and the properties 'reset'.
You are approaching things from the right angle.

Anonymous
26 May 2005, 02:38
Glad to hear I'm on the right track! :)