=================================================================================== Improvements to Spitter's Portable Switchable Lantern, By Jason Otto 9/30/2004 =================================================================================== Starting babble Goals: 1]The usual portable lantern with light. 2]Player must be able to turn it on and off without the hassle of having to use other objects. 3]The light must not stay or linger behind. In other words, it must not bug. 4]Player must be able to use other objects while the lantern is on - so, even though the lantern is not currently active item from inventory, the light still works. =================================================================================== Step One: First, create a blueroom and set up two conversation markers in there, with rats as actors. Name the markers LitConv (this will turn our lantern on) and UnlitConv (vice versa - this turns our lantern off). =================================================================================== Step Two: Now create a shovel as the initial lantern, the model will be changed later. This is also useful for debugging - you can quickly see which one you have in your inventory. Name it IllumiShoveland give it following props: 1]Engine Features: FrobInfo: World Action [none], Inv [Script, FocusScript], Tool [none] 2]Scripts: TrigInvFrob (it allows you to send CD-messages from inventory.) 3]Renderer: Render type: Not rendered (So that player can't see a glimpse of this shovel when it's teleported away) 4]Inventory: Can't drop this: TRUE 5]Inventory: Object Name: Lantern:"Lantern" (or whatever you want) 6]Inventory: Type: Item Controldevice link IllumiShovel to LitConv. =================================================================================== Step Three: create the lit lantern - Created a HackLight and named it LanternHack. Give it the following props: 1]Engine Features: Frob Info: [none], [Script, FocusScript], [none] 2]Scripts: TrigInvFrob 3]Shape: Model Name: roblant (this is the lantern model) 4]Inventory: Can't drop this: TRUE 5]Inventory: Object name [use the same as in IllumiShovel] 6]Inventory: Type: Item Controldevice link this to UnlitConv. =================================================================================== Step Four: Create another HackLight somewhere, and name it LanternLight. Add the following props: 1]Rendered: Dynamic Light: 65 (or whatever you want) 2]Light Color: 0.14, 0.70 (your choice, again) =================================================================================== Step Five: A bit of Act/React. Create two new stims under the act/react types, name them whatever you want, stim1 and stim2 In LanternLight, add a new source. Set the stim to your custom stim, set propagator to radius and intensity to 5. In "Edit shape", set radius to 10, flags to none. In life cycle set flags to no max firings, and period to 20. This prodecure will make the light fire a stim 50 times/second. Continue this by giving Garrett a receptron which teleports the light next to Garrett when the light is in Garrett's vicinity. The radius is 10 since if Garrett is moving and we teleport the lightnext to Garrett (which will be done later on), Garrett may be too far away and the light may stay in the spot it was teleported to, and that's not quite right. Radius of 10 is sufficient to always "stick" the light into Garrett - at least if he's not under the effect of speed potion. This has not been tested this, but it's quite likely that if you are giving speed potions to player, you need to increase that radius. Create a new metaproperty, call it lightstick, to this add a new receptron. Put stimulus to stim1 (or whatever you named your custom stim), intensity to no min andno max. Set effect to "Teleport object", target object to Source (LanternLight gets teleported) and Agent to Me (teleport it at Garrett). Now, there's a nasty little bug (or a feature, if you prefer) in this - teleporting the light right into center of Garrett doesn't affect light gem at allso we need to teleport it just a little bit away from him. In "Edit Effect" put positions into about following values: X=0.1, Y=0.1, Z=-0.1. That little trick now always teleports the Light into position (Garrett's X) + 0.1, (Garrett's Y) + 0.1, (Garrett's Z) - 0.1. That should do it. Do not add this metaproperty to Garrett yet, this metaproperty will be added and removed with the switching so that the light can not stick to Garrett when its off. Now, don't close the receptron main dialog yet. Since we are going to teleport the light away when the lantern is turned off (for obvious reasons), we need to also ensure that the light can get back to Garrett - do this with a TeleportTrap which will teleport right at Garrett, quite similarly to how the LanternLight above does. We haven't created the TeleportTrap yet, but while here add the receptron. For this use stim2, again no min and no max intensity. The action is "Teleport object", target is Source and agent Me. This time we do not need to edit position Garrett's central guts are fine. =================================================================================== Step Six: Start this by creating two buttons into the blueroom. These are used to activate the TeleportTraps, These buttonsthemselves are activated via a conversation. Create the two teleport traps and link them to be controlled by the buttons.The two teleport traps are then both linked to controldevice the hacklight. These two traps are LightIn, for the conversation which activates the light (LitCov) and LightOut for the conversation that deactivates the light (UnLitConv). The buttons are named, the button for the LitConv is TeleportOn and of UnLitConv is TeleportOff Now, back to some S&R. Give the teleport LightIn stim2 as a source, set propagator to radius, intensity to 5, radius to 10, remove raycast-flag, no max firings and period to 500. Place this marker near the starting point, the other marker in the blue room. =================================================================================== Step Seven: First, open up LitConv and add following: Action 0: Add Link Contains LanternHack player Action 1: Remove Link Contains IllumiShovel player Action 2: Add/Remove Metaproperty Add LightStick player Action 3: Frob object TeleportOn For UnLitCov Action 0: Add Link Contains IllumiShovel player Action 1: Remove Link Contains LanternHack player Action 2: Add/Remove Metaproperty Remove LightStick player Action 3: Frob object TeleportOff =================================================================================== Step Eight: Change the model name of the shovel to be the same as the lantern that you used. Debugging: This thing is rather difficult to set up, it often fails because a link was set in the wrongdirection or because a conversation wasn't set up correctly. If that is the case rework the links to assure that they are correct. When not specifically stated links used are controldevice. =================================================================================== Results: The result is that there is always a teleport trap stuck to Garrett, and there is always a teleport trap in a blue room. The Lantern and the Shovel both can be controlled from inventory to activate the conversations, which switch the items in inventory, teleport the light between the blue room and Garrett and add a metaproperty to Garrett that keeps the light there. The reverse removes the metaproperty, the light can't stick to Garrett, the light returns to the blue room and the items in inventory switch back. =================================================================================== Application: Any mission with lots of dark places that a lantern could be used. The glow sticks in Thief: The Metal Age are insufficient from proper exploration. Any place where a working lamp is more sensible than a lamp that is always on.