Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by 7th_zorro. 04/27/24 04:42
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Quad), 773 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
light on or off #452969
07/02/15 11:24
07/02/15 11:24
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

Joined: Jan 2005
Posts: 282
devon UK
Yet another problem !!
I have a lamp over a desk (lamp composed of shade (mdl), flare bit map and the actual ‘light’, which I want to turn on or off as needed.
As a light does not have a 'behaviour' I can't give it an 'action'.
I can find no data in the manual or the forum to do this.
Anyone got any ideas please?
Kind regards, David

Last edited by DAVIDMORETON; 07/02/15 11:27.
Re: light on or off [Re: DAVIDMORETON] #452982
07/02/15 19:38
07/02/15 19:38

M
Malice
Unregistered
Malice
Unregistered
M



Create a second mdl"cube" in the script with ent_creat()
set it's flags to invisible, set it's flag to LIGHT,
set it's lightrange to say 100;
in the ent_create - assign it a action
in the action you turn the light on and off by setting reseting the LIGHT flag or settting lightrange to 0 or >0

Re: light on or off [Re: ] #453002
07/04/15 07:20
07/04/15 07:20
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
hey, don't create a CUBE, just create an empty model via script:
Code:
ENTITY *light = ent_create(NULL, position, action);
light->lightrange = 100; // Or similar

// Switch on/off
if(toggle) {
 light->lightrange = 100 - 100 * (light->lightrange > 0);
}



Visit my site: www.masterq32.de
Re: light on or off [Re: MasterQ32] #453011
07/05/15 10:23
07/05/15 10:23
Joined: Jan 2005
Posts: 282
devon UK
D
DAVIDMORETON Offline OP
Member
DAVIDMORETON  Offline OP
Member
D

Joined: Jan 2005
Posts: 282
devon UK
Thanks Guys,
Where would the unskilled be without help from people like you? Thanks again, David


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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