Flashlight (v1.0.2)

Author Topic: Flashlight (v1.0.2)  (Read 19127 times)

What would a good way of doing this be?
I just need a pistol with a flashlight mounted that can be activated by holding or toggling right click. That way you can shoot and use the pistol at the same time. This addon would work, because the one team could just hit L and still be able to use guns, but it affects both teams.

You can do this with Chrono's "SetLight" events. They allow you to control whether or not a player is allowed to use their light. Don't confuse it with his "changelight" event, though.
You can do that to one team and not the other?

I just need a pistol with a flashlight mounted that can be activated by holding or toggling right click. That way you can shoot and use the pistol at the same time.

Add me on Steam or through XMPP and I'll make a solution for you specifically for that pistol.

You can do that to one team and not the other?

Well, with what Port said it probably wouldn't work but all you'd need to do is event one team's spawns to restrict their lights being usable.

Sounds pretty cool! I'll have to try this

It's basically a better coded version of mine with more features that I was too lazy to include

Good job, Port, it looks amazing!

The thing I noticed when I tried this was the light had problems rendering past bricks that I had set as invisible, collideless, and raycastless. I don't think this happened when I tried Marble Man's flashlight
Not hitting a brick:

Hitting a Float Cube:

If there's some way to fix that, then this item would be perfect

The thing I noticed when I tried this was the light had problems rendering past bricks that I had set as invisible, collideless, and raycastless. I don't think this happened when I tried Marble Man's flashlight
Not hitting a brick:
[img]http://imageshack.com/scaled/medium/694/j1sv.jpg[/img]
Hitting a Float Cube:
[img]http://imageshack.com/scaled/medium/580/3r4l.jpg[/img]
If there's some way to fix that, then this item would be perfect

Oh yeah, it's because the raycast to figure out where you're looking searches for $TypeMasks::All, which includes non-raycasting bricks. I'll push out an update to make the search more specific in a bit.

Updated to version 1.0.1. Changes:

  • The raycast used to shine a light now masks a more limited set of types - this fixes the light being stopped by non-raycasting bricks.
« Last Edit: September 01, 2013, 12:30:47 PM by Port »


Good job for making this! I give to you get my  two thumb up!

Does this still break reloading guns and such?

Can I have a video demonstration of this?

Would be handy for a rp/survival thing if it didn't disallow gun reloading

Would be handy for a rp/survival thing if it didn't disallow gun reloading

It disallows gun reloading? What?

Whenever you try to reload, it just toggles the light