Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question about activate a light bulb #105463
01/05/07 16:22
01/05/07 16:22
Joined: Jan 2006
Posts: 53
L
LWD Offline OP
Junior Member
LWD  Offline OP
Junior Member
L

Joined: Jan 2006
Posts: 53
Hi!
I created a code of a light bulb:
entity* light_bulb;

var green = 128;
var blue = 128;
var red = 128;

action light_bulb
{
light_bulb = me;
my.passable = on;
my.invisible= on;
my.lightrange = 300;

while (1)
{
my.lightgreen = green;
my.lightred = red;
my.lightblue = blue;
wait (1);
}
}

And i want to activate this light bulb just when the player press a interruptor in the wall... Somebody can help me with this?
Thanks!

Last edited by LWD; 01/05/07 16:27.
Re: Question about activate a light bulb [Re: LWD] #105464
01/05/07 20:06
01/05/07 20:06
Joined: Sep 2005
Posts: 274
Switzerland - Zurich
zwecklos Offline
Member
zwecklos  Offline
Member

Joined: Sep 2005
Posts: 274
Switzerland - Zurich
hi there
you could do something like this:

Code:


var green = 128;
var blue = 128;
var red = 128;

function turn_it_on()
{

if(interruptor_pushed == true)
{
light_bulb.lightrange = 300;
}
else
{
light_bulb.lightrange = 0;
}

while (1)
{
my.lightgreen = green;
my.lightred = red;
my.lightblue = blue;
wait (1);
}

}

action light_bulb
{
light_bulb = me;
light_bulb.passable = on;
light_bulb.invisible = on;

turn_it_on();

}




you could also increment lightrange step by step to get a dim effect


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1