Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by 7th_zorro. 04/20/24 07:29
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, henrybane, flink, Edgar_Herrera), 758 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
Single Light System, regions #468047
09/14/17 18:05
09/14/17 18:05
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hello friends!

In a shader, I have 1 light source, its position and intensity is based on the entity's vecskill. Its fine and swell, I can move it around wherever I want, each entity gets their own personal light.

So looking ahead, in my game which is primarily going to be outdoors, I wanted to see if I could setup a system where this personal light would switch between the sun position, and between another position designated by the level. So for example, if an entity walks into a room with a fireplace, I want the shader's personal light to go to the fireplace position. If the entity steps out, the personal light should switch to the sun.

My first thought is to try using regions! I can make a region inside a cabin, and if the entity is within that region, its personal light will switch to the fireplace. If the entity is not in a region, he will switch his personal light position to the sun. The problem here is that, regions dont have any other attributes other than a name! They dont have any skills I can set in WED, therefore I cant manually type in a light vector.

I would like to stay away from using distance based calculations, because it would then require a trace. If the player is outside the cabin, but closer to the fireplace, his personal shader light will go the fireplace. If thats the case, I would need a trace to fix this.

Is there a way to give each region an individual vector?

Re: Single Light System, regions [Re: jumpman] #468049
09/14/17 18:19
09/14/17 18:19
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You could just put an entity in the region, give it the same name and use region_find + ent_for_name to read its skills.

EDIT: @below: You are welcome! wink

Last edited by Superku; 09/15/17 08:40.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Single Light System, regions [Re: Superku] #468055
09/15/17 00:11
09/15/17 00:11
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hi Superku, ive tried your system....and it works!! THANK YOU! You are a clever dude!

Last edited by jumpman; 09/15/17 00:11.

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