Unit facing problem

thorhunter

You can change this now in User CP.
Reaction score
32
The trigger goes as follows:

Time - Every 0.05 seconds of game time
Conditions
Actions
Set Temp_unit = AnasterianPhoenix 0912 <gen>
Set Temp_unit2 = Anasterian Sunstrider (phoenix) 0580 <gen>
Set Temp_point = (Position of Temp_unit2)
Set SkillAnasX = (X of Temp_point)
Set SkillAnasY = (Y of Temp_point)
Set SkillAnasFacing = (Facing of Temp_unit2)
Custom script: call RemoveLocation(udg_Temp_point)
Custom script: call SetUnitX(udg_Temp_unit, udg_SkillAnasX)
Custom script: call SetUnitY(udg_Temp_unit, udg_SkillAnasY)
Custom script: call SetUnitFacing(udg_Temp_unit, udg_SkillAnasFacing)

The point is, it stops working properly after few minutes (like the location of Temp_Unit2 changed to some random place and Temp_unit starts facing it for some reason, then it chooses another location and Temp_unit stares at it, and again and again). Any ideas?
 

WolfieeifloW

WEHZ Helper
Reaction score
372
That's sort of a weird problem.
Mind uploading the map?

Try removing Temp_point at the end of the trigger.
Also, you should null the units at the end:
Code:
Custom script:   set Temp_unit2 = null
Custom script:   set Temp_unit = null
And lastly, :p
When you post triggers like that, right-click on the trigger name (Above 'Events').
Select "Copy As Text", then come back here and paste the code between [noparse]
Trigger:
[/noparse] tags.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Well, if it works, all good then :)
And I'm not exactly sure, but I think it's something to do with the unit being overridden, so the previous unit is lost in memory.
 

thorhunter

You can change this now in User CP.
Reaction score
32
Seems like nulling the units fixed the issue, though I have no idea why since I never nulled the unit variables and everything worked fine. Anyway, thanks.
 
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