JASS - Creating a Passive Ability in Jass

Viikuna

No Marlo no game.
Reaction score
265
Sry, I wasnt actually complaining. I just tought there might have been something I dont know, like some reason not to use that BJ.

Thx for fast answer.
 

Romek

Super Moderator
Reaction score
963
Sry, I wasnt actually complaining. I just tought there might have been something I dont know, like some reason not to use that BJ.

Thx for fast answer.
Oh. Sorry for accusing you then :p

I'm subscribed to this thread (Instant Email notification). So I can pretty much reply instantly :D
 

Romek

Super Moderator
Reaction score
963
I think there is a way to check if the damage was done by a spell.
...By Using orb effects or other massive systems which require you to change nearly everything in your map.
 

Viikuna

No Marlo no game.
Reaction score
265
Ye, that is the reason why it is tricky to make some damage/attack detection system, which would work in all maps.

For your own map, it is easy to just do all spell damage trought some dummy units, so only damage your unit deals, is hes / shes normal attack.

EDIT. ofc that means you need to trigger all damage sources. Abilities like cleave would ruin it, I guess.
 

Romek

Super Moderator
Reaction score
963
Ye, that is the reason why it is tricky to make some damage/attack detection system, which would work in all maps.

For your own map, it is easy to just do all spell damage trought some dummy units, so only damage your unit deals, is hes / shes normal attack.

EDIT. ofc that means you need to trigger all damage sources. Abilities like cleave would ruin it, I guess.
Exactly.

It is possible. Making all ability damage triggered is an easy option. But not for a tutorial. I'm not exactly going to write
"For this spell to work, you need to get rid of all your non-triggered spells and trigger them. And also use a 10,000 line system."
 

emootootoo

Top Banana
Reaction score
51
Exactly.

It is possible. Making all ability damage triggered is an easy option. But not for a tutorial. I'm not exactly going to write
"For this spell to work, you need to get rid of all your non-triggered spells and trigger them. And also use a 10,000 line system."

A basic damage detection system is about 20 lines all up, and only requires you to code orb effects, which is the point of a damage detection system anyway, to code passive attacks.

I see where you are coming from though, it could make the tutorial a lot more confusing for someone.
 

Romek

Super Moderator
Reaction score
963
A basic damage detection system is about 20 lines all up, and only requires you to code orb effects, which is the point of a damage detection system anyway, to code passive attacks.

I see where you are coming from though, it could make the tutorial a lot more confusing for someone.
Wow.. Someone understands me :p

But yeah. I just want this to be about the system. It's just making a basic spell and making it follow the JESP standard. Not some insane damage detection and crap just to stop it possessing when the missile is fired.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
I mostly though since this is a "Creating a Passive Ability in Jass"-thread it should involve something else than a "Unit is Attacked" event feature (which frankly isn't used a lot anyway). The tutorial itself is well explained and should teach one or another something about coding in JASS.
 

Romek

Super Moderator
Reaction score
963
I mostly though since this is a "Creating a Passive Ability in Jass"-thread it should involve something else than a "Unit is Attacked" event feature (which frankly isn't used a lot anyway). The tutorial itself is well explained and should teach one or another something about coding in JASS.
Well.. Maybe.

This is what most passive abilities are anyway.

I might make an Auras tutorial too though.
...And maybe a 'normal spells' one.

Then I'd have a collection of "How to make a Spell" tutorials :D
 
T

Trikk

Guest
I'm reading this tutorial and it's really great, I like how you don't just paste all the code at once but instead leave it up to the reader to figure out what should be done before you show how you did it.

One question: if IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) returns true then the unit is a hero, so wouldn't the trigger only work against heroes instead of never against heroes?

Also, if it procs on 2 or lower on a 0-100 roll, that's 2.97% chance and not 2%.

Just my thoughts so far, I'll go back to reading it now.
 

Flare

Stops copies me!
Reaction score
662
One question: if IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) returns true then the unit is a hero, so wouldn't the trigger only work against heroes instead of never against heroes?
Ye, from the looks of it, it'd only work vs. heroes (and, AFAIK, IsUnitType must be compared against true/false, and not left on it's own, to prevent bugs)

Also, if it procs on 2 or lower on a 0-100 roll, that's 2.97% chance and not 2%.
:p .97% probably won't make much of a difference anyway =D
 
T

Trikk

Guest
How do you know when it is the attacker that is the triggering unit and when it's the attacked?
 

saw792

Is known to say things. That is all.
Reaction score
280
The triggering unit is defined as the unit being attacked. GetAttacker() returns the attacking unit.
 
T

Trikk

Guest
Alright I think I understand now. Just need to change the conditions a bit.

Will this work if I put the ability on neutral hostiles as well or do I have to make a seperate trigger/ability for them? Seems the unit has to belong to a player for it to register the event.
 

Romek

Super Moderator
Reaction score
963
I'm reading this tutorial and it's really great, I like how you don't just paste all the code at once but instead leave it up to the reader to figure out what should be done before you show how you did it.

One question: if IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) returns true then the unit is a hero, so wouldn't the trigger only work against heroes instead of never against heroes?

Also, if it procs on 2 or lower on a 0-100 roll, that's 2.97% chance and not 2%.

Just my thoughts so far, I'll go back to reading it now.

Thanks for the feedback.
Fixed the errors.

Ye, from the looks of it, it'd only work vs. heroes (and, AFAIK, IsUnitType must be compared against true/false, and not left on it's own, to prevent bugs)


:p .97% probably won't make much of a difference anyway =D

Thanks as well.
Fixed :p

That uses the attacker (and it's got a syntax error too, since there's no () after GetTriggerUnit :p)

Fixed the syntax, and the error.

Alright I think I understand now. Just need to change the conditions a bit.

Will this work if I put the ability on neutral hostiles as well or do I have to make a seperate trigger/ability for them? Seems the unit has to belong to a player for it to register the event.

Change the exitwhen in the Init function.
At the moment, it exits when i is >11. This means it will work from players 1-12.

Make it exitwhen i > 15 so that it works on all players.

Thanks for the feedback everyone.
 

Flare

Stops copies me!
Reaction score
662
Hmmm... the useful-ness of this tutorial kinda eludes me, mainly due to it's specific nature. Pretty much anyone would have a basic understanding of how to trigger an On Attack passive (i.e. the event primarily, which is the main thing), and if someone wanted to make something like additional damage based on an attribute (or something, who knows), this tutorial is of little use, other than
As well as this, you'll learn how to make spells easily configurable, use scopes, and other Jass skills.
but looking at other spells (well, that's how I did it, not sure about everyone else) caters for configuration, and (m)any (v)JASS tutorial would cover the rest

People probably have/will find this useful, but I can't see how alot of this would either go without saying, or has already been covered by others, on numerous occasions
 

Romek

Super Moderator
Reaction score
963
Hmmm... the useful-ness of this tutorial kinda eludes me, mainly due to it's specific nature. Pretty much anyone would have a basic understanding of how to trigger an On Attack passive (i.e. the event primarily, which is the main thing), and if someone wanted to make something like additional damage based on an attribute (or something, who knows), this tutorial is of little use, other than

It gives the reader a general idea about spells and passive abilities.
This just sets the basics. Things like adding damage based on attribute are easy enough, and the reader could find out how to do it themselves (or post in the WEHZ)

People probably have/will find this useful, but I can't see how alot of this would either go without saying, or has already been covered by others, on numerous occasions

Maybe so. But then again, look at how many Jass tutorials have been made. All explaining the same thing, in a different way. Everything that is exclusive to this tutorial teaches people new things. And everything that has been mentioned before could explain things in different ways. :)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      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