Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,534 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | chip programmers | 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