TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 22 of 22

Thread: Portable and Switchable Lantern Tutorial

  1. #1
    Member
    Registered: Aug 1999
    Location: terrible canyons of static

    Portable and Switchable Lantern Tutorial

    This is my first tutorial ever, so bear with me. Also, a more HTML-ized version of this tutorial can be found from my site. See the end of this post.

    Portable lantern, Spitter-style.



    Starting babble



    First, there are some requirements for this tutorial:
      [*]Mediocre or better understanding of linking[*]At least basic understanding of Sources & Receptrons (Act/React)[*]Ability to understand my babbling[/list]

      Sure, you *can* read this tutorial without the knowledge of the items above - the chances are that you just won't understand much. You may also be able to copy my lantern with ease, but that's not the point of this tutorial, but rather to show that it can be done (with relative ease) and this is just one way to do it. I'm pretty sure this whole thing can be done much more optimally and easily, but here's the way I made it.

      Oh, and I won't describe everything step-by-step. If you don't know how to set up a conversation or a custom gamesys, read a corresponding tutorial. Sorry, my space (and will to write) is limited Well, time to begin.


      Work, work, everyone loves work



      I'll start this tutorial by listing what we will want from this lantern (well, what I want anyway):
        [*]The usual portable lantern with light.[*]Player must be able to turn it on and off without the hassle of having to use other objects.[*]The light must not stay or linger behind. In other words, it must not bug.[*]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.[/list]

        Sounds good? I truly hope so, because that's what we're going to get.

        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).

        Now, when writing this tutorial, I'm copying pretty much everything from the test level I made - this means names and objects. Since I didn't originally plan to do a portable and toggleable lantern, I used a shovel as my initial lantern object. Yes, that's right, a shovel. Since the effect is based upon the fact that I'm teleporting the unlit lantern away from inventory and putting the lit one in there instead, it's also useful for debugging - you can quickly see which one you have in your inventory.

        Anyway, on with it. Let's create the unlit lantern. As I stated already, I used a shovel. For sake of simplicity, put it right into Garrett's inventory (with Contains). Name it IllumiShovel, and give it following props:
        Engine Features: FrobInfo: World Action [none], Inv [Script, FocusScript], Tool [none]
        Scripts: TrigInvFrob (it allows you to send CD-messages from inventory.)
        Renderer: Render type: Not rendered (So that player can't see a glimpse of this shovel when it's teleported away)
        Inventory:[*]Can't drop this: TRUE
        [*]Object Name: Lantern:"Lantern" (or whatever you want)
        [*]Type: Item


        Link IllumiShovel to LitConv. Now we need to do the lit lantern - I created a HackLight and named it LanternHack. Give it following props:
        Engine Features: Frob Info: [none], [Script, FocusScript], [none]
        Scripts: TrigInvFrob
        Shape: Model Name: roblant (this is the lantern model)

        Inventory:[*]Can't drop this: TRUE
        [*]Object name [use the same as in IllumiShovel]
        [*]Type: Item

        ControlDevice-link this to UnlitConv.

        Great. We have now two lanterns, but we can't yet switch between them. And, we are still missing the light! Let us do it first.

        Create another HackLight somewhere, and name it LanternLight. Add the following props:
        Rendered: Dynamic Light: 65 (or whatever you want)
        Light Color: 0.14, 0.70 (your choice, again)

        Good. And now, a bit of Act/React.

        The Attack of the Flowerpots



        I used a bit of S&R to get the light to teleport to the right place. Use whatever stim you want, I created a new stim for myself, JaniStim. Remember that you need to restart Dromed before you can use your new stim. Don't forget to save you mission/gamesys, or everything made this far have been in vain!

        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 our light to fire a stim 50 times/second. We will 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 light next to Garrett (which we will do 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 what we want. Radius of 10 is sufficient to always "stick" the light into Garrett - at least if he's not under the effect of speed potion. I have not tested this, but it's quite likely that if you are giving speed potions to player, you need to increase that radius.

        Since we now have a radius stim in LanternLight which affects player, I suggest you position it to blueroom, so that player doesn't accidentally walk into its radius and launch it prematurely.

        So, we now need to add that receptron to Garrett. Do a "find_obj garrett" to get yourself to the Garrett archetype, and give him a new receptron. Put stimulus to JaniStim (or whatever you named your custom stim), min intensity to 4 and max intensity to 6. 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 all - so 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.

        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 - I did with a TeleportTrap which I teleport right at Garrett, quite similarly to how I did the LanternLight above. We haven't created the TeleportTrap yet, but while we are here, we might as well add the receptron already. For this I also used my JaniStim, but set the min and max intensities to 19 and 21. Again, effect is "Teleport object", target is Source and agent Me. This time we do not need to edit the teleporting position - Garrett's central guts are fine.


        Beam me up, Scotty!



        It is time for the teleporting stuff. Let's take a look into what we really want:
          [*]Teleport our "Turned-off Lantern", in this case IllumiShovel, away when the Contains-link is broken (items which were previously in player's inventory appear into where Garrett was when the link was broken), to make sure that nothing funny happens, when the "Turned-on Lantern" gets moved into player's inventory.[*]Teleport our "Turned-on Lantern", LanternHack, away when the Contains-link is broken and the "Turned-Off Lantern" gets returned to player's inventory.[*]Teleport the light for lantern (LanternLight) next to Garrett when the lantern is turned on, so that the S&R trick we did earlier can kick in and stuck the light to Garrett.[*]Teleport the light for lantern away from Garrett when the lantern is turned off, so that it's too far for that S&R trick to work.[/list]

          Start this by creating two buttons into the blueroom. We will use these to activate our TeleportTraps, and we'll activate these buttons themselves via a conversation. I named them TeleportShovel and TeleportLantern. Next, create four TeleportTraps, two for each button. They do not need names, really, but naming them doesn't hurt, so that it's easier to keep track of them. I didn't name the first two, but the other two I did: LightIn and LightOut. These are used to teleport the LanternLight.

          Anyway, now for some linkages. Link TeleportShovel (with ControlDevices) to one of the unnamed TeleportTraps and LightIn. Link this unnamed TeleportTrap to IllumiShovel and LightIn to LanternLight. Next step, link TeleportLantern into the two remaining TeleTraps. Link other one of them to LanternHack and LightOut to LanternLight. That part is ready.

          Now, back to some S&R. Give LightIn your custom stim as a source, set propagator to radius, intensity to 20, radius to 500, remove raycast-flag, no max firings and period to 500.

          Guess what - it's time to do something with those conversation markers, and then we're ready.

          First, open up LitConv and add following:

            Action 0:
              Add Link
              Contains
              LanternHack
              player[/list](this bit puts the other lantern into player's inventory)
              Action 1:
                Remove Link
                Contains
                IllumiShovel
                player[/list](this one removes the first lantern from player's inventory)
                Action 2:
                  Frob object
                  TeleportShovel[/list](this bit activates the TeleTrap which moves IllumiShovel away from playing area and LanternLight near Garrett)[/list]

                  That's it! Now, do the following for UnlitConv:<

                    Action 0:
                      Add Link
                      Contains
                      IllumiShovel
                      player[/list](this puts the first lantern back into player's inventory)
                      Action 1:
                        Remove Link
                        Contains
                        LanternHack
                        player[/list](this one removes the second lantern from player's inventory)
                        Action 2:
                          Frob object
                          TeleportLantern[/list](this bit activates the TeleTrap which moves LanternHack away from playing area and LanternLight away from Garrett)[/list]

                          Phew. I'm done. Go ahead, try it out, and send some death threats to jsaarijarvi@hotmail.com if it doesn't work. I truly hope you understood at least a word from what I just wrote up there. Spitter signing out.

                          As a last note, there's HTML-ized version of this tutorial in my homepage. There's also a demo mission in there.
    Responsible for overseeing Studio Trophis projects, Richard's designs are influenced by the best of Japanese console gaming.

  2. #2

    Good work, Spitter I'm really impressed!!!

    Even with only a slight understanding of the different linking methods one has to use to achieve something in Dromed, I could follow your tutorial pretty well....

    [ September 30, 2001: Message edited by: newbieDromEder ]

  3. #3
    Member
    Registered: Mar 2001
    Location: ashland,or,usa

    Awesome, can't wait to try it, thanx Spitter. I might just add a link to your tut from my custom lantern.txt since its pretty long and involved.
    Badd Cog's Gallery -Is that you good cog? Heh, Heh. NO!
    Crom's Blade,JailBreak,TrainSpotting,3MagesTomb
    Custom AI's,Objects,Missions,Demos,Tutorials,Downloads,Links...
    ModelMakersVault- custom objects for your missions.

  4. #4
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    okay, i'm working on this lantern, the only problem, when i frob the shovel to make the light turn on it doesn't teleport the light to garrett it teleports it to the "on" controlled teleport trap. frobbing the lamp to make it turn off sends it to the "off" teleport trap, but the dynamic light never arrives at garrett

    the stim and receptrons work, if i walk past the light it attaches, frobbing the lantern removes it to the teleport trap. the conversations are correct and links are correct the parts were multibrushed directly from the tutorial. i check the targets for the receptrons, and those are right, so i'm a bit stumped, has anyone else gotten this thing to work?

    the weird thing is the receptrons on garrett, the min and max should be 4 and 6 for the on part, but the screen showing garretts receptrons show 4 and 4, open it up and it shows 4 and 6 still. making a new stim doesn't change this.
    Last edited by Ottoj55; 2nd Dec 2003 at 15:13.

  5. #5
    Member
    Registered: Jan 2000
    Location: Pepperell, MA
    the weird thing is the receptrons on garrett, the min and max should be 4 and 6 for the on part, but the screen showing garretts receptrons show 4 and 4, open it up and it shows 4 and 6 still. making a new stim doesn't change this.
    That's a bug in the dialog box for the display of the stims / receptrons. Opening the stim or receptron shows the correct values.

    As for the rest of it working, I can't tell. I went through my own personal receptron hell to make the Light Mushrooms work like lanterns in Lorgan's Web. I won't willingly go back and look at another one.
    Shadowspawn's Thief Pages
    Darkness is always faster than light. No matter how fast light travels, it always finds the dark waiting for it.

  6. #6
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    i appreciate knowing that its a bug, and i've tried everything, i'm going to flow chart the conversations, teleports and what not so that i know what goes where, its possible i have one tiny mistake that i can't find without applying the fine toothed comb to it.

  7. #7
    Member
    Registered: Jul 2003
    Location: United Kingdom

  8. #8
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    sluggs, i tried that lantern but it wasn't switchable which is why i'm trying this one. i had an idea about maybe sticking a teleport point permanently to garrett to makes spitters lantern work, but for what i want to do, i may be able to just use yours instead, less fussing about to make it work and i really don't care to much if its not switchable, i just thought it would be neat.

  9. #9
    Member
    Registered: Jan 2000
    Location: New Jersey (!)

    Mr. Harris is less stingy than I, you know...

  10. #10
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    and so, saver of the gayle, do you have a script that would solve this problem?

  11. #11
    Member
    Registered: Jan 2000
    Location: New Jersey (!)
    His source code is published for your perusal and reuse.

  12. #12
    Member
    Registered: Aug 1999
    Location: terrible canyons of static

    Whoa. It's amazing how much you can/will forget in two years. That tutorial is, should I say, much fuss for nothing, since I never ended up using it in a finished mission anyway.

  13. #13
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    i did hope to use it, but couldn't get it to work, the light will not teleport to garrett no matter what i do, the demo works, but when set up correctly i can't make it work. maybe its a dromed issue, i'll worry about it someother time.

  14. #14
    Member
    Registered: Sep 2001
    Location: Dimport's upstairs bedroom
    Originally posted by Ottoj55
    i did hope to use it, but couldn't get it to work, the light will not teleport to garrett no matter what i do, the demo works, but when set up correctly i can't make it work. maybe its a dromed issue, i'll worry about it someother time.
    For LightIn, check to make sure that the flag "No Max Firings" is set on your source under the Edit Life Cycle menu. The way the tutorial worded things, I originally changed the value of Max Firings to 0 when it should be 1.

  15. #15
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    i might go back and try that, but at this point i don't feel like starting that mess over.

  16. #16
    Member
    Registered: Nov 2002
    Location: Maryland
    OK, I've got this working very well - as long as I stay close to the blue room. Once I wander away, it refuses to turn on or off.

    My start position is about 200 units away from the blue room objects, and the lantern won't turn on for the first time until I get within 30 or so. It won't turn off again unless I stay within that general distance.

    Since the only two radius settings for the stim sources are 10 and 500, this doesn't make much sense to me.

  17. #17
    Member
    Registered: Nov 2002
    Location: Maryland
    Noone knows, eh?

    The same thing happens in Spitter's demo mission: I multibrush the play area, move it a good distance away on all three axes, optimize, relight, and enter the game.

    Just to be sure, I knocked loose enough brains to dredge up my book-learning (it is, after all, only two hypoteni), and figured out the exact distance from the start area to the teleport traps is only 150 units, in the case of my mission above.

    The teleporting works - the shovel turns into the lantern - but the lantern hack doesn't come with it (i.e., no light). After a few inventory frobs as I wander around the play area, the lantern or shovel refuses to teleport away anymore (in one test, it stopped working on the lantern, the next time, the shovel). Sometimes, if the light does turn on, it refuses to turn off.

    I suspect it has something to do with the engine ignoring AI if you're a good distance away. If this is the case, then this portable lantern method may not be useful despite all the work going into setting it up. But if this is so, then blue room conversations wouldn't work in so many cases someone else would have pointed it out in this thread already.

    So what's the deal?

  18. #18
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    the ai are going into efficient mode, since you are not close enough to interact with them, you'll need to add a metaproperty to stop this from happening it think.

  19. #19
    Member
    Registered: Nov 2002
    Location: Maryland
    D'oh! There is no M-NeverEfficient metaproperty in the Dedx gamesys. I'll figure out how to add it back in... hopefully.

    (Amazing how useful the search function becomes once you know what you're looking for is called)

  20. #20
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    not to revive a very old thread, but i tried it out again, it works so long as you don't run, i kept easily outrunning the teleport trap. its funny to see a light stuck on a ladder turning on and off. seems to me it would work better if you used a metaproperty, add it to a marker/ remove it from garrett it jumps there, remove from a marker/add to garrett it jumps back.

    basically what to do is this:

    put the lightin teleport trap near garretts start point, this trap should be set up with a new stim source identical to janistim, maybe janistim2. then set the receptron on garrett the same as the receptron for janistim, this keeps the teleport point stuck to you better.

    i also added a metaproperty, m-light with the receptron for the light, the conversation for light on adds it to garrett, removes it from a blue room rat, the light off conversation reverses this, thus the light can only stick to garrett or the rat, so you can avoid worrying that the light will stay somewhere unusual or stick to you if you walk by too close to the blue room.

    also the teleport traps to teleport the illumishovel and lanternhack are redundant, so you can drop those. it now works perfectly.
    Last edited by Ottoj55; 14th Jul 2004 at 12:26.

  21. #21
    Member
    Registered: Nov 2002
    Location: Maryland
    Ugh. This heartless beast made me quit dromediting -- less than four days after my post above.

    But she's still calling me, all these months later...

  22. #22
    Vertical Contest Winner 2009
    Registered: Sep 2002
    Location: The Great White North
    i've perfected it, if you have questions contact me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •