Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (TipmyPip, AndrewAMD, Quad, aliswee, degenerate_762), 970 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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