Why doesn't this work?

Kazuga

Let the game begin...
Reaction score
110
Hi there, I have got stuck while making this ability, it's a "beam" ability based on dummys making 5 shockwaves:
Code:
Beam of justice
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Beam of justice 
    Actions
        Set BeamCaster = (Triggering unit)
        Set BeamCasterPos = ((Position of BeamCaster) offset by 50.00 towards (Facing of BeamCaster) degrees)
        Floating Text - Create floating text that reads Kaaa... at BeamCasterPos with Z offset 0.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
        Unit - Create 1 Beam dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Set BeamDummy = (Last created unit)
        Unit - Add Beam of justice dummy  to BeamDummy
        Unit - Set level of Beam of justice dummy  for BeamDummy to (Level of Beam of justice  for BeamCaster)
        Set BeamDummyPos = ((Position of BeamDummy) offset by 50.00 towards (Facing of BeamCaster) degrees)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit - Create 1 Beam dummy for (Owner of BeamCaster) at BeamDummyPos facing Default building facing degrees
                Set BeamDummy = (Last created unit)
                Unit - Add Beam of justice dummy  to BeamDummy
                Unit - Set level of Beam of justice dummy  for BeamDummy to (Level of Beam of justice  for BeamCaster)
                Unit - Order BeamDummy to Orc Tauren Chieftain - Shockwave BeamDummyPos
                Floating Text - Create floating text that reads BOM! at BeamCasterPos with Z offset 0.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
                Wait 0.10 seconds
                Unit - Remove BeamDummy from the game
                Wait 0.30 seconds
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
Help anyone?
Oh and btw, the first dummy is created but he doesn't get removed and the others isn't created. Also they don't shoot the spell :banghead:.
 

Vassilev

New Member
Reaction score
39
Yup, I agree with Chocobo

0.10 seconds is too little

Here's a solution:

Dont use the trigger to remove the dummy while still in loop, instead, just give the dummy an expiration timer

Then make another trigger:

Event - A unit dies
Condition - Dying unit = beamdummy
Action - Remove Dying unit


So when you create the dummy, you give it a timed life, when it dies, it will be instantly removed from the game
 
T

Tubba

Guest
Don't use waits within loops.

Also, make sure Cast Backswing is set to 0 on the dummy, and that all mana costs, etc, are set to 0.
 

Kazuga

Let the game begin...
Reaction score
110
Don't use waits within loops.

Also, make sure Cast Backswing is set to 0 on the dummy, and that all mana costs, etc, are set to 0.

Backswing does what? Have allways wondered that :rolleyes:. Mana and such are set to 0 allready.
There's no need to remove it from game...

Tried with exparation timer, when the unit dies he get's ressd in base since he's a hero... So I do need to remove it from the game...
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
There can't be a reason why a dummy should be a hero rofl.

haha.. well.. it saves him frustration from finding out why the beamdummy makes a noise when it dies !

i use that trigger cuz im too lazy to fix all of the values for my dummy

No comment, because you're too lazy you use triggers to compensate stuff like that? Oh my godness. That makes no sense, really.

Here a part about dummies from Daelin's trigger enhancing spells tutorial.

Before we enter triggers themselves, I would like to point some things out, extremely necessary in order to be able to enchance your spells.

First of all, you have to know that an unit cannot have two abilities based on the same root ability. What does this mean? If for example a unit has two abilities, both copies of the Flame Strike ability, the unit might not cast the spell it has been ordered to. It may cast the other Flame Strike ability, if it is not under cooldown. Be careful! There are enough abilities to copy.

Secondly, you must learn the concepts of Dummy Units. Dummy units are special units (lol, not really) meant to help you enchance the spell with better effects. For now, you must know how to create your own dummy unit in the object editor. After that, you will learn how to use them as well.

So go to the unit editor and copy-paste the footman unit. Rename it as dummy, so that you will be able to recognize it later. And now, change the following fields accordingly:

Abilities – Normal – It should include only the Locust unit ability. This will make the dummy unselectable, invulnerable and will remove its collision, allowing any unit to pass through it. By this you assure the unit cannot be detected in any way.

Art – Model File – Switch to custom and type none.mdl. This will make the unit invisible (not as invisibility, but unseen).

Art – Shadow Image – Switch the value in preset to none.

Art – Special – Delete everything there.

Combat – Attacks enabled – Switch to none.

Combat – Death Type – Switch to Can’t Raise, Does not Decay

Movement – Speed Base – Set its value to 0.

Movement – Type – Switch to Fly.

Sound – Unit Sound Set – Change its value to NONE.

Stats – Can Flee – False.

Stats – Food Cost – Set it to 0.

Stats – Hide Minimap Display – True

Stats – Sight Radius (Day) – 0
Stats – Sight Radius (Night) – 0

Techtree – Upgrades Used – Delete all.

After you have given the unit all these values you can place one on the map and notice that ingame you won’t see it. In World Editor it will appear as a box with green/black squares. That’s because the model you assigned to the unit doesn’t exist. It will disappear ingame.

Another concept we need to study is Dummy abilities. You will give these abilities to the hero and they will practically have no effect, until we enchance them with triggers. What they will have is the mana cost, cooldown, description, eventually requirements, buffs and icons (and obviously name). Practically they should act like a normal hero ability, if you learn for example the ability should be there, with its mana cost and cooldown (when the hero casts it), the description when you put the mouse on the icon and of course it should be AoE if your enchanced spells is supposed to be AoE, or single target if your enchanced spell is supposed to be single target and so on. And this leads us to a second problem: on which spell to base your dummy ability?

Let’s say that you want to do an Area of Effect Sleep (affects all the units in a selectable area). Some of you who have absolutely no experience in spellmaking might say that you must base your dummy spell off Sleep. Wrong! The dummy spell as I mentioned before must mimic the final result spell with no effect (so in this case targets the units in an AoE but doesn’t put them to sleep when cast). However, sleep is a single target spell, not an AoE (like Silence, Blizzard, Cluster Rockets, Flame Strike and other Area of effect spells). You should base your spell off one of the example spells I gave above.

Note
The duration of the dummy spells should be set to 0.01 if it is initially greater than 0. If for these spells you set the duration to 0, it will last forever (or for some until dispelled). And this might lead to other problems. If you want to make a dummy spell which targets a single unit and only damages it (pure example), if you base it off storm bolt, it will do a 0.01 stun, breaking channeling spells. Same thing will happen with silence if you don’t remove the spell disabling effect. Be very careful!
 

Kazuga

Let the game begin...
Reaction score
110
Well, now it works with creating and removing dummys, also make them use the ability. The problem now is that they shoot sort of randomly, and also of some reason it doesn't work if this part isn't within the trigger:

Code:
Beam of justice
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Beam of justice 
    Actions
        Set BeamCaster = (Triggering unit)
        Set BeamCasterPos = ((Position of BeamCaster) offset by 50.00 towards (Facing of BeamCaster) degrees)
        Unit - Pause BeamCaster
        Floating Text - Create floating text that reads Kaaa... at BeamCasterPos with Z offset 0.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
        [B][U]Unit - Create 1 Beam dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Add a 2.00 second Force Of Nature expiration timer to (Last created unit)
        Unit - Turn collision for (Last created unit) Off
        Set BeamDummy = (Last created unit)
        Unit - Add Beam of justice dummy  to BeamDummy
        Unit - Set level of Beam of justice dummy  for BeamDummy to (Level of Beam of justice  for BeamCaster)[/U][/B]
        Set BeamDummyPos = ((Position of BeamDummy) offset by 50.00 towards (Facing of BeamCaster) degrees)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                Unit - Create 1 Beam dummy for (Owner of BeamCaster) at BeamDummyPos facing Default building facing degrees
                Unit - Add a 2.00 second Force Of Nature expiration timer to (Last created unit)
                Unit - Turn collision for (Last created unit) Off
                Set BeamDummy = (Last created unit)
                Unit - Add Beam of justice dummy  to BeamDummy
                Unit - Set level of Beam of justice dummy  for BeamDummy to (Level of Beam of justice  for BeamCaster)
                Unit - Order BeamDummy to Orc Tauren Chieftain - Shockwave BeamDummyPos
                Floating Text - Create floating text that reads BOM! at (Position of BeamCaster) with Z offset 0.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Floating Text - Change (Last created floating text): Disable permanence
                Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
                Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
                Wait 0.10 seconds
        Unit - Unpause BeamCaster
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
Also, is there a risk for lagg on battlenet when using this since you create units so fast after eachother and order them to use the ability? If so, is there any easier way to make a "beam" like ability...? Have seen them in dragonball and such games and they look awsome but I just can't figure how they do it...
 

Flare

Stops copies me!
Reaction score
662
If so, is there any easier way to make a "beam" like ability...? Have seen them in dragonball and such games and they look awsome but I just can't figure how they do it..

It's a dummy unit with model file like holy light or hero revival, and the maximum pitch (or roll, not sure) angle is set to a negative value (hold shift when opening the field in object editor to make it negative)
 

Kazuga

Let the game begin...
Reaction score
110
Hm, solved it in a new way, by creating dummy units with the model file "avatar of vengance" in a line with permanent immolation. Problem is it looks awfull in trigger and I know you can do this with "For each integer A do" but I have no idea how to make it that way, any way here is new trigger:
Code:
Beam of justice
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Beam of justice 
    Actions
        Set BeamCaster = (Triggering unit)
        Set BeamCasterPos = (Position of BeamCaster)
        Unit - Pause BeamCaster
        Floating Text - Create floating text that reads Charging energy... at BeamCasterPos with Z offset 0.00, using font size 12.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
        Floating Text - Change the fading age of (Last created floating text) to 4.00 seconds
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 1.50 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 100.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 200.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 300.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 400.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 500.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 600.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        -------- ----------- --------
        Set BeamCasterPos = ((Position of BeamCaster) offset by 700.00 towards (Facing of BeamCaster) degrees)
        Unit - Create 1 Beam of justice dummy for (Owner of BeamCaster) at BeamCasterPos facing Default building facing degrees
        Unit - Set level of Beam of justice (dummy)  for (Last created unit) to (Level of Beam of justice  for BeamCaster)
        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
        Custom script:   call RemoveLocation (udg_BeamCasterPos)
        Wait 0.03 seconds
        Unit - Unpause BeamCaster
Also it doesn't look so cool when they are created, it's like the beam laggs it's way forward (just looks like it, it does not lagg :p).
 

Flare

Stops copies me!
Reaction score
662
you cant wait 0.03 seconds, any wait action below 0.27 seconds will automatically wait 0.27, regardless of what you want it to do.

if you want a 'proper' beam like the DBZ maps, just edit the Maximum Pitch Angle (or Roll Angle, more than likely pitch though) to a negative value, and the 'head' of the dummy will project outwards, then boost the dummy's anim speed a bit so that the beam appears quickly ^^
 

Kazuga

Let the game begin...
Reaction score
110
>you cant wait 0.03 seconds, any wait action below 0.27 seconds will automatically wait 0.27, regardless of what you want it to do.
So that's why it was so big wait time between the creations...

>if you want a 'proper' beam like the DBZ maps, just edit the Maximum Pitch Angle (or Roll Angle, more than likely pitch though) to a negative value, and the 'head' of the dummy will project outwards, then boost the dummy's anim speed a bit so that the beam appears quickly ^^
Huh...? Sorry but that's like jass to me:p (don't undestand a word^^).
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
Ok, this is what I think Flare means:
If you adjust the Maximum Pitch Angle to a negative value, the dummy's head will look longer, along the Z axis. Then, if you increase its animation speed, it will appear quickly; and it will look like a real beam.
EDIT: Flare beat me to it :p
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
If you can't double-click it and hold down shift at the same time, just click on the field once, then press shift and enter.
 

Kazuga

Let the game begin...
Reaction score
110
Hm, got it to a negative value when holding down shift and doubleclicking, but nothing hapend to the footmen head...
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      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