• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Flashlight v1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
I made this simple flashlight system after sitting outside in the dark at night (02:00), and wondering if it was actually made like this before.
It probably is, but the lack of anything better to do, made me have a go at my old rusty GUI skills.


-- Info --
This spell will simply apply a flashlight-like cone visibility effect to a unit with the "Flashlight" spell.
The spell should work fine with any number of players and units (The spell should be MUI, although i haven't actually tested it.)


-- Importing --
You need to import these variables into your map:
flashlight_length
flashlight_size
flashlight_lightpoints
flashlight_blackmask
And if you don't already have some temporary variables, these as well:
temp_group
temp_loc

You also need the Flashlight spell and buff (if you don't want to make a system for it yourself.)

And of course the triggers:
Flashlight Globals (Not directly needed)
Flashlight Loop


-- Known bugs --
Setting the variable "flashlight_blackmask to True, will break standard Warcraft 3 visibility behaviour (A units standard visibility radius.)



You might not know me (you don't), but i have lurked the hive ever since i learned English and finally decided to make something. (Please be gentle :3)

Keywords:
Flashlight, Simple, GUI, MUI, Dark
Contents

Flashlight Test v1 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 12:42, 6th Feb 2014 BPower: Interesting concept, but you currently leak player groups. PickedUnit, facing, basically everything used more than once/twice should be stored into a...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

12:42, 6th Feb 2014
BPower:
Interesting concept, but you currently leak player groups.
  • PickedUnit, facing, basically everything used more than once/twice should be stored into a variable.
  • Instead of Integer A you should use a custom integer variable
  • You could add/remove units to the flashlight group manually instead of picking all units in the map every 0.01 seconds.
  • Dynamic indexing would be a suitable alternative for the ForGroup operation you are using.
 
Flashlight v1 by Xderial
Using 0.03 bugged a bit for me, because you immediatly destroy the visibility again, but you at least could use 0.02 instead of 0.01.

Creating UnitGroups is a very heavy operation as you should use it each 0.01 seconds. My FPS were horrible with it, and much better with 0.02.

At the moment you are picking really every unit on map and check condition. That seeems too costly for me.

Even better you would use a unit indexer instead of Unitgroups, that is much better, especially you are using each 0.01 seconds as event atm.

Avoid using an array if you don't need it. I see you are using a point variable like this.

Don't use LoopIntegerA/B. They are less efficient as custom integers.

 
Top