Spell Fortitude

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
This is the first spell I have made in vjass after reading romek's tutorial and darth's and some other, so, I should use a timer for the polled wait?

Either a timer with a callback function, a TriggerSleepAction, or a custom polled wait function which does not leak.
 

wraithseeker

Tired.
Reaction score
122
Sorry for the dumb question, I know how to do triggersleepaction but how do you do a timer with a callback function, requires a attachment system right? I want to make things simple:p.

EDIT: New verison now 1.1.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Sorry for the dumb question, I know how to do triggersleepaction but how do you do a timer with a callback function, requires a attachment system right? I want to make things simple:p.

EDIT: New verison now 1.1.

Yes it does, if you want to pass local variables over to the callback function.

If you're just curious on how to start another function with a timer, take a look at the TimerStart function:

JASS:
function TimerStart(timer Timer, real Time, boolean isPeriodic, code FunctionToRun)

//and you call it like this:

function myfunction takes nothing returns nothing
    local timer t = GetExpiredTimer()
endfunction

call TimerStart(t,0.5,true,function myfunction)


Usually, you only need a timer for really accurate, and/or short intervals. If you're not concerned about accuracy, and don't need to wait a short interval (anything less than 0.1 should use a timer), then just use TriggerSleepAction.
 

wraithseeker

Tired.
Reaction score
122
No I mean I'll need a attachment system to pass over attacking unit and TriggerUnit don't I? I remembered me asking some time ago..

When will this be approved? Anymore things to fix?
 

Viikuna

No Marlo no game.
Reaction score
265
Using one dummy was actually my idea. :)

And yes, there is no point of adding/removing spell, unless you need your dummy to be able to cast more than 7 different spells.

And you should use SetUnitAbilityLevel native,. instead of SetUnitAbilityLevelSwapped.
 

wraithseeker

Tired.
Reaction score
122
well I am lazy, brb, Isn't using one dummy making it not Mui, like 10 units cast it at once what will happen. I'm currently doing a request for someone.
 

Viikuna

No Marlo no game.
Reaction score
265
Nope, its MUI. Try to make a warstomp using one Dummy, its completely possible.

Im actually going to try if I can make my map use only one dummy for all spells.
 

Viikuna

No Marlo no game.
Reaction score
265
Do as you wish. Using one dummy just feels the simplest and most functional way to do spells, at least for me.

Ahm... why isn't ownership of the dummy changed? If the Stormbolt does any damage, you do have an issue with kill credit coming into play

I would just use UnitDamageTarget. This way hero gets the credit from kill, not dummy.
 

Azlier

Old World Ghost
Reaction score
461
Using one dummy can indeed affect MUI. Let's say that you were casting one ability, and the dummy appears to cast, but he is called by another before he can. Boom, MUI shredded to bits.
 

Flare

Stops copies me!
Reaction score
662
If the dummy's Animation - Backswing Time and Animation - Cast Point are set to 0.000, and the casting time of the dummy spell is 0, it'll be difficult to break the MUI capabilities of the spell (there would still be a slight delay in casting, but it would only be a fairly small fraction of a second) since you'd need 2+ instances within 0.2 seconds of each other (0.2 is just a rough guess, it may be a bit lower), although it's still not guaranteed.

If you want a sure-fire test,
  • Set Animation - Backswing Time and Animaton - Cast Point of your testing hero to 0.000, and the main spell's casting time/cooldown to 0
  • Make a simple trigger that displays a message when the dummy casts the spell (see below)
  • Move your hero away from the target (400-500 distance away outside of cast range should be fine)
  • Give a number of shift-click orders with the spell (i.e. click spell, hold Shift, repeatedly click same target), 3 or 4 should do, just make sure you know how many orders are issued
  • If the messages are displayed the same number of times as the amount of orders given, you should be fine - otherwise, you'd be better off going the safe route and making a dummy per instance
If a unit is unable to break MUI through spam-casting with a very fast cast rate, it's unlikely that multiple players will be able to achieve the same effect (since the spell will probably have a cooldown in a normal map, and I doubt players would be that lucky :p)

And the simple test trigger :p
Code:
Unit starts the effect of an ability

Ability being Cast == Dummy Spell

Display the text: "Dummy cast spell" to (All players)
Code:
 

wraithseeker

Tired.
Reaction score
122
I'll give it a try..

WAIT

First of all, you forgot that this was a passive ability..
So you can't shift click.
and they get stunned so you can't spam it like mad.

Verison 1.2 is out and will most probaby be the last verison.
 

Viikuna

No Marlo no game.
Reaction score
265
When this dummy casts a spell, it doesnt take any time, so it should be MUI. If it would take any time to cast a spell, this could not work at all, because that RemoveAbility -call.

Wait, you removed that UnitRemoveAbility, but left UnitAddAbility there.
If you dont wanna remove ability after spell cast, you should move that UnitAddAbility to your Init function.
 

Flare

Stops copies me!
Reaction score
662
First of all, you forgot that this was a passive ability..
Indeed I did :eek: Give the unit an insanely high attack speed (in the region of <0.05s, just make sure that the Combat - Backswing and Damage Point are at 0.000), set the CHANCE factor to 100, and increment a variable for each attack (using Unit is Attacked) performed, and each message displayed, and check if the numbers are in line with each other?
 

Viikuna

No Marlo no game.
Reaction score
265
Flare you can test it by yourself too. Just pick 10 units to group, loop trought that group and order that one dummy to stun them all. It doesnt take any time to cast, so they all get stunned exactly same time.
 

Flare

Stops copies me!
Reaction score
662
Bleh, got mixed up in the usage of the spell - thought it was a chance for your attacks to stun, not for attacks against you to stun the attacker :p Still, doesn't mean 10 different units can't attack at once ^_^

Again, going by latest code, dummy ownership isn't being changed - Player 1 (Red) will always get credit for any kills resulting from this ability (if the Stormbolt does damage, or if people decide to add damage to the Stormbolt via Object Editor). Also, if the attacker is an ally of Player 1 (Red), will the dummy be able to issue the order (since the unit is allied to it)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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