Unit within range problem

Tholdalf

New Member
Reaction score
2
ok im creating a nova spell and the nova is working all right its built up of orb and theres my prob.. is there a way to detect when a unit comes within x range of a orb? as
Code:
Unit comes within x range of (unit)
only works on units already on the map.:confused:

Thanks in advance.
 

sjakie

Cookie Be Awesome!
Reaction score
127
Do you mean "only works on units already on the map." as in you can only select a unit already on the map as a unit they come close to?

If thats the case, you're using a specific unit event, you have to use a general unit event.
 

sjakie

Cookie Be Awesome!
Reaction score
127
There is no unit within range under the Generic tab :rolleyes: atleast i can´t find one.

Hmmm....now you're saying it, I've never seen one either...:rolleyes:
Coming withing range of any unit doesnt make sense anyway, let me think what alse can be the problem....
 

Tholdalf

New Member
Reaction score
2
Well its the only thing i can come up whit that would work as if i use pick unit within range there might be some bugs like picking a unit twice thus damage/heal him for more then its intended.:p
 

sjakie

Cookie Be Awesome!
Reaction score
127
Yes...I gues you'll have to take the hard way:p (unit withing range is a standalone event....I know that event for so long and I've never noticed it:eek: I'm so stupid)
 

Tholdalf

New Member
Reaction score
2
Sry if this is a double post but it doesn´t work at the damage part.. anyone that has any tips?

The code (there are 2 parts)

Code:
Holy Nova
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Holy Nova 
    Actions
        Set Holy_nova_caster = (Triggering unit)
        Set Facing_Of_Holy_Nova_Caster[(Player number of (Owner of (Triggering unit)))] = (Facing of (Triggering unit))
        Set Holy_Nova_caster_Point[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
        For each (Integer A) from 1 to 20, do (Actions)
            Loop - Actions
                Unit - Create 1 Holy Nova Orb for (Owner of (Triggering unit)) at Holy_Nova_caster_Point[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
                Unit Group - Add (Last created unit) to Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))]
                Set Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))])] = (Last created unit)
                Trigger - Add to Holy Nova Damage heal <gen> the event (Unit - A unit comes within 100.00 of Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))])])
                Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Move To (Holy_Nova_caster_Point[(Player number of (Triggering player))] offset by 1000.00 towards (Facing_Of_Holy_Nova_Caster[(Player number of (Owner of (Triggering unit)))] + 0.00) degrees)
                Set Facing_Of_Holy_Nova_Caster[(Player number of (Owner of (Triggering unit)))] = (Facing_Of_Holy_Nova_Caster[(Player number of (Owner of (Triggering unit)))] + 18.00)
        Wait 3.00 seconds
        Set Facing_Of_Holy_Nova_Caster[(Player number of (Owner of (Triggering unit)))] = 0.00
        Set Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))])] = No unit
        Set Holy_nova_caster = No unit

Code:
Holy Nova Damage heal
    Events
    Conditions
        (Triggering unit) Not equal to Holy_nova_caster
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True
            Then - Actions
                Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((50.00 x (Real((Level of Holy Nova  for (Triggering unit))))) + 0.00))
            Else - Actions
                Unit - Cause Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of Holy_nova_caster))])] to damage (Triggering unit), dealing (50.00 x (Real((Level of Holy Nova  for (Triggering unit))))) damage of attack type Spells and damage type Magic
 
S

Slate.Master

Guest
First i would assume that the triggering unit in the second trigger also has the Nova ability, if not, that would be the problem.
Also, you could have edited your previous post and the first trigger leaks a point, I think.
 

Tholdalf

New Member
Reaction score
2
No as the triggering unit in the secound would be the unit that comes within range.. it is writen quite wierd as i have yet to find some way to make it happen for all the twentie bolts.. if i do 20 triggers one for etch bolt it works but its not weary efficient..:p
 

vypur85

Hibernate
Reaction score
803
For the first trigger:
Code:
                Unit Group - Add (Last created unit) to Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))]
                Set Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))])] = (Last created unit)

Code:
        Set Holy_Nova_Bolts[(Number of units in Holy_Nova_Unit_Gropu[(Player number of (Owner of (Triggering unit)))])] = No unit


Don't really understand why the above are needed. Don't seem to be necessary.

For the second trigger:
Code:
                ((Triggering unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True

This condition seems a little bit weird. Why would the triggering unit be the ally for triggering unit? This will always return as true I think.

What is the spell supposed to do? Is it to make the dummy missile units to either heal or damage units?

When using 'Unit comes into range' event, you can only detect the units that is 'entering' the said unit. You cannot detect the 'unit being entered to'. (Hope you understand what I'm crabbing).
 

Tholdalf

New Member
Reaction score
2
Yes i know that about the triffering unit but as i said that part of the code is not finished so i left it as it is at default.
 

Flare

Stops copies me!
Reaction score
662
you need to pick every unit who couldve fired the event (well, the unit that you added to the event i.e. your orbs). then, get the orbs location, the triggering units location, and the distance between. if the distance is small enough, you know which unit caused the event to trigger. heres the code used in my Black Arrow spell (hopefully its understandable)

Code:
BA damage
    Events
    Conditions
    Actions
        Unit Group - Pick every unit in BAArrowGroup and do (Actions)
            Loop - Actions
                Set BADummyPt[(Custom value of (Picked unit))] = (Position of BADummy[(Custom value of (Picked unit))])
                Set BATargetLoc[(Custom value of (Picked unit))] = (Position of (Triggering unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Distance between BADummyPt[(Custom value of (Picked unit))] and BATargetLoc[(Custom value of (Picked unit))]) Less than or equal to 101.00
[COLOR="Red"]                        ((Triggering unit) belongs to an enemy of (Owner of BACaster[(Custom value of (Picked unit))])) Equal to False[/COLOR]
                        ((Triggering unit) is alive) Equal to True
                    Then - Actions

I checked the distance between every Black Arrow unit and the triggering unit to find out which particular arrow was causing the event to fire. Also, you should change the red condition so its (Owner of Picked Unit) that you are checking the triggering unit against for enemy status.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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

      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