Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / sliding light?

Author
Message
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 23rd Aug 2005 21:48 Edited at: 23rd Aug 2005 23:22
how I can make a sliding light in DBC?
If I make a light it goes throught walls in my .x level.

[href][/href]
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 24th Aug 2005 10:43 Edited at: 24th Aug 2005 10:44
If you want it to slide side ways (x axis) you may want this[assuming it is light 1 you're using]:



If you seek one that moves forwards and backwards (Z Axis):


All right, I believe that code should serve you well

P.S.= You even got me to look in the book to make sure the light position x(1) actually existed! [However, I was correct and how I have it is just like in the book]

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Aug 2005 10:48
I've read it, re-read it and then read it some more, but I still can't understand the question I'm afraid!

What on earth is a 'sliding light'?

TDK_Man

Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 24th Aug 2005 10:49
i think he means that his light goes through the walls and he doesnt want it to


master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 24th Aug 2005 10:53
Oh......so you want a collision detection so it doesn't go through walls? MAN! If that's true I wasted 4 minutes making that code! I was feeling so proud of myself

If that is true, you probably should figure out the x,y,z positions of the walls you don't want the light to go through. Or, you could have a looksy at the "sparky's collision dll" - I think I got that name right, I haven't actually used it, but I hear it's pretty good

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 24th Aug 2005 10:56
make a little sphere around your light and place it on the same place. collision sphere = collision light

Immunity and Annihalation makes Immunihalation...
Zotoaster
20
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 24th Aug 2005 10:58
does that stop the light from showing on the other side of the wall?


master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 24th Aug 2005 10:58 Edited at: 24th Aug 2005 11:00
Good I idea Sven B. I had to do something similiar in one of my games so that both players could hide in the same "King of the Hill" square - so there were two objects that made up one, so the collision was faster

Beat me to it Zotoaster! If the sphere is larger than the light, the collision should take place and do whatever is does when it collides (moves or stops) before the light goes through the wall [in theory anway]

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 24th Aug 2005 15:58 Edited at: 24th Aug 2005 15:58


[href][/href]
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Aug 2005 03:54 Edited at: 25th Aug 2005 03:55
When you put it like that, it's pretty tricky.

I'd use something like this:

Find the distance to the wall with the x,y,z stuff. Decrease the intensity of the beam according to the distance (I'll get some code in a sec)

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Aug 2005 13:28
Mmmm, I was more thinking on sliding collision for a light...

Anyway, I don't know if DBC can do that...
Maybe master programmer can do something like that, but I don't know if it'll work with more then 1 walls...

Immunity and Annihalation makes Immunihalation...
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 25th Aug 2005 14:21
the best soulition would be to make a lightmap.
but then again.. the lights wont move


TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Aug 2005 15:18
Wouln't you have more luck by using a ghosted yellow sphere at the point at which the light's beam hits a wall - rather than display the beam itself?

If you see what I mean?

TDK_Man

Link102
20
Years of Service
User Offline
Joined: 1st Dec 2004
Location: On your head, weeeeee!
Posted: 25th Aug 2005 16:32 Edited at: 25th Aug 2005 16:34
Are we talking about light that makes dark and light sides on your model or a lightmap kind of thing?

If it's the first the just make several rooms out of your level, then when your in one room the light in the other room is off.

Don't look at my sig!
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Aug 2005 19:59
I agree with TDK, I'd use a ghost model. Then, you can use collision with the model which will work better (and it will be easier to program).

Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 25th Aug 2005 20:04
but when you step inside that model, it will look realy strange.
even with culling turned on.


master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Aug 2005 20:09
Then you can sure use the light, it will just be tricky to find the distance (if it moves) and decrease the distance(or intenstity) the beam has so that it doesn't go through the wall.

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 25th Aug 2005 20:39
Ok i get the distance but how I can decrease the distance?

[href][/href]
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Aug 2005 21:36
If you really want to impress your mates, use real lights!

(Media attached)...



TDK_Man

Attachments

Login to view attachments
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 25th Aug 2005 23:02 Edited at: 25th Aug 2005 23:07
What have I done wrong?


[href][/href]
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 27th Aug 2005 10:26
Well I see a big black rectangle with a gray splot and it looks like a light on a wall, I just can't see it, sorry

Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Aug 2005 10:51
I think he wanted to apply TDK's code...

Immunity and Annihalation makes Immunihalation...
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Aug 2005 15:59
Yes thats the light

[href][/href]
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 28th Aug 2005 01:37
Yeah, I figured that one out, but, I can't see what's in the screenshots so how would I know what's wrong?

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 28th Aug 2005 12:30
TDK's light is round my light is angularly

[href][/href]

Login to post a reply

Server time is: 2025-05-22 12:54:09
Your offset time is: 2025-05-22 12:54:09