Sources and Receptrons, for teleporting and timing.

Aim of Tutorial
Assumed Knowledge
Brief Overview
Teleporting Garret
Hints and Tips

Aim of Tutorial

This tutorial is intended to teach the basic of sources and receptrons, and to show what a nifty tool they can be. As well as showing basic implementation, it will also describe how to set up a system to teleport Garrett from place to place, without using TrigRoom Scripts.

Assumed Knowledge

Though this tutorial is aimed at people new to Sources and Receptrons, it is assumed that the reader has basic Dromed knowledge, and knows how to set up a functional level with Convict loaded and starting points, as well as being able to navigate around Dromed reasonably well. Like all tutorials, do the one in the Dromed download first!

(Back to Top)

Brief Overview of Sources and Receptrons

To my mind, sources and receptrons are wonderful, as they allow the formation of complex mock scripts. Most of the puzzles that I have encountered I have solved using Sources and Receptrons.

In case you haven't used sources and receptrons before, I shall attempt to explain how to use them. (If you do know, then skip this bit).

A source and receptron system is affectively a way to turn objects into weird 'keys'. One object is the source. It can be assigned a certain stimulus, either, HolyStim, FireStim, PokeStim, LightBright, WaterStim, etc. Another object is the receptron, it is set up to look for a certain type of stim, and then to do an interface with the game world in some way upon receiving that stim. An example this is of a Holy Water arrow hurting a zombie. The holy water arrow has a holy stimulus on it, and the zombie a receptron for that holy stim. When the zombie is hit by the holy arrow, the receptron triggers, and injures the zombie. Indeed, you can assign objects a holy stim and that object will then injure zombies like a holy arrow.

The actual situation is slightly more complicated than that, there are many different types of options. Each source has a specific strength, and each receptron looks between a range of strengths, and there are various types of 'links' that you can set.

Screnshot of Source Editor

The screenshot above shows the source editor. To get this, in dromed, click on the properties of an object, then Add->Act/React->Sources,and then Add. Select the stimulus you wish to assign, and then select the propagator. This defines what triggers the link. I use either contact or radius. I am unsure what flow does, and script will probably involve some hardcoding so is useless for our purposes.
Radius is used for affects you want to trigger on a regular basis, or when someone steps within the area of an object. Contact is for when an object is either frobed, or collided with. If you select Radius then both Edit Shape and Edit Lifecycle will be activated. Edit Shape determines the radius of the source, and Lifecycle how regularly and how long the source 'fires' and allows any receptrons within the radius to trigger. If you select contact, then only Edit Shape will be available. You can then change the Collision Type. The default setting is collision, which triggers when object collide though you can activate any combination of frobs or weapon motions that you want. The final option is for intensity, which is simply a scale of how strong a source is.

One important thing to remember about both the source and recpetron window is that are a few slight bugs inherit with them. The first time you open up either window, you MUST add any source or receptron, as if you don't it will CRASH. Just add any old thing, making sure that the object setting is valid, and then exit the dialogue box as usual. The source\receptron window should re-appear twice, and if after the first time the source\receptron disappears, then you will have to add another. Once this has been done, you can safely delete the false source\receptron without worry.

For receptrons, you have to specify which source it is to check and between what range of intensities it wants to trigger from, and finally what to do when it encounters that source..

There are a multitude of affects. You can set it up to teleport objects, clone objects, frob objects, add meta-properties, remove meta-properties, kill monsters, stimulate other objects, etc, and so you can see it is very versatile. One of the beauties is that you do not have to specify which specific object you want to target, as there are usually the options of either Me or Target. Setting me for teleport object means that you want to teleport the object that you are currently editting, and target means that you want to target the object where the source came from. Have an explore on what the possible effects are.

As you only have a limited amount of standard stimuli to use, you could use a system of giving each different set a separate stimulus. So Holy source A would have an intensity of 4 and Holy source B an intensity of 10, and then set the receptron so that if it receives a stim between 3 and 5 it heals Garrett, if it receives 9 or more it kills him. One other thing to watch is that on the receptron screen itself the max setting will always match the min setting. This is simply a slight bug, and the actual settings you specify when editting a receptron will work as they say.

This method is viable, but remember to choose a stimulus that will not be used in the course of the game normally. Do not choose Holy Stim if your level is going to be crawling with zombies!

(Back to Top)

Teleporting Garrett

An example of a use of receptrons is to teleport Garrett.

The way I am going to describe involves making your own Gamesys file as it will edit your archetype settings. The Gamesys file is where Thief stores all the object's attributes, and as there was no need to change them under the normal play of the game, they all existed in one file, dark.gam. Whenever you modify an archetype, via Object Hierachy or by accidentally editting the properties of one, you are changing the gamesys, and if you don't save your own file they won't be remembered next time you load up.

First, create two rooms not connected to each other. Texture them up, and create the normal starting point in one (loading convict and other such essentials). Then, add a BigFloorLever to both rooms. (Physical->Gizmos->Switches->BigFloorLever), and name the one in the starting room Teleport1 and the other Teleport2. Now create two new markers in each room, one StartMark, and the other TargetMark.
The idea is that when you pull the first lever you will teleport to target mark, and when you press the other lever you will teleport to StartMark.

Now, we can't simply add our own source to garrett, as, you've guessed it, there isn't one (yet). We instead have to add a source to the Avatar, which is the template for Garrett. This template is what the PlayerFactory link calls when you first enter the level. It takes the template and creates a player box object within the game itself. We can't access this playerbox object as it doesn't exist until the game actually runs so we have to modify the archetype. Before we do this, we better create our own custom gamesys.

Open up the Object Hierachy, and go to the Act/React section. Click on stimulus, and then add, and type in what you want to call your stim. I use TotalityStim. We now have created our own stimulus, but it won't be saved as part of your level normally, you have to manually do it by saving a gamesys file. Under file save choose file, save gamesys, and type in an intelligent name and save it in your thief root directory, I used 'actreact'. Now you have to set your level up to use your custom gamesys. In the command window type 'set_gamesys' followed by the name you typed. If you did it correctly, the bit down the bottom saying DARK.GAM should change to ACTREACT.GAM, or the name of your gamesys file. Save your mission normally changing the filename to what it was before, as otherwise you will overwrite the gamesys file you just saved. If you want to distribute this level you will have to also send that gamesys file.

Now that we have our custom stimulus, we now need to add the source to Avatar Garret. Under object properites edit, Physical->Avatar->Garrett. For some reason, we run into a problem here, as we can't give Garrett sources only receptrons. If you try to add a source, it is not transferred to the playerbox object, but receptrons are. Scroll to where it says receptrons, and then edit them. Click on any of the three receptrons, and then press add to carry the settings across, make sure 'no max' is selected and 'no min' is not selected. Change the stimulus to the custom one, TotalityStim, and change the effect to Stimulate Object, select 'Source' for the first option and 'me'for the second, and then click Edit Effect. Type in the name of the custom stimulus under stimulus, and then type 10 under 'Then Add', then ok out.

So, now when Garret is stimulated by a TotalityStim he will stimulate that same object back with TotalityStim level 10. Now, as we have just edited an archetype we will need to RE-SAVE the gamesys.

Next, select the lever in the start room, and give it a TotalityStim Source, (Add Act/React, sources). You will notice that you cannot specify a propagator. Resist the urge to panic, this happens as thief has yet to recognise your source as a proper one. Save your level, then reload it. This should reset dromed so you can use your source properly. Go back to the start lever, and edit the source. Change the propagator to contact, specifcy any non-zero intensity, say 4, and then edit the shape, click on the button with 'collision' on, de-select 'collision' and select 'FrobinWorld'. This means it will trigger when anything frobs it.
Then exit the source window, and add a receptron. Set it up for TotalityStim, set the min intesity to 9 and select no max. For effect, select teleport, in target object select the Source option, and under agent type in TargetMark. If we wanted we could adjust EditEffect to give us a displacement off the marker and a set heading once we teleport, but for this there is no real need to adjust these settings.

Go into game mode, when you pull the lever you should teleport to the other room. To get around the fact that you can't assign a source to Garret when you pull the lever, the lever stimulates you, and then you stimulate the lever which teleports you to the marker. To link up the other lever, add the source as before, and a receptron with the same details as before, but this time select the other marker, TargStart.

You should now be able to jump between the two at will. See the possibilities., you don't even need to use markers, you could use dropable objects, and switches to do this on the fly. For instance, in the level that comes with this bit, go to the table and pickup the scepter and the switch. Go around a bit and drop the scepter somewhere (usually by pressing y), and then teleport to the other room and then press the switch in your inventory. Guess what happens?. Your own teleport button! You should be able to figure out how this system works by yourself, if not, decode the level.

Download the TelepFun (218k) NOW!!!!!!
While stocks Last!

(Back to Top)

Tips and hints

  • Always remember the bug when editting with sources and receptrons - you must have a source or a receptron added to an object after you edit it for the first time. You can delete it afterwards.
  • Receptrons will always trigger in the order that they are in the receptron table, from top to bottom, so if you have a one shot trigger, which deletes itself, check that there are no further receptron instructions after the delete one.
  • If you can't work out what a source/receptron is doing, add a link from the receptron to frob a lever so that you can see it move.
  • The source/receptron relay system that is set up on Garrett is very important, it is the most efficent way that the player can interface with a receptron object.
  • Remember that stimuli do other tasks in the game environment as well. Only use the inbuilt ones when you are sure that they will not interfere with the normal running of the game, and when using your custom ones, be careful not to overlap intensities.
  • For a collision source to work, the objects actually have to do just that - collide. They have to have a physical dimension, and one of them must stop.

If you need help, write me, totality@ridge7.demon.co.uk or go to the Forum, http://www.ttlg.com. And if you don't want to be labeled as a newbie, use the Forum's search function first!