Product Chat / Questions about the flashlight

Author
Message
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 10:17
I do not know if this fits here, but ...

I have a few small questions. I am currently working on a simple solution for flashlight lighting. I have created a simple torch-decal as a weapon and now looking for a way to activate this with the F-key. Perhaps best would be a total solution for the lighting control (F-key). Is there a way to use this animated decal as wallpaper? And is it also possible to animate the light cone image so that you can imitate the flickering? If so, you can use it for any kind of lighting, and also carry and use a one-handed weapon. I also know that decals are outdated, but would not that be useful as an interim solution?
I sincerely hope that I have expressed myself understandably and I am grateful for any constructive response.



EXAMPLE DOWNLOAD
PM
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 19th Oct 2019 10:57
This may give some clues
Have you mid about using particles rather than decals?
I remember someone working on that, but can remember where.
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 19th Oct 2019 11:05 Edited at: 19th Oct 2019 11:06
The weapon system is not the way to go because it doesn't allow enough control. Instead, you will need to write a script that parents a torch entity to the player at all times, but only draws the torch when the player presses F. In terms of lighting, the flashlight is not the way to go either, because the light from a torch would not project as a beam, but would spread out in every direction. Instead, you need to create a dynamic light that follows the player at all times but is only triggered if the player presses F (and has already picked up the torch).

I was working on something very similar earlier this year. This is as far as I got:

This version used several different scripts to control everything and was a bit messy. AmenMoses then very helpfully stepped in and rewrote most of the scripts into one control script that also fixed a decal issue I was having. We both moved on to other projects but this is as far as he got:





Hope this helps! I'm sure Amen can explain better how the system works

AE
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 11:34
Ich danke euch beiden für die sehr interessanten Antworten.
Was habe ich verpasst, diese Beiträge habe ich nicht gefunden.

@3com Ich werde es ausprobieren, da es ein relativ einfacher Weg ist dies zu realisieren. Natürlich würde ich lieber partikel nehmen, aber es ist nicht alles für mich nachvollziehbar. Ein zusätzliches Problem ist, dass ich keinerlei Englischkenntnisse habe und somit auf google & co angewiesen bin. Ich bin immer bestrebt, etwas einfach zu gestalten, damit es jeder(auch ich) ohne viel Wissen benutzen kann.

@Avenging Eagle Das ist natürlich eine elegante Lösung. Ich habe auch schon versucht, ein dynamisches Licht mit mir rumzutragen, aber ich bin da kläglich gescheitert. Mir ist auch klar, dass das Waffenscript nicht die Lösung ist, aber ich weiss es eben nicht besser. Falls diese Lösung mal veröffentlicht wird, würde ich mich schon daran versuchen. Spannend könnte auch sein, dass man die Fackel mit der linken Hand trägt, um so noch eine Waffe benutzen kann. Aber das wäre vielleicht schon zuviel des Guten.

Andreas
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Oct 2019 11:37
"I sincerely hope that I have expressed myself understandably"

Well you started off ok.
Been there, done that, got all the T-Shirts!
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 11:42
That was not me, that was aunt google.
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 15:07
Ooh ... Just noticed, that's the way it can happen. I exchanged the text.
Sorry.

Thank you both for the very interesting answers.
What did I miss, I did not find these posts.

@ 3com I'll give it a try as it's a relatively easy way to do it. Of course, I would rather take particles, but not everything is understandable for me. An additional problem is that I have no knowledge of English and therefore rely on google & co. I always strive to make something simple so everyone (including me) can use it without much knowledge.

@Avenging Eagle This is of course an elegant solution. I also tried to carry a dynamic light with me, but I failed miserably. I also realize that the weapon script is not the solution, but I just do not know it better. If this solution is published, I would try it already. It could also be exciting that you can carry the torch with your left hand so that you can still use a weapon. But that would perhaps be too much of a good thing.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 19th Oct 2019 15:38
Well I assume you could simply flip the model to it's mirror image to make it left handed.

If AE has no objection I can post the last script we were working on but you would have to alter it to suit your needs, as the torch is carried close to the player you also need very good quality particle sheets like the ones AE made.
Been there, done that, got all the T-Shirts!
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 16:00

I would be very happy about it, but if AE does not want that, I can understand it too. For me it is interesting, because I will soon offer my medieval weapons, where a torch is included, for free download. I also work on a medieval dungeon with a tunnel system. Even there, such a highlight would fit quite well.
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 19th Oct 2019 16:12 Edited at: 19th Oct 2019 16:14
I'm working on a similar system too and for now iI trying to tuneup the flashlight system after i want to pass to torchfire and lantern..
I added all models into GG right now and myself asked to AE too LOL and him give me so useful tips but i hope Amen could give me some help in near future sicne i asked to him too and i'm waiting to have all my models in place before disturb him again..

https://www.youtube.com/watch?v=d-PnVGk_5x8&feature=youtu.be

PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 19th Oct 2019 22:24

You made some nice models and used them for weaponry. That was also my intention, until it came to my mind, maybe you can do it all over the control with the F-key. The torch and the fire in my video is a single Decal, the fire animation, I just created quickly. That would have to be better then. In this way you then have a hand free for possible weapons. The easier way would be yours, of course. I have already tried it out, but .. I can not get the bullet decals and also this little picture on the bottom left. I'm too stupid to do that. Would be nice for your solution, too, if I take the lamp or whatever the light should turn on and if I remove the lamp it would go out again. For that I just lack the necessary knowledge.
PM
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 20th Oct 2019 14:37
Quote: "If AE has no objection I can post the last script we were working on"


I have no objection. Come to think of it, I can't remember how far you got with it so I might download it again too!

If I thought it would help, I'd provide you with my spritesheet, but it's so specialised to my own torch model (and the particulars of my game) that I don't think it would be much help.

One of the reasons I didn't use the weapon system was that I wanted to assign a particle emitter to a limb of the torch. In order to do that, you need to know the entityID of the torch, and HUD weapon models don't have entityIDs. In essence, Amen and I had to build our own weapon system where the torch entity follows the player around and moves in parallel with them at all times.

Quote: "I also work on a medieval dungeon with a tunnel system."


Lafette II, I used your Mystical Dark Age pack for my levels a few months back - I love it! I made a few adjustments to the textures to make your assets work better in PBR, hope you don't mind. Please do create more, your work is always top quality

AE
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 20th Oct 2019 15:09
I think this is the latest one, the same script does all three models, the candle the torch and the lantern but if you can figure out how it works you can adapt it.

The name if the entity drives the functionality in the script.

The weapon_onlyone2.lua is an altered version of the standard one and is attached to the static model, when you collect the static model the ignitetorch3.lua script takes over (it should be attached to the carried entity and a dynamic light).

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 20th Oct 2019 16:06 Edited at: 20th Oct 2019 16:06
Hi...
Although I have not tried anything, but I'm already grateful for the quick help.
@ AE Which particle generator did you use? Unfortunately, I have no modern, so the decals always look so outdated. I once looked at the rigzsoft, but I do not know, the animations look rather outdated and with the trial version you can not save anything to check. But your fire looks really realistic. As far as the Mystic models are concerned, I did it before pbr and was too lazy to convert them. That's why I have a new pack at work now. But there again I have problems with the animations and collisions. If I get the thing with the light solved, I'll deal with it intensively again. As an encore, the weapon pack is planned.
@ AmenMoses Thanks for the quick feedback. I would already be 10 percent of your programming skills enough to gain a little more understanding of the processes. I used to do some basic, tp and Delphi during a retraining. That was nice, but after 15 years there was nothing left. I admire all those who sit down there and persistently seek a solution and then find it. Also thank you very much.
PM
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 20th Oct 2019 17:09
Quote: "But your fire looks really realistic"


That's because it is real! I made an actual torch from cotton bed sheets, string, and metal pole and then set it on fire and filmed it at 50fps in 4K resolution on my camera. I then used a combination of my editing software and Adobe After Effects to create loopable sections for use as spritesheets. Sadly this means my spritesheets are very tailored to the torch model I was using so probably would not line up for everyone.

I look forward to your new pack. I'm less interested in the traps, I just like the walls, corridors, floors, vaunted ceilings, columns, all that good stuff

AE
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 20th Oct 2019 17:22
Lol, I remember that, had a picture in my mind involving fire engines and sirens at the time.
Been there, done that, got all the T-Shirts!
PM
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 20th Oct 2019 17:34
Quote: "That's because it is real! I made an actual torch from cotton bed sheets.... *snip*. ... Sadly this means my bed sheets are now gone"

fixed that for you
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 20th Oct 2019 21:24 Edited at: 20th Oct 2019 21:26
Quote: "That's because it is real! I made an actual torch from cotton bed sheets, string"



WWWHaaaTTTTT??? you are crazy mate.... LOL

i never should ahve a similar idea... brilliant LOL

I had my motivations if i named you in my top GG users,,, LOL

@ lafette.. btw even your using "simple " decals looks really good i hope i can achieve similar results on my next tests
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 20th Oct 2019 23:28
@ AE Now I'm disappointed. Bed burned down due to 64 frames or so. Seriously, that's a brilliant idea. Some time ago I also had such a train of thought with water things. I wanted to create beach waves. However, I wanted to win those from a video. But I quickly rejected that. I found a good-looking animation with 36 pictures in the net, but it does not look like a torch. How many frames does your animation have? To the pack ... Soon I'll let a video of the vault pack grow over.

@ JC LEON I beg you, with my Decal I can not really win a flowerpot. I mean, I have not even used a model yet. That's just a sprite.

Nevertheless, the thought does not leave me now to win a fire in this way. The idea is really spicy ... Mmh ... Maybe I could mushroom a nuclear .....
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 21st Oct 2019 06:23
JC LEON, if you want, I put together 4 sprite-sheets with 2 different torch flames in 2 qualities. If you want to take it? ...



Attachments

Login to view attachments
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 21st Oct 2019 08:17
I guessed it again. I fumble around for a while, without success, I'm probably too stupid to distribute the scripts. Could someone ever send me a complete sample object? I already understood that with the pictures, with the torch, which should be taken, too. But how is it with the light and the carried object? Is that a weapon or something? I would be grateful for any help
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 21st Oct 2019 08:21
thanks very appreciated... now i try to learn how to use them ..eehhehe
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 21st Oct 2019 08:32
Do you mean the sprites? Since you make a decal of it with decal_animate8.fx

Attachments

Login to view attachments
PM
Avenging Eagle
18
Years of Service
User Offline
Joined: 2nd Oct 2005
Location: UK
Posted: 21st Oct 2019 19:15
Quote: "How many frames does your animation have? "


Fortunately the torch burned for several minutes so I had lots of footage to choose from. I only used 115 frames for the main loop. In my game, the torch has to gradually burn out and extinguish, so I was also looking for other parts with less flame I could use for that.

Quote: "Some time ago I also had such a train of thought with water things. I wanted to create beach waves. However, I wanted to win those from a video. But I quickly rejected that."


Water is very hard because you need to light it very carefully from behind so it shows up on a black background. At least fire stands out from black. For waves, it is much more difficult. Theoretically, if you had a drone, you could hover it over a beach and film directly downwards, capturing the white froth of the waves. Then you'd chromakey out the blue of the sea to leave behind the waves. You'd probably struggle to key out the beach as well because it would be a light colour, so you'd need to shoot this footage in Iceland or the Canary Islands where you've got black volcanic sand that might be easier to get rid of. Sounds like a lot of work! In this instance, faking it digitally would be much easier.

AE
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Oct 2019 19:35
@Lafette II: You won't be able to simply use the scripts as they are, you will need to study them to see how they work, especially the parts about naming the entities, and adapt them to fit with your own entities/images.

Been there, done that, got all the T-Shirts!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 25th Oct 2019 22:39
Here it is.

Attach script to the torch.
Put the png file in effectbank/particles.
Put the .fx file in effectbank/reloaded.

Let me know if I've forgotten anything.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 26th Oct 2019 19:10


So with this script:
1) E to pick up torch, this disables the standard flashlight.
2) F to hide/show torch.
3) Shift + E to drop torch, this re-enables the standard flashlight.

The 'swapping' one torch for another is a bit flakey, I'll try to track down why that is and I really need to simplify the script a bit because it is getting a bit messy.

What the script will also require is detection of 'two handed' weapons selection or 'left handed' weapons selection (are there any?) and act appropriately, i.e. in the first case hide the torch and in the second probably switch hands.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
JC LEON
14
Years of Service
User Offline
Joined: 22nd Apr 2010
Location:
Posted: 26th Oct 2019 19:28 Edited at: 26th Oct 2019 19:32
supercool amen.. do yit think we can make this system firetorch to turn off over time and to can be ignited with something else..( a campfire, a lighter, ect)??

and if player ids using a two hand weapon?? the weapon will be unequipped?
PC 2 Specs:
AMD RYZEN 2600 SIX CORE @3,70, 64GB RAM DDR4 2400, M/B GIGABYTE AX370
SVGA NVDIA 1660GTX 6GB , SSD M.2 TRANSCEND S110 1TB, 1X HDD SEAGATE BARRACUDA 4TB, 1X HDD TOSHIBA 2TB


PC 2 Specs:
AMD QUADCORE 880K @4.5GHZ, 32GB RAM DDR3 1600, M/B ASUS A88XM-PLUS
SVGA RADEON R9 380 4GB , SSD KINGSTON A400 1TB, 2X HHD SEAGATE BARRACUDA 4TB
PM
Lafette II
11
Years of Service
User Offline
Joined: 15th Oct 2012
Location:
Posted: 27th Oct 2019 06:45

Thank you very much for solving my problem. With the additional features I have more than I could expect. Thanks again to Avenging Eagle for providing his fire animation.

Andreas
PM

Login to post a reply

Server time is: 2024-04-25 01:38:25
Your offset time is: 2024-04-25 01:38:25