Detecting a point target ability

Moridin

Snow Leopard
Reaction score
144
Hey. I was wondering if there's any way to detect if an ability cast is a point target ability or not?

For example, you can detect if it's a unit target ability by using the condition:
Code:
(Target unit of ability being cast) Not Equal to No unit
I tried using the Integer condition:
Code:
(Distance between (Position of (Triggering unit)) and (Target point of ability being cast)) Greater than 0
...but that also triggers for an ability that doesn't have a target at all.

------

Another question, would certain passive abilities like critical strike have a unit target on proc?
 

the_ideal

user title
Reaction score
61
Set location_temp to the point of the ability being cast and then create a dummy unit at location_temp. Then check to see if the unit is within 50 of the point. Then remove the unit.

There might be a better way but this should work, and it shouldn't lag.
 

Jedi

New Member
Reaction score
63
If target unit equal to no unit, then it is a point targeted ability.What you want to detect?
 

Moridin

Snow Leopard
Reaction score
144
If target unit equal to no unit, then it is a point targeted ability.What you want to detect?

What about no target abilities? Like Thunderclap or any summon spell.

Set location_temp to the point of the ability being cast and then create a dummy unit at location_temp. Then check to see if the unit is within 50 of the point. Then remove the unit.

There might be a better way but this should work, and it shouldn't lag.
I don't see how this would work because:

What if a unit casts a point target ability at his own position?
What if a unit casts a unit target ability. The call for "Target point of ability being cast" will give the center of the map because there is no target point.
 

Ayanami

칼리
Reaction score
288
Well, you could detect if it's a unit target ability by using:

Trigger:
  • (Target unit of ability being cast) Equal to No unit


Then, if this is true, then it HAS to be a point target spell. Just do a simple If/Then/Else.
 

Bogrim

y hello thar
Reaction score
154
If you're using a spell like Shockwave, you can detect the target unit of ability being cast in addition to the target point. If there is no target unit, it's a point target.
 

Moridin

Snow Leopard
Reaction score
144
Well, you could detect if it's a unit target ability by using:

Trigger:

* (Target unit of ability being cast) Equal to No unit



Then, if this is true, then it HAS to be a point target spell. Just do a simple If/Then/Else.
I don't know if I'm missing something :S. What if I use a spell with no target? Then that condition would return (no unit) just as if I used a point target spell.

Just to clarify, I know how to detect a unit target ability. What I don't know is how to detect a point target ability.

If you're using a spell like Shockwave, you can detect the target unit of ability being cast in addition to the target point. If there is no target unit, it's a point target.
Could you elaborate as to the actions you would use to extract the target point/target unit into a variable?

Can you explain why you need that?
If you look at the resource I submitted Energy Flow, the spell essentially is a meant to be a supplement to other targeted spells. Currently it only works for unit target abilities because that's all I can detect. I need a way to detect if the ability is a point target ability and change all the neccessary variables accordingly.
 

sentrywiz

New Member
Reaction score
25
Do you need this for an ability? Or just a detection system?

Here is what I did now. Tested, works... I'm sure you can tweak it for your needs.

Trigger:
  • Spell Test
    • Events
      • Unit - A unit comes within 999999.00 of Dummy Spell Control <gen>
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Owner of (Entering unit)) controller) Equal to User
    • Actions
      • If (((Playable map area) contains (Target point of ability being cast)) Equal to True) then do (Game - Display to (All players) the text: test) else do (Do nothing)


No point abilities won't count. Unit target abilities won't count. Only point target abilities. I'm sure you understand the trigger :)
 

Bogrim

y hello thar
Reaction score
154
Could you elaborate as to the actions you would use to extract the target point/target unit into a variable?
Very simple:
Trigger:
  • Shockwave Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Equal to No unit
        • Then - Actions
          • Game - Display to (All players) the text: point target
        • Else - Actions
          • Game - Display to (All players) the text: unit target

Just set your variable depending on the outcome of the condition.
 

hgkjfhfdsj

Active Member
Reaction score
55
another alternative is to catch the order type on spell cast (begins casting), for example
Trigger:
  • Store Order Type
    • Events
      • Unit - A unit Is issued an order with no target
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order targeting an object
    • Conditions
    • Actions
      • Custom script: if GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER then
      • Set ordertype = target
      • Custom script: elseif GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER then
      • Set ordertype = point
      • Custom script: else
      • Set ordertype = no target
      • Custom script: endif

saving the order type to some unit index then later restoring it on spell effect (starts effect). since units can only be given 1 order at a time, 1D unit index array should work. the saved ordertype will always update itself to the latest order so ordering a unit to stop will not break this. im not sure if this will catch autocast spell (im pretty it does) or passive spells, nor have i fully tested it :p, eg this might break on spells that can target both units and points.

EDIT
not sure if it has been answered, but as for your 2nd question, afaik you cant detect when a passive ability procs so there will not be any event responses (triggering/targeted unit, point etc). most likely you will need to create the passive ability from scratch then fire the event itself, attaching the appropriate unit/location.
 
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