Decoy Clones

By LadylexUK (Jan 2015)
Copied from ProjectSpark.com

This tutorial has been developed from a question in Koding Konversation by EvangelicPort5

How to Create a Decoy Clone or Tulpa*

*A tulpa is a thoughtform, created to do your bidding.

This is the scenario. You are surrounded by enemies. You press your right trigger, and a decoy clone of you appears. The enemies attack your clone. You escape.

Here is the the code for a non-moving decoy clone that will last for 10 seconds.

WHEN [RT][pressed] DO [boolvar:create clone][=][true]
WHEN [boolvar:createclone][=][true] DO
…WHEN [started to] DO [objvar:my clone][=][create][me]
…/…WHEN DO [objvar:myclone][remove brain]
…WHEN [countdown timer][1] DO [objvar:myclone][pace][=][0] (Optional. Without this line the clone will play the idle animation)
…WHEN [countdown timer][10] DO [destroy][objvar:myclone]
…/…WHEN DO [boolvar:createclone][=][false]
WHEN [started to][is dead] DO [destroy][objvar:myclone] (This last line is so that the clone is destroyed when your player dies)

Clones appearance position
The clone appears at the head of the character, about 1 metre in front and drops to the ground.
Change this line to

…WHEN [started to] DO [objvar:my clone][=][create][me][at position][position]

and your clone will appear at your players position and gently nudge him out of the way. This may be useful for opening doors with pressure pads.

More dramatic appearance
You can play about with this to create a magical clone.

Add before the destroy line

…WHEN DO [objvar:myclone][hologram]
…WHEN[objvar:myclone][equipment] Do [it][hologram] (without this, any weapon will appear normal, spoiling the effect)

Attack of the Clones

Another option is to have a decoy clone that can attack your enemies. For this you need to push a follower brain into your clone.

WHEN [RT][pressed] DO [boolvar:create clone][=][true]
WHEN [boolvar:createclone][=][true] DO
…WHEN [started to] DO [objvar:my clone][=][create][me]
…/…WHEN DO [objvar:myclone][push brain][braingallery: Follower:Melee]
…WHEN [countdown timer][10] DO [destroy][objvar:my clone]
…/…WHEN DO [boolvar:createclone][=][false]
WHEN [started to][is dead] DO [destroy][objvar:myclone]

The melee brain gives your clone an axe. The ranged brain a bow.

Slave Clones

You can see from the attacking clone example you can push a brain into your clone. So you could program a brain that will make a character do a task. Save it, and push that brain into your clone. So now you can create a clone that will dance, or operate a machine, or, well…whatever your imagination can think up.

Controlled clone or Tulpa

You can also create a clone that you control. Here is the scenario. You see a dangerous cave up ahead. Using magic you create a clone of yourself, take over it’s brain and move towards the cave. A goblin runs out and kills your clone. You are still alive. You now control your player again.

In your player brain

WHEN [RT][pressed] DO [boolvar:create clone][=][true]
WHEN [boolvar:createclone][=][true] DO
…WHEN [started to] DO [objvar:my clone][=][create][me]
…/…WHEN DO [objvar:myclone][push brain][saved brain: controlclone]
…WHEN DO [boolvar:createclone][=][false]
WHEN [started to][is dead] DO [destroy][objvar:myclone]

Create and save this brain as “controlclone”

Edit 3rd person adventurer brain

WHEN [once] DO [creator][brain is active][=][false]
WHEN [LT][pressed] DO
…WHEN DO [creator][brain is active][=][true]
…WHEN DO [destroy][me]
WHEN [started to][is dead] DO
…WHEN DO [creator][brain is active][=][true]

Its also a good idea to visually identify your clone from your original. Use hologram or set the primary color to something else in the controlclone brain

WHEN [once] DO [hologram]

or

WHEN [once] DO [primary color][=][green]

So now, when your player presses the Right trigger a clone appears which he can control, while his own body is left in idle mode. If the clone dies, or the player presses the left trigger, then the clone is destroyed and the player has control of his own brain again. To make this more interesting you could add a emote to your player character on a switch page instead of turning off his brain. Maybe he could meditate, or wave a wand. That Kode would look like:

controlclone brain

WHEN [once] DO [creator][switch page][2]
WHEN [LT][pressed] DO
…WHEN DO [creator][switch page][1]
…WHEN DO [destroy][me]
WHEN [started to][is dead] DO
…WHEN DO [creator][switch page][1]

player brain: page 2

WHEN DO [emote][cheer] (or a custom made kinect emote)
WHEN [started to][is dead] DO [destroy][objvar:myclone]

Issues to be aware of:
Because the countdown clock that destroys the clone is in the player’s brain. If the player is destroyed rather than killed, the clone will never be destroyed. If this does not happen in your game, then dont worry about it. If you are using a mechanic like that in your game then it might be an idea to add to your respawn Kode for your character:

WHEN [global][objset:createdclones] DO [destroy][them]

and add this to the clone creation segment

…/…WHEN DO [global][objset:createdclones][incremented by][objvar:myclone]

This will destroy any clones in the game when the player respawns. In a multiplayer scenario you will not be able to use global. Specify each player’s createdclones object set individually in your respawn Kode.

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: