editing a spell to work properly

millzy

Ultra Cool Member
Reaction score
44
ok iv got this spell that creates a shadow and attacks the owner of the shaddow the only this is i dunno how to make it so that the shadow is uncontrollable so i tryed adding locust turns out you cant add locust by triggers :(

how would i go about making it so you cant controll the shadows

Trigger:
  • Pure Shadows
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Pure Shadows
    • Actions
      • Set temp_point = (Position of (Casting unit))
      • Set Temp_Group = (Units within 400.00 of temp_point matching ((((Matching unit) is A structure) Equal to False) and ((((Triggering unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))))
      • Custom script: call RemoveLocation (udg_temp_point)
      • Set PS_unit_lasting = (5.00 + (5.00 x (Real((Level of Pure Shadows for (Triggering unit))))))
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set PS_unit = (Unit-type of (Picked unit))
          • Set temp_point = (Position of (Picked unit))
          • Unit - Create 1 PS_unit for (Owner of (Triggering unit)) at temp_point facing (Facing of (Picked unit)) degrees
          • Unit - Add a PS_unit_lasting second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Attack (Picked unit)
          • Unit - Turn collision for (Last created unit) Off
          • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 60.00% transparency
          • Custom script: call RemoveLocation (udg_temp_point)
      • Custom script: call DestroyGroup ( udg_Temp_Group)
 

Necrach

You can change this now in User CP.
Reaction score
62
Just one question, why not add Locust ability to the Shadow unit in the object editor?

Otherwise, you could put them in a loop running like a 1000 times, ordering the units to attack the target and wait half a second, so that it doesn't matter if you select them and order them to do anything else. However, I have no good experiences from Integer A loops with Wait actions, so I dunno :s
 

millzy

Ultra Cool Member
Reaction score
44
Just one question, why not add Locust ability to the Shadow unit in the object editor?

Otherwise, you could put them in a loop running like a 1000 times, ordering the units to attack the target and wait half a second, so that it doesn't matter if you select them and order them to do anything else. However, I have no good experiences from Integer A loops with Wait actions, so I dunno :s

because its not a unit it self. if you look at the trigger the type of unit is set in a variable
im not going though the object editor to create copys of all the units with locust just for this abilty
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
you could store those units within a unit group and each time a unit from that unit group is issued any order (you have to catch whether its issued by a trigger or not) re-order it to attack its target.

well, to save the target you could add the ability "rally" to your unit via triggers and set the rally point for the unit to be the target of your casted ability.
 

Necrach

You can change this now in User CP.
Reaction score
62
you could store those units within a unit group and each time a unit from that unit group is issued any order (you have to catch whether its issued by a trigger or not) re-order it to attack its target.

well, to save the target you could add the ability "rally" to your unit via triggers and set the rally point for the unit to be the target of your casted ability.

good solution with the rally point, I didn't see a way to store the target.

bad solution with my loops :rolleyes:
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
the only problem with the rally point is that i dont know whether the event to order the shadow to attack its target will avoid the owner of the shadow to set a new rally point in time.
 

RangerX

I am justice!
Reaction score
69
add all the shadows in a group then
[hand made]
Trigger:
  • event- every 0.5 seconds
    • condition-
    • action
    • pick every unit in last_group do
      • for 1 to 12 do
        • if then else
          • ((Picked unit) is in (Units currently selected by (Player((Integer A))))) Equal to True
        • do
    • Selection - Remove (Picked unit) from selection for (Player((Integer A)))
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
so i tryed adding locust turns out you cant add locust by triggers
you can add locust...

try this for adding:
Code:
add
    Events
        Player - Player 1 (Red) types a chat message containing 1 as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
            Loop - Actions
                Custom script:   call UnitAddAbilityBJ( 'Aloc', GetEnumUnit() )
this for removing
Code:
remove
    Events
        Player - Player 1 (Red) types a chat message containing 2 as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units currently selected by Player 1 (Red)) and do (Actions)
            Loop - Actions
                Unit - Hide (Picked unit)
                Custom script:   call UnitRemoveAbilityBJ( 'Aloc', GetEnumUnit() )
                Unit - Unhide (Picked unit)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
adding locust in game hasnt gotten the same effect as to add it in the editor, neither does removing locust from a unit ingame recover the effect of the locust ability entirely.
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
and it wouldn't affect the use of his ability in w/e way?

what i undertand is that he wanted to create a "copy of the target" aka shadow that is uncontrolable (something as faide from HoN) that is uncontrolable.
with adding locust and then removing the "copy of the target" wouldn't harm the game what i can see.

the unit will be invurible and be uncontrolable wich imo atleast would be fair enough.
 

millzy

Ultra Cool Member
Reaction score
44
add all the shadows in a group then
[hand made]
Trigger:
  • event- every 0.5 seconds
    • condition-
    • action
    • pick every unit in last_group do
      • for 1 to 12 do
        • if then else
          • ((Picked unit) is in (Units currently selected by (Player((Integer A))))) Equal to True
        • do
    • Selection - Remove (Picked unit) from selection for (Player((Integer A)))

would this cause any lag also are units that are put in a unit group that die removed or do i need to add if then else unit is dead remove it from group
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
1). yes it would most probably lag late game since it is a periodic unit group leak there...

2). dead units are not removed from a unit group.
 

millzy

Ultra Cool Member
Reaction score
44
it would be better to use the event player selects a unit then
if selected unit is in unit group deselect it right??

how would i remove the leak?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
the event is rather slow, a periodic 0.01 seconds event is the most accurate for this purpose. though still it might glitch since the "unselect" function itself aint the very fastest as well.

to fix the leak you would just have to set the unit group to a global variable and destroy it after usage.

example in pseudo code:

TempGroup = Units selected by player 1 red
pick all units in TempGroup
if picked unit is shadow
remove picked unit from selection for player 1 red
call DestroyGroup (udg_TempGroup)
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
i suggest you find another way around that instead of unselecting the unit since oyu can still select it and order it to do something else before it gets unselected again.
 

millzy

Ultra Cool Member
Reaction score
44
well if u know a way of doing it other than this please tell me im a bit off using this way but it seems to be the only way
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
i suggest you add locust since it will do what you want via triggers, as acc said there is some minor bugg (wich i dont have the slightest idea of what they are) but it will serve your purpos
 

millzy

Ultra Cool Member
Reaction score
44
i tryd that but when i go add abilty to last created unit locust doesent come up
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
i tryd that but when i go add abilty to last created unit locust doesent come up

you need to use a custom script, se my post on side one.

or just use this:
Code:
Custom script:   call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )

this will add locust to lastcreated unit
 

millzy

Ultra Cool Member
Reaction score
44
ok thanks that did it but now i got this other problem when the duratation runs out the shadows die is there away to make it so the just vanish
 
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