Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, rki), 390 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[SOLVED]Setting light as dynamic? #401107
05/13/12 18:12
05/13/12 18:12
Joined: Apr 2012
Posts: 62
wrekWIRED Offline OP
Junior Member
wrekWIRED  Offline OP
Junior Member

Joined: Apr 2012
Posts: 62
I like to make a candle with flame to light a certain part of my level and it should be able to cast shadows when the light hits an object. When using set(my, LIGHT) on the flame entitie how do i make it dynamic just like how i set light properties on WED?

Last edited by wrekWIRED; 05/15/12 16:39.
Re: Setting light as dynamic? [Re: wrekWIRED] #401108
05/13/12 18:16
05/13/12 18:16
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Set its lightrange to a value > 0.

Re: Setting light as dynamic? [Re: PadMalcom] #401125
05/14/12 03:56
05/14/12 03:56
Joined: Apr 2012
Posts: 62
wrekWIRED Offline OP
Junior Member
wrekWIRED  Offline OP
Junior Member

Joined: Apr 2012
Posts: 62
Ow. So it's set to dynamic when lightrange is > 0. That's strange. I alredy set the light range using thses. But doesn't cast any shadows unlike the light i set using WED.
Code:
my.lightrange = 150 + random(20);



Re: Setting light as dynamic? [Re: wrekWIRED] #401126
05/14/12 06:35
05/14/12 06:35
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
activate the CAST flag on the light, and the SHADOW flag on all objects that should have shadows

Last edited by Espér; 05/14/12 06:35.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Setting light as dynamic? [Re: Espér] #401133
05/14/12 09:43
05/14/12 09:43
Joined: Apr 2012
Posts: 62
wrekWIRED Offline OP
Junior Member
wrekWIRED  Offline OP
Junior Member

Joined: Apr 2012
Posts: 62
Negative. I tried setting SHADOW and CAST flags but still no shadow is cast.

Here are the screenshots taken in two lights i use. One uses light set by WED and other one is set using lightrange.

this one i set lightrange to 200 to an invisible object above the candle.



this one i set using WED. Light is same sa the flare above the candle on the fist screenshot and flags set is dynamic and lightrange of 150.


i set the following variable on main fuction to set the shadow.

Code:
shadow_offset = 5;
shadow_range = 15;
shadow_threshold = 60;
shadow_stencil = 2;
mat_shadow.alpha = 90;



Is there something wrong with the way i set the light on the candle? Or is there a better way to add light using lite-C and set it's property just like in WED?

I see that the light created by WED is quite different from setting it to a entity.

Re: Setting light as dynamic? [Re: wrekWIRED] #401148
05/14/12 13:30
05/14/12 13:30
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
I can see a shadow on second picture. It belongs to the white box.
An advise, try to increase the value of the lightrange, perhaps first time to 600.

Re: Setting light as dynamic? [Re: Aku_Aku] #401152
05/14/12 14:52
05/14/12 14:52
Joined: Apr 2012
Posts: 62
wrekWIRED Offline OP
Junior Member
wrekWIRED  Offline OP
Junior Member

Joined: Apr 2012
Posts: 62
did that already but still the same result. Not to mention it also lits the other room where it it should not brcause of the wall. I was thinking of controlling the light i add using WED if it's posible.

Re: Setting light as dynamic? [Re: wrekWIRED] #401153
05/14/12 14:58
05/14/12 14:58
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
is the lightbox a model or a block?
if it's a block, dynamic light won't throw a shadow


Visit my site: www.masterq32.de
Re: Setting light as dynamic? [Re: MasterQ32] #401157
05/14/12 15:43
05/14/12 15:43
Joined: Apr 2012
Posts: 62
wrekWIRED Offline OP
Junior Member
wrekWIRED  Offline OP
Junior Member

Joined: Apr 2012
Posts: 62
its a model. I add the model on top of the candle where the flame is and set it's light property.

I use the following codes.
Code:
function candleflame()
{
	set(my, PASSABLE);
	set(my, INVISIBLE); //set model to invisible
	set(my, LIGHT);
	vec_set(my.blue,vector(255,255,255)); //set light to white
	my.lightrange = 200;

}

//attached to the candle action
ent_create ("nothing.mdl", vector(my.x,my.y,my.z+17), candleflame);



Just not sure why it does that.

Re: Setting light as dynamic? [Re: MasterQ32] #401158
05/14/12 15:44
05/14/12 15:44
Joined: Apr 2008
Posts: 245
GameScore Offline
Member
GameScore  Offline
Member

Joined: Apr 2008
Posts: 245
try something like this

Code:
action DynLight()
{
	set(my,INVISIBLE);
	set(my,PASSABLE);
	
	my.red = 255;
	my.green = 255;
	my.blue = 255;
	my.lightrange = 1000;
	set(my,CAST); 
	my.emask &= ~DYNAMIC;

}



Page 1 of 2 1 2

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