Gamestudio Links
Zorro Links
Newest Posts
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,089 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Dynamic Light #285989
08/22/09 03:46
08/22/09 03:46
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
I created an action that make a dynamic light to be on and off in a room.

action luz_random
{
my.lightred = 250;
my.lightgreen = 250;
my.lightblue = 170;
while(1)
{
my.lightrange=200;
sleep(1.5);
my.lightrange=0;
sleep(1.5);
}
}


it works good.
But i see that my gun entity defined in layer 1
is afected for the dynamic light when it is turned ON even when i am in other rooms of my world and separated from walls.

entity gun0
{
type = <el_revolver.mdl>;
ambient = 0;
pan=90;
x= 5;
scale_x=2;
scale_y=2;
scale_z=2;
layer=1;
y= 3;
z= 0;
ammo=0;
numbergun=1;
recargar=1;
}


I dont want that happens , but i dont know why it happens.

Thank you for your help, friends

Last edited by Erick_Castro; 08/22/09 03:48.
Re: Dynamic Light [Re: Erick_Castro] #286015
08/22/09 11:57
08/22/09 11:57
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
I'm quite sure that it happens because it's a view entity - it does not exist in world-space, thus walls etc. won't block the light sources/cast shadows on the view entity.

The only things to prevent it that comes to my mind:
- Turn lighting off for the view entity
- Make a normal entity (in world-space) instead

Re: Dynamic Light [Re: Claus_N] #286023
08/22/09 12:31
08/22/09 12:31
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Claus_N I'm allso using view entity in my game, and I have problem with it. I cannot use shader on it! There is no dynamic light!!! X_x WHAT I HAVE TO DO?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Dynamic Light [Re: 3run] #286074
08/22/09 21:48
08/22/09 21:48
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
View entities got its limitations. I don't know whether a material can be attached those, but if not, you'll simply just have to use a normal world entity I'm afraid.

Re: Dynamic Light [Re: Claus_N] #286077
08/22/09 22:03
08/22/09 22:03
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
Claus_N Thanyou for your help.
The entity, or view entity, of my gun i defined the next way:

entity gun0
{
type = <el_revolver.mdl>;
ambient = 0;
pan=90;
x= 5;
scale_x=2;
scale_y=2;
scale_z=2;
layer=1;
y= 3;
z= 0;
ammo=0;
numbergun=1;
recargar=1;
}


How can i define it like a real entity in the world space?
o how can i turn off the lights of the view entity?

thank you friend.




Last edited by Erick_Castro; 08/22/09 22:04.
Re: Dynamic Light [Re: Erick_Castro] #286123
08/23/09 09:21
08/23/09 09:21
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
You can do it like this:

Code:
entity* theGun;

function gun_function()
{
	my.passable = on;
	my.ambient = 0;
	vec_scale(my.scale_x,2);
	
	while(my)
	{
		vec_set(my.pan,camera.pan);	// Same angle as camera
		
		vec_set(my.x,camera.x);		// Same position as camera
		
		// play around with these values
		my.x += 5;
		my.y += 0;
		my.z += 0;
		
		wait(1);
	}
}

function createGun()
{
	if(theGun != null) {ent_remove(theGun);}
	
	theGun = ent_create("el_revolver.mdl",camera.x,gun_function);
}



Edit: If you want multiple guns, I suppose it's better to use ent_morph to change the gun model, instead of creating multiple gun entities and switching which one is visible smile

Last edited by Claus_N; 08/23/09 09:23.
Re: Dynamic Light [Re: Claus_N] #286232
08/24/09 02:47
08/24/09 02:47
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
Claus_N thank you for your time and your help, friend!


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