Forums Gallery Downloads LOGIN |REGISTER

[Free SDK] How to make a 'flashlight'

Gameplay Setup, SP/MP Logic, Audio Setup, AI Logic, Entity Usage, etc.


 

Spify
Not my first Rodeo
Not my first Rodeo
 
Posts: 489
Member since: 20.07.2011, 10:22
Location: Frankfurt am Main
Likes: 5

Re: [Free SDK] How to make a 'flashlight'

Postby Spify » 05.06.2012, 09:36

No, probably a light shaft won't be visible but you can fake that as well.

On top of everything, you could beam a GeomEntity to the same position where you beam the light. This GeomEntity should point to beam.cgf which should be by default in the build (\Game\objects\Lights\beam.cgf). If you can't find it, go to \Game\Objects.pak, open it with winrar or winzip and extract the Lights folder. There you can find beam.cgf and the material for it...

At this point you are pretty much set.
Attachments
Lightshaft.JPG
User avatar
VokusX
Not my first Rodeo
Not my first Rodeo
 
Posts: 523
Member since: 18.08.2011, 15:08
Location: Canada
Likes: 2

Re: [Free SDK] How to make a 'flashlight'

Postby VokusX » 05.06.2012, 21:11

Thanks!
[1:49:53 PM] fedayk1ntr: Join the Dark side
[1:50:04 PM} themodman101: You may have cookies, but we have all the milk.
User avatar
TheLegend
Just getting started
Just getting started
 
Posts: 40
Member since: 30.04.2011, 03:14
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby TheLegend » 17.07.2012, 10:22

Hey, I've run into a similar problem. I'm trying to get the Flashlight to match the camera's position exactly, Including the Pitch. In concept: When you look up, so does the light. When you look down, etc. I've gotten close, but instead of going up (when looking up) it goes down and vice-versa. I've attached that part of the FG below.
Attachments
FG.png
Spify
Not my first Rodeo
Not my first Rodeo
 
Posts: 489
Member since: 20.07.2011, 10:22
Location: Frankfurt am Main
Likes: 5

Re: [Free SDK] How to make a 'flashlight'

Postby Spify » 17.07.2012, 11:03

Try to take the pitch and multiply it (Math:Mul) with -1(negative one) then get the result into that Vec3:ToVec.
User avatar
TheLegend
Just getting started
Just getting started
 
Posts: 40
Member since: 30.04.2011, 03:14
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby TheLegend » 17.07.2012, 11:20

Works perfect now. Thank you, Sir! :D
Spify
Not my first Rodeo
Not my first Rodeo
 
Posts: 489
Member since: 20.07.2011, 10:22
Location: Frankfurt am Main
Likes: 5

Re: [Free SDK] How to make a 'flashlight'

Postby Spify » 17.07.2012, 11:23

You're welcome! I should change my name into Sir-Spify :P :D
User avatar
TheLegend
Just getting started
Just getting started
 
Posts: 40
Member since: 30.04.2011, 03:14
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby TheLegend » 17.07.2012, 11:36

Cry-Sir-Spify. Just saying. :P
ilovegamemaking
Just getting started
Just getting started
 
Posts: 92
Member since: 18.10.2011, 19:32
Location: germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby ilovegamemaking » 02.08.2012, 19:41

hi, i'am sorry to answer to an already solved topic but i found a better not so "fps dropping" way:
key7.jpg
BennzX
Just getting started
Just getting started
 
Posts: 87
Member since: 09.06.2012, 01:21
Location: Germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby BennzX » 03.08.2012, 00:38

Taking to the first flowgraph - if you're going to prone or crouching, the light will stay at the same point on height-axis (z). So, if you're taking the camera height instead of 0.8 m it would be more nice.
ebagdrof
Just getting started
Just getting started
 
Posts: 70
Member since: 27.08.2011, 10:06
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby ebagdrof » 03.08.2012, 01:25

ilovegamemaking wrote:hi, i'am sorry to answer to an already solved topic but i found a better not so "fps dropping" way:

How do I assign my flashlight light/entity to these:
Image
I've got it set up fine (I think)
Image
(in the above image my light called "flashlight" selected, thats where I started the flowgraph)
Here's a closer version of my light's properties...
Image
Spify
Not my first Rodeo
Not my first Rodeo
 
Posts: 489
Member since: 20.07.2011, 10:22
Location: Frankfurt am Main
Likes: 5

Re: [Free SDK] How to make a 'flashlight'

Postby Spify » 03.08.2012, 10:26

Select the flashlight then go to flowgraph and right click on Choose Entity (red field) and then click on 'Assign selected entity' (or 'Assign graph entity' - it doesn't matter - I just prefer the first one).
Attachments
Assign.JPG
ilovegamemaking
Just getting started
Just getting started
 
Posts: 92
Member since: 18.10.2011, 19:32
Location: germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby ilovegamemaking » 03.08.2012, 10:36

@BennzX
i'am sorry i dont know what you mean, i have tested it and the light follows the player exactly
key10.jpg
key11.jpg
BennzX
Just getting started
Just getting started
 
Posts: 87
Member since: 09.06.2012, 01:21
Location: Germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby BennzX » 03.08.2012, 13:16

I meant the way bevor you created you'r "not so fps-dropping way" :P

As I've started to create an horrorgame I had some issues while proning trough a little tunnel. Light has always stayed at the upper screen egde. If someone has the same issues - just take the camera's position, from vec3, and take the z-variable from camera's position instead of the math-add +0.8. Much more better.
ilovegamemaking
Just getting started
Just getting started
 
Posts: 92
Member since: 18.10.2011, 19:32
Location: germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby ilovegamemaking » 03.08.2012, 13:20

ok ;)
good luck with your horrorgame :))
BennzX
Just getting started
Just getting started
 
Posts: 87
Member since: 09.06.2012, 01:21
Location: Germany
Likes: 0

Re: [Free SDK] How to make a 'flashlight'

Postby BennzX » 03.08.2012, 14:07

Thank you ;)

Tested out your version of the flashlight - it's simple, fast to create and without any issues ;)
Only thing is, I think first version was a bit smoother.


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community