Need help with Flamestrike type of spell

Roseblood

New Member
Reaction score
1
So, basically I have triggered a spell, that damages enemies for 5*hero intelligence every second for 3 seconds. But for some reason, the damage only applies to the first second. So instead of doing hero int*5*3 It only damages hero int*5*1. Any ideas how to fix this??

I triggered it to pick every unith within 200 range of the position of ability being cast, then just looped
- Actions (loop)
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
thx in advance
 

Kling[o]

New Member
Reaction score
7
So, basically I have triggered a spell, that damages enemies for 5*hero intelligence every second for 3 seconds. But for some reason, the damage only applies to the first second. So instead of doing hero int*5*3 It only damages hero int*5*1. Any ideas how to fix this??

I triggered it to pick every unith within 200 range of the position of ability being cast, then just looped
- Actions (loop)
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
- Cause casting unit to damage picked unit etc.
- Wait 1.00 seconds
thx in advance

first , never use wait , find a better way to do them. Altough you could make a new trigger which would be periodic for every 1 seconds then you do the damage.
 

Moridin

Snow Leopard
Reaction score
144
Waits don't work correctly in unit group picking loops.

What you need to do is, add the affected units to a unit group variable called "Affected". Then have a periodic trigger running every 1 second. The periodic trigger picks all the units in affected and deals damage.

You will also need an integer variable to act as an index. This will allow you to count the number of times the damage is effected before removing the unit from the unit group.
 

Roseblood

New Member
Reaction score
1
Heres the big problem, I have NO idea how integers work. I have tried to google, but for some reason I haven't come across any tutorials that would make sense to me. If you know one, I would appreciate a link there.
 

Moridin

Snow Leopard
Reaction score
144
Integers are essentially any number value that doesn't have a decimal place. (ex: -1, -13421, 232, 0)

Real numbers are any number including decimal numbers. (ex: 1.32324)

Note that this is only for the WC3 world editor. In normal math, they're quite different :p.

Variables are essentially storage spaces that can be used to store certain types of data. An integer variable stores data of the type integer (round numbers).

Here's how you can use it:
If you set an Integer variable to 3 and then deduct 1 every time the periodic is run, then it will cycle going from 3 to 0 and go into negative after 3 runs. Using a condition to check if the integer is greater or equal to 0 makes sure that the trigger will only run if less than 3 runs have passed already.
 

0WN3D

New Member
Reaction score
15
The way I do this kind of spell is use 3 triggers as it is easier to understand.
You will need 1 variable called CustomGroup to use this trigger.

Trigger init
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ur spell
    • Actions
    • Actions
      • Set CustomGroup = (Units within 600.00 of (Target point of ability being cast) matching (((Matching unit) is Magic Immune) Equal to False))
      • Trigger - Turn on (Trigger Damage)
      • Trigger - Turn on (Trigger Stop)


Trigger Damage
Trigger:
  • Events
    • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CustomGroup and do (Actions)
        • Loop - Actions
          • Unit - Cause (Picked unit) to damage (Picked unit), dealing ((Real((Intelligence of (Picked unit) (Include bonuses)))) x 5.00) damage of attack type Spells and damage type Normal


Trigger Stop
Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn off (Trigger Damage)
    • Trigger - Turn off (Trigger Stop)





Hope it helps.:D
 

Roseblood

New Member
Reaction score
1
the trigger works ALMOST perfectly, apparently the elapsed game time trigger does not work, it just keeps on damaging the picked units untill they die, which is in a way pretty cool. Another problem I noticed, is that the spell has 4 second casting time(the sigil that comes from the flamestrike hangs there for 4 seconds until flames start to burst out), but still the damage comes instantly...how could I fix this and if I need to make a timer with the variables, how do they work?

Edit: nvm about the times it hits. Did what Moridin told. Set a real variable with 3 and deducted it every second by 1 untill it was 0, then just set it back to 3 again. Should I put the skill here so you people could take a look and let me know how bad is it??
 

Roseblood

New Member
Reaction score
1
So, I have no idea how to put them all cool n stuff, so I just type em here, hope this makes some sense to you guys :D
----------------------------------------
Disintegrate
-Events
- Unit starts the effect of an ability
-Conditions
- (Ability being cast) Equal ti Disintegrate
-Actions
- Set Disintegratecaster = (casting unit)
- Set Disintegratepoint = (Target point of ability being cast)
- Trigger - Turn on Disintegrate damage <gen>
- Trigger - Turn on Disintegrate time <gen>
------------------------------------
So as you can see, I took the point of ability(AoE spell, thats why the point)
-----------------------------------
Disintegrate damage
-Events
-Time - Every 1.00 seconds of game time
-Conditions
-Actions
-Set Disintegratetargets = (Units within 300.00 of Disintegratepoint matching (((Matching unit) is Magic Immune) Equal to False))
- Unit Group - Pick every unit in Disintegratetargets and do (Unit - Cause Disintegratecaster to damage (Picked unit). dealing (real(((Integer((Real((Intelligence of Disintegratecaster (Include bonuses)))))) x 3))) Damage of attack type Spells and damage type Normal
- Set Disintegratetime = (Disintegratetime - 1.00)
- Set Disintegratetargets = (Random 0 units from (Units in (Playable map area)))
---------------------------------------
Disintegrate time
-Events
-Game - Disintegratetime becomes Equal to 0.00
-Conditions
-Actions
- Set Disintegratecaster = No unit
- Set disintegratetargets = (Random 0 units from (Units in (Playable map area)))
- Set Disintegratetime = 3.00
Trigger - Turn off Disintegrate damage <gen>
Trigger - Turn off Disintegrate time <gen>
--------------------------------------------
Dmn thats a LOT of text. Hope you can make something out from it

thx in advance :D
 

Kling[o]

New Member
Reaction score
7
You typed it? you don't like the life ^^.
for the last trigger you could simply use a condition (if/then/else) that check when it equal to 0.

Trigger:
  • Set Disintegratecaster = No unit


you don't need to do that.
-----------------------------------------------------
Trigger:
  • Set disintegratetargets = (Random 0 units from (Units in (Playable map area)))


what is the point of that?
-----------------------------

When i was writing i saw the problem , you need to see the disintegratetime to the time you want , cause whit your trigger , the time is = 0....

edit : fix your leak . http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=27242
 

Moridin

Snow Leopard
Reaction score
144
For your question, you would need to base your ability off something other than flamestrike (Flamestrike unfortunately has those channeling limitations). You can use the ability channel with a different base order id to get a fully customised spell.

How to use the ability channel

----

As for how to post your triggers here easily. Do the following steps:
1) goto your trigger
2) Right click the name of the trigger, shown above "Events"
3) Select "Copy as Text"
4) Open your forum page.
5) In your post type [noparse]
Trigger:
  • &lt;Paste your copied trigger here&gt;
[/noparse]
6) And you have your trigger! :D
 

Roseblood

New Member
Reaction score
1
If I don't "nullify" the targets and the caster, don't they stay in the memory? Or does the variable automatically clear the last unit group it had when it fires off again? After all, this spell shoots out 3 times in 3 seconds and in that time the units might have moved from the 300.00 range. I'm confused O__o, thought it had something to do with the leaks everyone talks so much about :D.

And I have the disintegratetime as 3.00 every time the trigger fires off, the trigger just removes its value by 1 until it goes to 0.

And I actually found out how to make it with the flamestrike so that it doesn't fire off untill 4 seconds have passed. I just made another real trigger with the value of 4 and just remove 1 from it every second when hero starts casting it until value gets to 0. I'll show you, now that I know how to easily show you :D

Trigger:
  • Disintegrate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Disintegrate
    • Actions
      • Set Disintegratecaster = (Casting unit)
      • Set Disintegratepoint = (Target point of ability being cast)
      • Trigger - Turn on Disintegrate casting &lt;gen&gt;

Trigger:
  • Disintegrate casting
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Disintegratect = (Disintegratect - 1.00)

Trigger:
  • Disintegrate start damage
    • Events
      • Game - Disintegratect becomes Equal to 0.00
    • Conditions
    • Actions
      • Trigger - Turn on Disintegrate time &lt;gen&gt;
      • Trigger - Turn on Disintegrate damage &lt;gen&gt;
      • Set Disintegratect = 4.00
      • Trigger - Turn off Disintegrate casting &lt;gen&gt;

Thats the 4 second casting time I made xD I don't know how bad it is considering leaks, but it WORKS :D

Oh, and thanks a million for helping me with this trigger mates. I really appreciate it.

EDIT: Now I seriously need you guys to check this. I looked at the leak tutorial site and it has something like this:
Trigger:
  • Custom Script: call RemoveLocation(udg_Point)

Can I just copy that and rename the Point with my own point trigger name, does it work?? I have NO custom scripting experience, so I fear I **** up my map if I start messing with these. I made a trigger like this, should it work, both variables are point variables
Trigger:
  • Beetles lower
    • Events
      • Time - Every 16.11 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in beetle patrol &lt;gen&gt; matching ((Unit-type of (Matching unit)) Equal to Overgrown Beetle))) Less than 20
        • Then - Actions
          • Set monsterspawnpoint = (Random point in Lower beetles &lt;gen&gt;)
          • Unit - Create 1 Overgrown Beetle for Neutral Hostile at monsterspawnpoint facing Default building facing degrees
          • Set monsterpatrolpoint = (Random point in beetle patrol &lt;gen&gt;)
          • Unit - Order (Last created unit) to Patrol To monsterpatrolpoint
          • Custom script: call RemoveLocation(udg_monsterspawnpoint)
          • Custom script: call RemoveLocation(udg_monsterpatrolpoint)
          • Set monsterspawnpoint = (Random point in Lower beetles &lt;gen&gt;)
          • Unit - Create 1 Overgrown Beetle for Neutral Hostile at monsterspawnpoint facing Default building facing degrees
          • Set monsterpatrolpoint = (Random point in beetle patrol &lt;gen&gt;)
          • Unit - Order (Last created unit) to Patrol To monsterpatrolpoint
          • Custom script: call RemoveLocation(udg_monsterspawnpoint)
          • Custom script: call RemoveLocation(udg_monsterpatrolpoint)
        • Else - Actions
          • Do nothing
 

Moridin

Snow Leopard
Reaction score
144
If I don't "nullify" the targets and the caster, don't they stay in the memory? Or does the variable automatically clear the last unit group it had when it fires off again?
It remains as backlog. This is leaking btw. There are ways to clean up leaks in GUI.

Can I just copy that and rename the Point with my own point trigger name, does it work?? I have NO custom scripting experience, so I fear I **** up my map if I start messing with these. I made a trigger like this, should it work, both variables are point variables

For all point leaks (location leaks), you can just copy paste that line:
Trigger:
  • Custom Script: call RemoveLocation(udg_Point)


...and replace "Point" with the name of your variable EXACTLY. It is case sensitive. Also, do not remove the udg_ . That signifies that it's a global variable. All variables in GUI are global variables.

Edit: note that the entire custom script command must be exactly correct in terms of spacing and case. You cannot have Callremovelocation ( udg _ point).
 

hgkjfhfdsj

Active Member
Reaction score
55
>( udg _ point).
whitespace characters are ok :)
JASS:
(    udg_point        )//works
(    udg_     point  )//does not work
 

Kling[o]

New Member
Reaction score
7
Well you need clear leaks like this

Trigger:
  • call RemoveLocation(udg_VariableName)


This function remove locations (known as Point) so if you put a unit variable it won't work And it need to be Exactly the same thing cause it's Case sensitive. Plus , your location don't leak as long as you remove it before reset it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top