System TimedLightning

Flare

Stops copies me!
Reaction score
662
Ace still owe me a 20+ rep
He really should've said that you had to be the creator, kinda lame to be rewarded for someone else's work :p

But meh, this should be approved.
Not just yet ^_^ One more update that I know I should do, I'll probably get around to it when I get home (half-day because of Munster vs. All Blacks match FTW! :D)

EDIT: Updated, me thinks be just about complete, just had to do a little bit of tweaking
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
All of my lightning is comming out green, how do I prevent this? The link I'm using is:
JASS:
call TL_Unit("CLPB", t, u, 1, true, .5,.5)
 

Flare

Stops copies me!
Reaction score
662
Ye, I had that issue before when importing into other maps (which is extremely strange, considering there shouldn't be anything different between the demo map and the target map)

Gonna have another look into it now that you've reminded me of it :p

EDIT: Found the culprit - was setting the current blue value to the tint increment value... Seems to work just fine now, please let me know if it persists. I guess that's reason enough to not make 600-line code monstrosities :D
 

CPTMuscles

New Member
Reaction score
1
Very cool system. It's just what I needed.

I found a typo in the TLRingCallback function:

JASS:
set x1 = a.Cx + a.a1cos<i> * a.curdist
set y1 = a.Cy + a.a1sin<i> * a.curdist
set x2 = a.Cy + a.a2cos<i> * a.curdist
set y2 = a.Cy + a.a2sin<i> * a.curdist</i></i></i></i>


The third line should use a.Cx instead of y. Was causing funky circles when passing certain values in. Looks great after the fix.
 

Flare

Stops copies me!
Reaction score
662
Very cool system. It's just what I needed.
Thanks - it's nice to see that people are making use of this :)

I found a typo in the TLRingCallback function:
Thanks for pointing it out, and I've fixed it now. Really should've tested the Ring function properly, using same value for center X/Y wasn't really the best idea...
 

Frozenhelfir

set Gwypaas = Guhveepaws
Reaction score
56
[del]I have a unit that creates a lightning ring around it when created. I want it to disappear when it dies. I have a question of efficiency. There may be a lot of these units on the map as they can be easily massed although someone only needs a few of them to fulfill all of their uses. Would it be efficient to recycle the lightning periodically by recreating it every 2 seconds or so and if the unit dies, don't recreate it? Or would there be a better way to do this?[/del]

EDIT: Nevermind, I'm a retard...

JASS:
call TL_DestroyRing (index)
 

MasterOfRa

New Member
Reaction score
10
Excellent library, I've used it for several spells, and the fade over time is awesome. I suggest adding the possibility to make lightning the moves over time, as in you input the start xyz and end xyz points, and over the duration,
slide the start and end xyz points to the second xyz locations.
 

Flare

Stops copies me!
Reaction score
662
Excellent library, I've used it for several spells, and the fade over time is awesome. I suggest adding the possibility to make lightning the moves over time, as in you input the start xyz and end xyz points, and over the duration,
slide the start and end xyz points to the second xyz locations.
Thanks - if I get around to it and bother to open World Editor, that wouldn't be a bad addition, but it would make for a really long, drawn-out function (probably around 15 arguments :eek:). It'll be something to consider, but I don't really do much coding (or anything WC3-related) anymore :(

Although, strictly speaking, it's doable without having to update the system - it'd be inefficient (by comparison, although the system itself probably isn't as good as it could be), but you could do TL_Unit (or TL_Coord/Loc2Unit) and move the unit(s) around so that the lightning would follow. Granted it'd be a bit tedious, but it's the most immediate solution :p
 

elpini0

New Member
Reaction score
1
ho ho ho ho!!! :D

I DID IT!! :cool: I CREATED A DAMAGE AURA THAT GIVES BOUNTY!! Whatsmore, I added a TIMED LIGHTNING EFFECT using ONLY GUI!!:D look:

IF YOU DON'T CARE ABOUT MY OWN SUFFERING, JUMP TO THE BOTTOM OF THE POST

Spell created: Pain Aura
Objective: Create a permanent inmolation that in stead of making X damage every 1 second, makes 1 damage every (1/X) seconds.
Based on: Unholy Aura (at first i used negative life regen, but then i realized about the bounty issue)
Spell set-up:
-Set the increase of Life Regen and movement speed of the spell to zero.
-Set the affected units to YOURSELF

Now, you might be wondering why do i do this. The answer:

-At first I tried (after several failed attempts of modifying auras, triggers and buffs) applying the aura only to enemies. This way I could make a periodic event every (1/X) seconds that picks up every unit with the buff Pain Aura and deal 1 damage (trigger example)

Trigger:
  • PainAura
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • Unit group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • If ((Picked unit) has buff Pain Aura ) Equal to True
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
            • Else - Actions


Then I realized that GUI triggers didn't offer me the possibility of identifying who the owner of the aura is. :banghead: So after testing different combinations of triggers and breaking my ass out thinking of alternatives, I thought of simply not getting bounty. :nuts:

Then, another idea cam to my mind: :D Creating a dummy that exploded using the gobling ability. But ERROR: :banghead: I came up with the same problem... There is no condition "((Adquired ability) is Pain Aura) Equal to True" or anything like that. :(

Finally, in my way through the huge corridors of GUI menus, bars and options, i came up with this::thup:

Trigger:
  • Unit group - Pick every unit in (Units within 512.00 of (Position of PainAuraCaster)) and do (Actions)


HAHA BINGO!!:cool: But how can we know who the caster of an aura that only affects to enemies is??:confused: Answer: we can't.:thdown:

:eek:IDEA!!:eek: Why not making my own heroe as target of the aura, then picking all units in map with the aura and making an effect??

The result: My trigger :D

Trigger:
  • Pain Aura
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • -------- First, check which units in map have the aura --------
      • Unit group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Condiciones
              • If ) ((Picked unit) has buff Pain Aura ) Igual a True
            • Then - Actions
              • -------- Then, for each caster we set him as a variable --------
              • Set PainAuraCaster = (Picked unit)
              • -------- Aftwerwards, we pick all units within desired Aura range --------
              • Unit Group - Pick every unit in (Units within 900.00 of (Position of PainAuraCaster)) and do (Actions)
                • Loop - Actions
                  • -------- And now, our Aura effect, only affecting enemies --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Condiciones
                      • If ) ((Picked unit) is alive) Igual a True
                      • If ) ((Picked unit) belongs to an enemy of (Owner of PainAuraCaster)) Igual a True
                    • Then - Acciones
                      • -------- Using this great unit action, we grant that our hero gets his bounty --------
                      • Unit - Cause PainAuraCaster to damage (Picked unit), dealing (1.00 x (Real((Level of Pain Aura for PainAuraCaster)))) damage of attack type Spells and damage type &lt;desired type&gt;
                    • Else - Actions
            • Else - Actions


Whatsmore, once i managed to get my spell I decided to create a coooool effect, and i thought of lightning. But wow... :banghead: Problems everywhere...

First I tried with this:

Trigger:
  • Pain Aura
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • -------- First, check which units in map have the aura --------
      • Unit group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Condiciones
              • If ) ((Picked unit) has buff Pain Aura ) Igual a True
            • Then - Actions
              • -------- Then, for each caster we set him as a variable --------
              • Set PainAuraCaster = (Picked unit)
              • -------- Aftwerwards, we pick all units within desired Aura range --------
              • Unit Group - Pick every unit in (Units within 900.00 of (Position of PainAuraCaster)) and do (Actions)
                • Loop - Actions
                  • -------- And now, our Aura effect, only affecting enemies --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Condiciones
                      • If ) ((Picked unit) is alive) Igual a True
                      • If ) ((Picked unit) belongs to an enemy of (Owner of PainAuraCaster)) Igual a True
                    • Then - Acciones
                      • -------- Using this great unit action, we grant that our hero gets his bounty --------
                      • Unit - Cause PainAuraCaster to damage (Picked unit), dealing (1.00 x (Real((Level of Pain Aura for PainAuraCaster)))) damage of attack type Spells and damage type &lt;desired type&gt;
                      • Lightning - Create a Lightning Chain - Main lightning effect from source (Position of PainAuraCaster) to target (Position of (Picked unit))
                      • Wait 0.06 seconds
                      • Lightning - Destroy (Last created lightning effect)
                    • Else - Actions
            • Else - Actions


When I tested this, guess what happened:

Lightnings didn't get removed. This is because while waiting 0.06 seconds, Last created lightning changes for more that 1 target.

Final trigger:

IF YOU DON'T CARE ABOUT MY OWN SUFFERING, START READING HERE

(At the Initialization trigger, do (Create Hashtable) -> (Set hastTable= (Last created Hashtable))
(Starting value of LightningNumber = 0)

Trigger:
  • Pain Aura
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • -------- First, check which units in map have the aura --------
      • Unit group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Condiciones
              • If ) ((Picked unit) has buff Pain Aura ) Igual a True
            • Then - Actions
              • -------- Then, for each caster we set him as a variable --------
              • Set PainAuraCaster = (Picked unit)
              • -------- Aftwerwards, we pick all units within desired Aura range --------
              • Unit Group - Pick every unit in (Units within 900.00 of (Position of PainAuraCaster)) and do (Actions)
                • Loop - Actions
                  • -------- And now, our Aura effect, only affecting enemies --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Condiciones
                      • If ) ((Picked unit) is alive) Igual a True
                      • If ) ((Picked unit) belongs to an enemy of (Owner of PainAuraCaster)) Igual a True
                    • Then - Acciones
                      • -------- Using this great unit action, we grant that our hero gets his bounty --------
                      • Unit - Cause PainAuraCaster to damage (Picked unit), dealing (1.00 x (Real((Level of Pain Aura for PainAuraCaster)))) damage of attack type Spells and damage type &lt;desired type&gt;
                      • Lightning - Create a Lightning Chain - Main lightning effect from source (Position of PainAuraCaster) to target (Position of (Picked unit))
                      • Hashtable - Save Handle Of(Last created lightning effect) as 0 of LightningNumber in hashTable
                    • Else - Actions
                      • Set LightningNumber = (LightningNumber + 1)
                      • Trigger - Run Wait4 &lt;gen&gt; (checking conditions)
            • Else - Actions


Trigger:
  • Wait4
    • Events
    • Conditions
    • Actions
      • Wait 0.05 seconds
      • Trigger - Run LightningLoop &lt;gen&gt; (checking conditions)


Trigger:
  • LightningLoop
    • Events
    • Conditions
    • Actions
      • Set LightningNumber = (LightningNumber - 1)
      • Lightning - Destroy (Load 0 of LightningNumber in hashTable)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LightningNumber Greater that 0
        • Then - Actions
          • Trigger - Run (This trigger) (checking conditions)
        • Else - Actions


How does this trigger work? Its quite simple:

Every 0.06 seconds happens this:
-1) For X units within range, you create X lightnings
-2) In order, you set a space in the hashTable containing each lightning ID

EXAMPLE OF HASHTABLE

..............................|...First lightning......|. Second lightning ..| ... | N lightning
AS(down) \\ OF(right) |..... created .........|...... created .........| ... | created
...............0..............| LightningNumber=0| LightningNumber=1 | ... | LightningNumber=N-1

This way, we now have N values in the positions 0 to N-1 of our hashTable.
-3) Our final result of LightningNumber was N, and we want to destroy the last lightning which has index N-1 in our hashTable. Thats why we make the inverse operation
-4) We loop the trigger to run N times, and finally set LightningNumber = 0.

DONE!! The result is very nice, and it doesn't require any JASS knowledge: only TIME and EFFORT.

I hope this information was interesting and useful for some people :cool:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top