Detecting Custom Value

Admit

New Member
Reaction score
25
Is there any way to detect custom value of the UNIT-B in this line of code?

Trigger:
  • Unit - A unit comes within 256.00 of UNIT_B <gen>
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Do you want the custom value involved in the "Comes with <Range>" part of that?
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
you could always pick every unit within x range and do action if that would work
 

Admit

New Member
Reaction score
25
Do you want the custom value involved in the "Comes with <Range>" part of that?

Sorry i don't really understand what you mean with that.
I wan't to get the custom value from the UNIT_B (UNIT_B is a dummy unit that im creating from another trigger) and then check if it matches with the triggering unit.


you could always pick every unit within x range and do action if that would work

I have already thought about that but it wouldn't work with the trigger very good.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
You mean something like this?

Trigger:
  • (Custom value of (Triggering unit)) Equal to (Custom value of UNIT_B &lt;gen&gt;)
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
you could add an immulasion on your dummy unit with 0 damage
and check if a unit takes damage and use dmaage scource to detect dummy unit.

if you just want the dummy to run the trigger once per unit just add the unit that takes damage to a unit group and check if unit is in group x equals false
 

Admit

New Member
Reaction score
25
you could add an immulasion on your dummy unit with 0 damage
and check if a unit takes damage and use dmaage scource to detect dummy unit.

if you just want the dummy to run the trigger once per unit just add the unit that takes damage to a unit group and check if unit is in group x equals false

I have had that idea to. But what if a group of unit's passes the Dummy at the same time? It won't be able to attack every one.


Here is the trigger btw.

Trigger:
  • GenerateStopUP
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • PlayerInbattle[(Player number of (Owner of (Triggering unit)))] Equal to True
      • (Issued order) Not equal to (Order(carrionswarm))
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(move))
          • (Issued order) Equal to (Order(patrol))
          • (Issued order) Equal to (Order(attack))
      • (Unit-type of (Triggering unit)) Not equal to Dummy
      • (Unit-type of (Triggering unit)) Not equal to Visible Dummy (Green)
      • (Unit-type of (Triggering unit)) Not equal to Visible Dummy (Green&amp;AT)
      • (Unit-type of (Triggering unit)) Not equal to Visible Dummy (Red)
      • (Unit-type of (Triggering unit)) Not equal to GeoPanel (Blue)
      • (Unit-type of (Triggering unit)) Not equal to GeoPanel (Green)
      • (Unit-type of (Triggering unit)) Not equal to GeoPanel (Red)
      • (Unit-type of (Triggering unit)) Not equal to Summoning
    • Actions
      • Set Temp_Group = (Units owned by (Owner of (Triggering unit)) matching (((Level of RemoveUnit (Dummy) for (Matching unit)) Greater than 0) and (((Level of Dummy Indicator for (Matching unit)) Greater than 0) and ((Custom value of (Matching unit)) Equal to (Custom value of (T
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Set Temp_Unit[1] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Moved for Temp_Unit[1]) Greater than 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Pause Temp_Unit[1]
          • Unit - Order Temp_Unit[1] to Stop
          • Trigger - Turn on (This trigger)
          • Wait 0.20 seconds
          • Unit - Unpause (Triggering unit)
        • Else - Actions
          • Unit - Add Moved to Temp_Unit[1]
          • Set D_M_M[(Custom value of Temp_Unit[1])] = (Position of Temp_Unit[1])
          • Set Temp_PointCUnit[(Custom value of Temp_Unit[1])] = (Position of Temp_Unit[1])
          • For each (Integer B) from 1 to 20, do (Actions)
            • Loop - Actions
              • Set Temp_Point[1] = ((Position of Temp_Unit[1]) offset by ((Current movement speed of Temp_Unit[1]) + 150.00) towards (0.00 + ((Real((Integer B))) x 18.00)) degrees)
              • Unit - Create 1 Visible Dummy (Green) for Neutral Hostile at Temp_Point[1] facing (Position of Temp_Unit[1])
              • Unit - Set the custom value of (Last created unit) to (Custom value of Temp_Unit[1])
              • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
              • Unit - Add RemoveUnit (Dummy) to (Last created unit)
              • Trigger - Add to GOrderStop &lt;gen&gt; the event (Unit - A unit comes within ComRangeDummyMove of (Last created unit))
              • Custom script: call RemoveLocation (udg_Temp_Point[1])


Trigger:
  • GOrderStop
    • Events
    • Conditions
    • Actions
      • Set Temp_Unit[1] = (Triggering unit)
      • Unit - Remove Moved from Temp_Unit[1]
      • Set Temp_Point[1] = D_M_M[(Custom value of Temp_Unit[1])]
      • Unit - Move Temp_Unit[1] instantly to Temp_Point[1], facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_Temp_Point[1])
      • Trigger - Turn off (This trigger)
      • Unit - Pause Temp_Unit[1]
      • Unit - Order Temp_Unit[1] to Stop
      • Trigger - Turn on (This trigger)
      • Wait 0.20 seconds
      • Unit - Unpause (Triggering unit)


Trigger:
  • GRemoveUnit
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of RemoveUnit (Dummy) for (Triggering unit)) Greater than 0
    • Actions
      • Set Temp_Unit[1] = (Triggering unit)
      • Unit - Remove Temp_Unit[1] from the game


I want the Condition in GorderStop to check if the triggering unit has the same Custom Value as the dummy it's passing.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
I have had that idea to. But what if a group of unit's passes the Dummy at the same time? It won't be able to attack every one.
.

i didnt read your whole trigger :p since i'm a bit tired...

but why do you want THAT dummy to attack everyone?

just create a new dummy that attacks for it.

handwriten example:

Code:
e) unit takes damage
c) damage scource is in unitgroupX //checknig if its right dummy
a) create a new dummy that do your action blablablabal
 

Admit

New Member
Reaction score
25
i didnt read your whole trigger :p since i'm a bit tired...

but why do you want THAT dummy to attack everyone?

just create a new dummy that attacks for it.

handwriten example:

Code:
e) unit takes damage
c) damage scource is in unitgroupX //checknig if its right dummy
a) create a new dummy that do your action blablablabal

Becuse i need the dummy's (there is more then one, around 10 of them) to check if triggering unit go past them. But at the same time other unit's can run past them without fireing the trigger. So if the triggering unit and a random unit run's past the dummy att the same time the dummy will attack one of them, so it's a 50% chance the dummy won't attack the triggering unit but the random unit instead resultating that the trigger won't fire.

Also im off to sleep.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
may have missread (going to bed now)
but
1. if a unit thats NOT triggering unit pass the dummy nothing happends?
2. if the triggering unit pass without anyone else pass it too, it fires
3. if triggering unit AND another unit pass at the same time, there is a 50% chance that it target the other unit instand of triggering unit?

if follow is correct do something like:
pick all dummy units used for tihs and add all units around them in one unit group.
Code:
if number of units in unitgroup == 1 and picked unit == triggering unit 
[CODE]do loop - w/e you wanted to do
if number of units in unitgroup => 2
do loop - if picked unit = triggering unit set booleanX = true
[/CODE]
Code:
if booleanX = true

something liek that
do pick every unit in unitgroup and do your random dmaage thing
 

Admit

New Member
Reaction score
25
may have missread (going to bed now)
but
1. if a unit thats NOT triggering unit pass the dummy nothing happends?
2. if the triggering unit pass without anyone else pass it too, it fires
3. if triggering unit AND another unit pass at the same time, there is a 50% chance that it target the other unit instand of triggering unit?

if follow is correct do something like:
pick all dummy units used for tihs and add all units around them in one unit group.
Code:
if number of units in unitgroup == 1 and picked unit == triggering unit 
[CODE]do loop - w/e you wanted to do
if number of units in unitgroup => 2
do loop - if picked unit = triggering unit set booleanX = true
[/CODE]
Code:
if booleanX = true

something liek that
do pick every unit in unitgroup and do your random dmaage thing

No im saying that if a unit other than the unit that issued the order the unit that walks close to the dummy won't fire the trigger.


Example:

A unit issues an order => Swapn X Dummy's, Set Custom value of dummy = Unit issued order.

Unit comes witin range of Dummy => If triggering unit's Custom value = Dummy's Custom Value then do action.
 

CAPSLOCKFTW

Member
Reaction score
5
ooh, so you want to check if the unit who issued the order is the same unit who came in range of dummy?
If so then : when Unit - Unit is issued an order targeting an point is activated (your first trigger) add a
"Set variable Temp_Issunit = Triggering unit" to actions

And if you want to check the unit in range then add the condition of checking the unit who came in range:
Event - Unit comes witin range of Dummy
Condition - (Triggering Unit) Equal to Temp_Issunid

Now it will check if the unit who was issued an order is the same who came in range of dummy
 

Admit

New Member
Reaction score
25
ooh, so you want to check if the unit who issued the order is the same unit who came in range of dummy?
If so then : when Unit - Unit is issued an order targeting an point is activated (your first trigger) add a
"Set variable Temp_Issunit = Triggering unit" to actions

And if you want to check the unit in range then add the condition of checking the unit who came in range:
Event - Unit comes witin range of Dummy
Condition - (Triggering Unit) Equal to Temp_Issunid

Now it will check if the unit who was issued an order is the same who came in range of dummy

No, what i ment is that i want to check if the Dummy (the unit that is the center point of the within Range) has the same Custom Value as Triggering unit (the unit that comes within range). The ordered unit is the one that creates the Dummys (and gives the dummy it's Custom Value)
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
well its kind of hard for uss to set uss self into your trigger code and how you want it to work... :p

can you give us a bit more detailed explanation on what the whole trigger is suppost to do and when?
 

Admit

New Member
Reaction score
25
When a unit is issuing a order (ex walk) the trigger creates a ring of Dummy units around the ordered unit.

If the ordered unit comes within a range of 200 of the dummy unit, it is sent back to the middle of the circle and the dummy unit's are removed.

However to prevent other unit's to be sent to the middle of the circle incase they come within range of 200 of the dummy units i need to check that the unit that comes within range is the same as the unit that created the dummy's.

As all unit's in my map has a uniqe custom value i use it to set the dummy's to the same custom value as the ordered unit.

However i need to find a way to get the custom value of the dummy unit's to match it with the ordered unit.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
cant you just store the location when your unit standed before moving and check every x seconds if the unit is outside that range?

something like
Code:
Condition:
(Distance between Temp_point[0] and Temp_point[1]) Greater than MaxMoveRange

when temp point[1] is where the unit originaly standed and temp point[2] is where the unit is now
 

Admit

New Member
Reaction score
25
cant you just store the location when your unit standed before moving and check every x seconds if the unit is outside that range?

something like
Code:
Condition:
(Distance between Temp_point[0] and Temp_point[1]) Greater than MaxMoveRange

when temp point[1] is where the unit originaly standed and temp point[2] is where the unit is now

Won't that lagg if it has to check like 20 unit's at the same time?
More than one unit can issue the order (and create rings for them too)
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
the only way to find out is too try :p

welli dont think it will lagg as long as you clean up the leaks

if it do, skip the dummy units?^^ or make a big dummy unit with the model of a big circel
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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