The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Bare minimum to turn on/off a light in the game
jorgeas80 Offline
Junior Member

Posts: 21
Threads: 7
Joined: Jan 2014
Reputation: 0
#1
Bare minimum to turn on/off a light in the game

Hello,

I have a LEDs lamp that can be turned on using a C library. I mean: I can send my lamp messages like "use this RGB color during this amount of time". It accepts effects like flickering or fade too.

So, I have this lamp in my desk, and I want to "connect" the game with it. For example:
  • When the user turns on his lantern (or glowstick), my LEDs lamp turns on too, with the same color
  • When the user enters a place that contains a light, my LEDs lamp turns on too. I can control the fade (if I move closer to the light in the game, I can send more intensity to my LEDs lamp)

I've successfully compiled the code. And I can link with my C library. Now, I just want to work with the light part of the engine. Looks like there are 2 main classes I should work with:
  • GameLamp
  • PlayerHands

I guess I should modify the method FadeTo of iLight class, to send the proper RGB code and time to my lamp, using my own library's functions. So, any time a light is turned on in the game, is also turned on in my desk. Apart from that, am I missing something important, in order to achieve my goals?

I'm also adding a new menu entry to enable/disable my stuff, but this is a different story, involving MainMenu.cpp, mostly.

Any tip is appreciated. Many thanks in advance!
(This post was last modified: 02-10-2014, 02:29 PM by jorgeas80.)
02-10-2014, 02:26 PM
Website Find


Messages In This Thread
Bare minimum to turn on/off a light in the game - by jorgeas80 - 02-10-2014, 02:26 PM



Users browsing this thread: 2 Guest(s)