Snippet GUI - Triggerring Evade, Block and Parry.

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
This question comes up at least once a week, and since everyone on TH helped me resolve it, why not put it here, so we avoid any more needless posts.

How to use GUI to trigger Evade, Block, Miss and More.​

First of all, you will need this:

http://www.thehelper.net/forums/showthread.php?t=137957&highlight=Damage+detection+system

It is Very user friendly, completely GUI. Follow the instructions on the said thread to find out how to place it in your map.

Now, say you want to do something when your hero Blocks/Evades/Parries. It's the same effect, your hero does not take damage, that's the bottom line.

First, Find hardened skin under abilities/night elf/units in the object editor. Copy this ability and paste it so you get a custom ability you can work on (not necessary, it's my personal choice, so if you make multiple spells you always have the same base).

Now, Check if it's a unit/object or hero ability depending on what you're working on. What is very handy with the hardened skin is two things.

1) There is a % chance to reduce damage, which for us means a % chance to evade/block/parry.
2) There is a Minimum Damage data field and an Ignored damage data field. You change the minimum damage field to 0.04 and set the ignored damage field to 99999.

Then Trigger is simply this:
Trigger:
  • Block
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Block for GDD_DamagedUnit) Greater than 0
      • GDD_Damage Less than or equal to 0.08
      • GDD_Damage Greater than 0.00
    • Actions
      • Set TempPoint = (Position of GDD_DamagedUnit)
      • Floating Text - Create floating text that reads Blocked! at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 50.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 2.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)


A little explanation on how it works. GDD_Event is a Game - Value of a real variable event. You just put the GDD_Event as you're variable and leave it at 0.00. This trigger then fires when the unit takes damage.

In this example, we are using Block as a skill. So, the first condition is A Integer Comparison - Level of ability (Your hardened skin ability, which is block here) for the unit. It has to be greater than 0 so we know the unit has the ability. Knowing that it has the ability, this trigger won't fire off needlessly if the unit did not take the said ability.

GDD_Damage is a real variable. Use the Real Comparison and Set it to Less than 0.08 and more than 0.00. This value is so precise, that it will only fire off when the Hardened skin effect happens. This range is due to the multiple armor types being able to reduce damage further, as Weep pointed out. If you are not using multiple armor types, feel free to lessen the range! x)

The last part of the trigger is just the floating text. It looks exactly the same like the in-game Miss! , just change the Blocked! to anything you want.

This is leakless, MUI MPI and any other acronym you may find ^^

Now you can make any ability that you want, that fires of when the unit Blocks/Evades/Parries. For example, the said ability above can have a counter that will deal damage to the attacking unit, and the trigger would look like this.

Trigger:
  • Block
    • Events
      • Game - GDD_Event becomes Equal to 0.00
    • Conditions
      • (Level of Block for GDD_DamagedUnit) Greater than 0
      • GDD_Damage Less than or equal to 0.08
      • GDD_Damage Greater than 0.00
    • Actions
      • Set TempPoint = (Position of GDD_DamagedUnit)
      • Floating Text - Create floating text that reads Blocked! at TempPoint with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 50.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 2.00 seconds
      • Custom script: call RemoveLocation(udg_TempPoint)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GDD_DamagedUnit is in DefendGroup) Equal to True
        • Then - Actions
          • Unit - Cause GDD_DamagedUnit to damage GDD_DamageSource, dealing 40.00 damage of attack type Chaos and damage type Universal
        • Else - Actions


Feel free to experiment with this, and hopefully you will look here before posting another thread about it.

If anyone has anything to add to this, i will edit this post. I need no rep for this, all of these things were done by people at TH, just thought I'd summarize it all for clarification ^^

Credits: the the Immortal for the idea, Weep for the damage system. ^^

Increased the Range of damage to compensate for the armor system. - Weep
 

the Immortal

I know, I know...
Reaction score
51
Thought of putting it there just the first time I mentioned it (the first time this year) but wusn't able to. Good thing 'twas done.

Also 'd like to say it should work with precise numbers (Damage == 0.03 for ex.).. gives less room for errors. (thou what unit would be able to do 0.0x dmg? m?)

Oh, and my damn ego willing to say 'twas I who (re)discovered it..
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Added the Credits to you guys for making this wonderfully easy system ^^

Would have done it in the first place, but couldn't remember your user x)
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Also 'd like to say it should work with precise numbers (Damage == 0.03 for ex.).. gives less room for errors.
The problem with that is that it seems a unit's armor type (eg. Fortified) will modify that minimum damage based on the applied damage type, so even with a minimum damage of 0.04, a piercing unit attacking a unit with the block ability and fortified armor type would only take 0.014 damage. :thdown:

Now that I think about it, I suppose the safest damage range for 0.04 minimum would be greater than 0 (divine armor take 5% damage) and less than or equal to 0.08 (piercing vs. small armor).
 

Deaod

Member
Reaction score
6
Terrible approach. Hitsounds still get played, projectile still homes, and still impacts at the "correct" Z. Not to mention that the texttag will be off in time.

And Variable events are...bad. There are better ways to do this, even with GUI on top level.
 

Anachron

New Member
Reaction score
53
Deaod, now you are on TheHelper aswell?
Anyway, deaod is correct. This way is really awful. I suggest pausing the unit and playing the animation or such things.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Terrible approach. Hitsounds still get played, projectile still homes, and still impacts at the "correct" Z. Not to mention that the texttag will be off in time.

And Variable events are...bad. There are better ways to do this, even with GUI on top level.
Deaod, now you are on TheHelper aswell?
Anyway, deaod is correct. This way is really awful. I suggest pausing the unit and playing the animation or such things.

Fair enough, don't be a troll and post you're proper way so i may edit this TERRIBLE way of doing it. If you don't have a better way, don't troll, thanks ^^

Edit: Not that i don't enjoy criticism from others, it's just the fact that saying how it's terrible yet not suggesting any other improvements makes me get pissed.
 

Deaod

Member
Reaction score
6
Striking out doesnt work, eh?

Anyway, the only "proper" way to do this, is by replacing Blizzards attack system with a softcoded one. For that you need a decent projectile system (capable of simulating blizzards arcing), an Object Data loader (like the //! loadslk command in JassHelper) to load the Damage Point values for all units, and a bit of scripting on your side to combine this.

Edit: Oh, and you need to monitor all attack speed bonuses.

Seeing as you currently use GUI, i would be VERY surprised if you managed to do all this before Starcraft II comes out. I mean no offense, its just that in my experience most of those who use GUI dont know JASS, let alone vJass, very well, or even at all. There are exceptions to this, feel free to proove me wrong.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Well then, read the title of the thread.

GUI - Triggering Evade, Block and Parry.

I rest my case. Make it GUI and better please ^^

And no, striking doesn't work xD
 

Deaod

Member
Reaction score
6
Make it GUI and better please ^^
No. I wont go through hell to prove a GUI user wrong. And i suggest you rethink that argument: Do i have to be able to make good movies, in order to criticize bad movies?

I just told you how to do this so all the flaws i found with it are fixed. I wont do your work. You submitted it, you maintain it.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Meh, i won't bother. You can point out the flaws wherever you want, it's not contributing to the thread in any way if you don't suggest a GUI way for me to fix it. So far, i found this system to be:

Easy, Leakless, Lagless, Takes 5 minutes to set up.

Starcraft 2 and knowing Jass has nothing to do with mapmaking, i would say something to you but i risk getting this thread closed, if you want to explain to me what Starcraft 2 or knowing Jass and VJass has anything to do with mapmaking, send me a PM
 

Viikuna

No Marlo no game.
Reaction score
265
Deaod is kinda right and its not easy to do this stuff properly and it indeed requires lots of work, but it is still possible to do.

( Although, the only people I have seen doing this till now is Tides of Blood guys, and they have released nothing but few videos yet.. )

All the needed resources almost exists already for public. Theres plenty of damage detection systems, theres few projectile systems ( none of them is good enough, though, so thats bit of a problem ), theres bonus systems like BonusMod and UnitProperties for doing that attackspeed calculation, theres even that object data system thingy by PurplePoot and BoBo_TheKodo in wc3c.net for getting damage points and required data for projectile arc thingies and stuff like that. ( Although that system is not completed yet. )

I guess this is nice for people who dont want to do everything in Jass for their maps, but it would also be cool if someone did stuff like this properly for a once.
 

Nenad

~Choco Coronet~ Omnomnom
Reaction score
137
Deaod is kinda right and its not easy to do this stuff properly and it indeed requires lots of work, but it is still possible to do.

( Although, the only people I have seen doing this till now is Tides of Blood guys, and they have released nothing but few videos yet.. )

All the needed resources almost exists already for public. Theres plenty of damage detection systems, theres few projectile systems ( none of them is good enough, though, so thats bit of a problem ), theres bonus systems like BonusMod and UnitProperties for doing that attackspeed calculation, theres even that object data system thingy by PurplePoot and BoBo_TheKodo in wc3c.net for getting damage points and required data for projectile arc thingies and stuff like that. ( Although that system is not completed yet. )

I guess this is nice for people who dont want to do everything in Jass for their maps, but it would also be cool if someone did stuff like this properly for a once.

I understand that, the reason why i posted this is because it's so easy to implement and people keep asking for it all the time. And it would be nice for someone to do it who knows Jass and is willing to spend some time on it, but i don't know Jass x)

Also, it links to Weep's damage detect system, which while you can argue it isn't perfect (i can't i don't know JASS i think it works perfectly), which is very GUI friendly. I only needed a copy paste and i got a full damage detection system without the need for any additions to wc3editor (like vjass, newgen and stuff) x)

Also i'm sorry if i was rude anywhere >.< , i kinda felt the need to defend the people who thought of this
 

Deaod

Member
Reaction score
6
Lol, that's a direct insult at Weep.
So what? Is he gonna persecute me for speaking my mind?

Starcraft 2 and knowing Jass has nothing to do with mapmaking
Hows knowing JASS NOT related to mapmaking? Explain that to me, please.
Besides, i mentioned SC2 to give you a time frame.

it's not contributing to the thread in any way if you don't suggest a GUI way for me to fix it
Yes, it is. You should throw away GUI and start writing vJass. Noone in the world needs GUI (whereas you need JASS, and to keep you from going insane, you need vJass). Use it in private however you may wish, but dont submit "GUI systems" (its an oxymoron, as i already mentioned) for others to use.
 

Sickle

New Member
Reaction score
13
This only works for block because of the problems that Deaod mentioned, since blocks are not supposed to be soundless.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Terrible approach. Hitsounds still get played, projectile still homes, and still impacts at the "correct" Z. Not to mention that the texttag will be off in time.
Ok, but that's fine for an effect that's supposed to be a block or a parry, and even then only the hitsound is wrong for dodging (though not exactly mimicking WC3's own evasion).

And Variable events are...bad. There are better ways to do this, even with GUI on top level.
Sure, I could have users register their triggers to be directly run by the system, but that's not a very "GUI-friendly" interface. Using a variable event provides the familiar event-driven paradigm. If you know of a better way to have a trigger run without the system knowing of the existence of the trigger in question, feel free to suggest it. :thup:

Oh, and keep in mind that I want to keep it in plain JASS so there aren't any requirements for Windows-only programs (specifically JassHelper).

Lol, that's a direct insult at Weep.
Not really.

You should throw away GUI and start writing vJass. Noone in the world needs GUI (whereas you need JASS, and to keep you from going insane, you need vJass). Use it in private however you may wish, but dont submit "GUI systems" (its an oxymoron, as i already mentioned) for others to use.
I'm glad you're not a moderator here, because not everyone conforms to your perspective.
 

Deaod

Member
Reaction score
6
Windows-only programs (specifically JassHelper)
You have no idea what WINE is capable of. Heck, i think WINE runs on Macs too (on Intel Macs, that is).

I'm glad you're not a moderator here, because not everyone conforms to your perspective.
Show me ONE "GUI system" that couldnt be done more efficiently and with a better API in vJass, i dare you. I wont spend hours in the Variables dialog in order to import some GUI system (as a matter of fact, i wont ever import any "GUI system").

About that variable event: Okay, its a "GUI friendly" interface, ill give you that. I couldnt come up with anything better, so far. Then again, there might be something im missing, i havent used GUI in quite a while.
Have fun finding the bug when someone accidentially sets the variable to 0.00.
If you would just drop GUI support you could do a safer interface. But sadly, noone has the need for yet another damage detection system.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
I suppose this isn't the thread for it, but:

> You have no idea what WINE is capable of. Heck, i think WINE runs on
> Macs too (on Intel Macs, that is).

I am aware, and have run it that way myself. That doesn't mean I'm happy relying on it, making others rely on it, or using nothing but [ljass]//! import[/ljass]. If only there was a [ljass]//! vjass[/ljass] counterpart to [ljass]//! novjass[/ljass], you could save actual code in the unmodified (Mac) World Editor...but I digress.

> Show me ONE "GUI system" that couldnt be done more efficiently and
> with a better API in vJass, i dare you.

I can't, because vJass is objectively superior in terms of capabilities, possible efficiency, etc. That is, unless you consider that some people want to use the GUI instead of writing code in spite of the downsides, which is the heart of this disagreement.

> I wont spend hours in the Variables dialog in order to import some GUI system
You don't have to; the World Editor does that for you automatically. If made well, it's as easy as copy/paste/reassign rawcodes.

> (as a matter of fact, i wont ever import any "GUI system").
Sounds good.

That doesn't mean you should criticize people's choice to use it, or other people's submissions meant for people who do use GUI. It's no harm to you, nor harm to the mapper, as long as they're aware of the limitations of GUI.

Suggesting that something would be easier or faster if coded is fine, even welcome, for people asking questions. In the case of resource submissions, though, I'm pretty sure that someone submitting a GUI snippet or system has already specifically decided on it, so in those cases (like this thread) suggesting a JASS re-write would only be constructive in extreme cases of inefficiency.

Normally I'd think a submission such as this one is a little too simple, but the question of how to trigger blocking has been asked three or so times recently, all looking for GUI, and this works, with some restrictions, so why not.*

> Have fun finding the bug when someone accidentially sets the variable to 0.00.
...or when someone forgets to ReleaseTrigger(), or doesn't initialize their struct, or destroys a global group, or... It's not the author's problem if someone deliberately misuses the system. The worst thing about a variable event is that the World Editor won't correctly create that variable automatically if a spell is copied over before the system itself.

* Comma overuse, ahoy!
tl;dr? In the end, I guess I'm not so much arguing in favor of GUI as I am arguing against unnecessary badgering of those who use it, and trying to point out that it was, indeed, unnecessary.
 

Deaod

Member
Reaction score
6
No.

I am aware, and have run it that way myself. That doesn't mean I'm happy relying on it, making others rely on it
Then where does that Windows-Only come from? JassHelper was specifically designed with WINE in mind.
Making others rely on JassHelper had some very good impact on WC3 modding as a whole (in my opinion, at least).

vJass is objectively superior
Then why bother supporting inferior solutions?
consider that some people want to use the GUI instead of writing code in spite of the downsides,
This is why? Well, im not telling anyone to stop clicking in GUI. Frankly, you can do anything you want in private. But when it comes down to systems, well thats a different matter. Using GUI for samples, well, i guess i couldnt say anything against that. But samples are SAMPLES, and not meant for actual use.

That doesn't mean you should criticize people's choice to use it
Im not criticizing their choice of using GUI, they should just spare the rest from their horrible abominations they call "GUI systems", and instead learn vJass, as they are more likely to get something out of THAT than out of using GUI.

I'm pretty sure that someone submitting a GUI snippet or system has already specifically decided on it
That still doesnt validate that resource. Ive brought up valid (at least i think they are) flaws of this system (unrelated to this GUI<->JASS discussion, i wouldve brought that up in a vJass submission as well). Sure, you could fix those flaws in GUI (using a bunch of custom scripts and some vJass dependencies), i think thatd be possible. Its just that using vJass in this case saves you from a LOT of trouble. Im not suggesting a vJass rewrite because its necessary to use vJass. Im suggesting that because it keeps you from having headaches. And because setting such a system up in vJass is a few orders of magnitude less complicated and tiresome than in GUI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top