Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Asking for a smart solution to a problem I made to myself - Please read.

Stay with me during the post. .)

See, I got this idea: I enter a dark map. A dark room, because it's night. I see a lamp, and I try to press it. When I pressed it, the lamp lits, and the room lightened, with shadows dancing. From what I've seen, during my attempt, you need 5-6things:

1) A Lamp sprite
2) An event on this sprite with the "light ball" image from suppport
3) A Glow effect (Say Kraft's for this one).
4) Dynamic Light and Shadow Script (rataime, trebor)
5) A fog for the room with cosmatic lights.
6+) Particle effect for the really sick ones. (Scratch that. No pe in this one)


So, what do I want? I'm simply trying to make a realistic (as close as possible) effect of what would happen if I lit a lamp in the dark room. What is my goal? My goal is to allow player at the same time to, when hits action on the lamp, alter the sprite + activates the shadows + Kraft's glow effect to iluminate + change the fog to lighten the room, and then, on desire, decide to turn off the lamp and cancel all the above. See, at first moment I thought "well that's easy". But either due my incapability or difficulty, it seems it ain't so simple.

I started from hitting action at the lamp. I made an event which starts the fog but puts the opacity to 0. There is also a tint screen inside with dark tint as night. Because character moves around the maps, I made another event which automatically disables the glow effect. But I had to prevent the glow from returning, so I made a local to second page of auto-glow off event. Then, I put an event on the lamp, when you hit lamp, the lightball sprite activates, the fog capacity changes to very light in 20 frames so you get the feeling of room-lightening, the switch operation activates glow which adds luminosity, and loads the light source 360degree to cast shadows. That actually works - but you have to prevent the paralel auto-processes (Glow off, fog to 0, no source light) etc) from conflicting with the lamp event because you have to count that we want the player to be able to turn it off as well. So you have to make a local switch to the next  page with these events with preconditions that are activated on the first page (also with Action hit), but at the same time route via switches to other events to prevent the parallel events from conflicting. Then, on this new hit, is where my problems start, because I'm supposed to turn off all these effects and return them back to the original state. Even that ain't the real problem - the real problem is how to turn them on again. So you have to somehow route them back to page 1 with preconditions set on the first page that are activated via new events who allow the first page to perform. or make a third page thatis routed from second, which then routes tosecond (if possible) while canceling the  parallel process - but you must take into concern that a player might return to this house, in what case all these situations must be restored to the original - if the player turned off the lamps, or, make them stay - if the player did not turn them of - what means new switches, and conditions.

NOW,

Is anyone smarter than me and has a very simple solution (or a clear idea how to simplify the branching and routing) to how to effectively emulate realistic turn-on-the-lamp, or this actually really is this complicated as I written it, and therefore it looks like I'll ave to sketch a plan, rather than just route everything as I go?
 
Umm... it's sort of hard to understand all that, but why can't you just turn on/off a switch when you turn on/off the lamp, and check, if the switch is on, run the light, glow, fog and other effects? You might need to edit the dynamic light and shadow script to work only if a switch is on or something, but won't that be a lot easier than all these events?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top