Portable Lantern

Darkweaver
Someone suggested I post this since I found a way around making an actual portable lantern. Since I'm a newbie and coding is beyond me, I did this all through the GUI interface.

First off, I made the Lamp a container. I made it a Limited Container but you don't have to. Add in for "Opening" text as "You turn the lamp on" and for "Closing" type "You turn the lamp off." Now, I made the excuse the lamp has a sliding panel that you can open and close. So when it is open, the light source inside emits the light and when it is closed, the light source can't be seen.

http://i.imgur.com/hCCtgEL.png

Now, I placed the light source inside the container. In my case, I call it a "Glow Stone" which is a magical stone that emits light. Make sure you have "This Object Is A Light Source" checked. So, create whatever you want to call the light source and make the Lantern the parent. Make sure the "Glow Stone", your light source, cannot be taken out of the lantern (unless you want it to but it just complicates things imho).

So, now you have your Lamp except we want to be able to "Turn On" and "Turn Off". So go to the Verbs in the Lamp object and put in the following in the screenshots I made.

http://i.imgur.com/DEOUSTV.png

http://i.imgur.com/LQVY3Tc.png

And there you have a portable lamp that works. Make sure to set the rooms you want as dark to "Dark".

I tested it a few times and this works perfectly. For example, if the lamp is not on, the room will be dark. If the lamp is on and you drop it in the room, the room will still be lit (I heard people saying they had problems with this). If you drop the lamp in another room and return to the dark room, it will be dark again. So, this works perfectly from my tests.

Hope this helps anyone who had any issues with portable lamps.

Again, the only catch is that you will need to make the light source in the container. But I made a decent enough excuse why it works that way. :P

Also, I know nothing about coding so this is all GUI example which may be good for dumb dumbs like myself and maybe not so good for those more experienced with the coding. :oops:

HegemonKhan
excellent guide!, and being done with the GUI~Editor is really great, as there are a lot of new people to quest and~or to coding, so this is of great help, as you know well, needing GUI~Editor, as you don't know how to code, like A LOT of people. So, this is great for all the new people, who're unable to use code.

Silver
Another way of doing this is to make the lamp itself a light source. You also make another lamp that isn't a light source and place it in a room not linked with the game (I call this room 'junk' set up for these purposes).

When you switch the light on and off you merely swap the two lamps by moving one to junk and the other to inventory and vice versa.

Of course it could prove problematic if switching the lamp on or off when not carrying it so you just add an IF object is carried at the start of the script with an Else preventing you from doing it unless it's being carried.

I came across this myself with matches. I needed a box of matches, a lit match (the light source) and burnt matchsticks appearing as room objects when the match extinguished. Easily achieved by shifting objects back and forth from your object room.

Silver
Actually I'm not sure my way works ^^ with the way switchable objects are set up as there isn't the option to run a script from the start. You would need to not make the object a switchable object and set up the verbs yourself. Then it would work.

Darkweaver
Silver wrote:Actually I'm not sure my way works ^^ with the way switchable objects are set up as there isn't the option to run a script from the start. You would need to not make the object a switchable object and set up the verbs yourself. Then it would work.

Exactly.

The Lantern isn't switchable. It's a container. However, I added the "Turn On" and "Turn Off" verbs so when you turn it on, it opens the lantern. When you turn it off, it closes it.

The way the lantern works is, as mentioned above, it's a container. The lantern in the game has a shutter that opens and closes revealing a magical stone inside that is always lit. This Emberlight stone in inside the container and I have it checked as a light source.

That's pretty much the wacky way I did it but it actually kind of fits the lore that I want. This may not suitable for what everyone wants depending on how your world works, assuming your game does not take place in the "real" world.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums