Moron unit doesnt move just stands..

D

danhel

Guest
Code:
Shield of Necromancy
    Events
        Unit - A unit Is attacked
    Conditions
        ((Attacked unit) has an item of type Shield of Necromancy) Equal to True
    Actions
        Trigger - Turn off (This trigger)
        Set Shield_of_Necromancy_Attacked = (Position of (Attacked unit))
        Set Shield_of_Necromancy_Old = (Position of (Attacking unit))
        Set Shield_of_Necromancy_New = (Shield_of_Necromancy_Attacked offset by 500.00 towards (Angle from Shield_of_Necromancy_Attacked to Shield_of_Necromancy_Old) degrees)
        Player Group - Add (Owner of (Attacking unit)) to Shield_of_Necromancy_PG
        Cinematic - Disable user control for Shield_of_Necromancy_PG
        Unit - Order (Attacking unit) to Move To Shield_of_Necromancy_New
        Wait 1.50 seconds
        Cinematic - Enable user control for Shield_of_Necromancy_PG
        Player Group - Remove all players from Shield_of_Necromancy_PG
        Custom script: call RemoveLocation (udg_Shield_of_Necromancy_Attacked)
        Custom script: call RemoveLocation (udg_Shield_of_Necromancy_Old)
        Custom script: call RemoveLocation (udg_Shield_of_Necromancy_New)
        Trigger - Turn on (This trigger)

When a unit attacks the hero with the item (i didnt set integer chance stuff yet) it should disable the control of the owner of attacked hero, and order the attacking unit to move backwards.... But now it disables the control, and stop the unit attacking the target and nothing more :( the unit doesnt, move, whats the problem? thaanxa
 

Jo.O

Bored...
Reaction score
70
Well, you turn off 'this trigger' before you have all the actions. Not sure if thats the problem, but thats the only thing that I could think of
 
D

danhel

Guest
If you use trigger - turn off XYZ then it still executes it, but it cant be repeated untill i turn it on again. As you saw i did.
 

Rinpun

Ex TH Member
Reaction score
105
I don't think you want to disable the entire unit control for the player. I think what you will want to do is convert the unit to neutral passive, retain its color, and order it to its location, then change it back in like 1.50 seconds.

Still, I've always had problems with ordering units to do things. They're incredibly resilient and kind of stupid in their reluctance to do ANYTHING when ordered (except for ordering dummy units who, if done correctly, disobey every little rule of ordinary existence and thus can go anywhere easily).
 

0cossin77

Yes, I am awesome.
Reaction score
17
Why dont you try changing the owner of the attacking unit to neutral instead of disabling control?
 
D

danhel

Guest
Still stands... only stands...

Btw neutral passive is the correct, because all of the attacking unit's allies started attack it lol
 
D

deathtomato

Guest
Dunno if im right, but ur trigger seems unnessicarily complicated

Code:
 unit is attacked

Attacked unit has shield .... blah blah

change owner of attacking unit to netral passive (or hostile depending)
order attacking unit to move to position of attacking unit + (degrees) (angle)
wait ## seconds
Change owner of attacknig unit to ###

Ull need to put something in there so it remembers wat player it was owned by... i dunno what, im really tired =_=
 
D

danhel

Guest
:nuts: why is it complicated??

Cant you all fucking get off the neutral hostile? I dont want everything to attack it.

And i said, it still doesnt work, dont repeat the doods please.
 

Rabarber

You can change this now in User CP.
Reaction score
94
Danhel? Get some common sense. And grow up.

Why isn't the "Shield_of_Necromancy_PG" set anywhere?
 

AgentPaper

From the depths, I come.
Reaction score
107
Rabarber said:
Danhel? Get some common sense. And grow up.

Why isn't the "Shield_of_Necromancy_PG" set anywhere?
It is, the action adds the player right after it sets the other variables. And in setting the "new" variable, you should use the position of the attacking unit instead of the position of the attacked unit. This is especially important for if a ranged unit attacks. Also, make the trigger turn itself back on right before the wait, so it can happen more than 1 at a time. Also if you set the unit to neutral passive it won't get attacked.
 
D

danhel

Guest
You didn't read the tread just like others... I wrote the neutral passive already.

As for the position of the turn on function... Read it again! If i turn it on before the custom scripts, and it happens again... Memory leaks :rolleyes:

It still fraeking doesnt move.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
danhel said:
As for the position of the turn on function... Read it again! If i turn it on before the custom scripts, and it happens again... Memory leaks :rolleyes:

This is not true... it's only true if you have any waits in-between turning on the trigger again, and removing the leak. Even if it happens at the same exact time, your computer still has to go through it using the trigger queue.
 

AgentPaper

From the depths, I come.
Reaction score
107
Try de-bugging it. Which means, add a lot of actions that show text, showing what's going on. For example, after you set a variable, have an action show that variable as a chat message. then you can look at the chat log and look for anything wrong. Other than that, I really have no clue. You're unit has the right item, right?
 
D

danhel

Guest
Everything is fine, it displayed everything.

Ofcourse it has the right item, it makes it neutral hostile. But doesnt move.
 
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