| 10-01-2010, 05:48 PM | #1 |
I am 'attaching' 12 units to one unit that let's call 'Main Unit' by moving every 0.01 second the units to the main unit. The units have to be forming a circle around the main unit and when the Main Unit moves, the 'attached' units to remain in the same circle, so I use these triggers: Trigger: ![]() Test2
![]() Events
![]() Time - Every 0.01 seconds of game time
![]() Conditions
![]() Actions
![]() Unit - Move Marine 0003 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 30.00 degrees)
![]() Unit - Move Terran Medic 0010 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 60.00 degrees)
![]() Unit - Move Marine 0007 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 90.00 degrees)
![]() Unit - Move Marine 0004 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 120.00 degrees)
![]() Unit - Move Marine 0013 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 150.00 degrees)
![]() Unit - Move Marine 0012 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 180.00 degrees)
![]() Unit - Move Terran Medic 0009 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 210.00 degrees)
![]() Unit - Move Marine 0006 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 240.00 degrees)
![]() Unit - Move Terran Medic 0011 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 270.00 degrees)
![]() Unit - Move Marine 0008 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 300.00 degrees)
![]() Unit - Move Terran Medic 0015 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 330.00 degrees)
![]() Unit - Move Marine 0014 <gen> instantly to ((Position of (Random unit from (Units of type Main Unit))) offset by 320.00 towards 360.00 degrees)I know these are shitty triggers but I decided to try it in the most simple way and the result is: - this trigger causes lag after the 3rd minute so I need an alternative of it that isnt laggy but you get what im trying to do - Even if I make the circle and they stand attached to the main unit like that, whenever the Main unit rotates/turns on a direction, they do not rotate because they are placed at degrees in general but I need to make the degrees towards the facing of the Main unit. How can I do this circle and moved every 0.01 w/o lag and make them rotate as the Main Unit rotates? That is if say Marine 007 is at 90 degrees, when the Main Unit turns on some other direction, Marine 007 should also turn his 90 degrees towards the facing of the Main Unit and the same for all units to turn based on Main unit |
| 10-01-2010, 07:02 PM | #2 |
you have like: 12*2*100*60 = 144000 memory leaks per minute you have to call RemoveLocation, or else you will have massive point leaks you need to replace each line of your trigger with something like: Trigger: ![]() Set TempUnitPoint = Position of Random Unit from Units of type Main Unit![]() Set TempUnitOffsetPoint = TempUnitPoint offset by 320 towards XXX degrees![]() Unit - Move XXX instantly to TempUnitOffsetPoint![]() CustomScript - call RemoveLocation(udg_TempUnitPoint)![]() CustomScript - call RemoveLocation(udg_TempUnitOffsetPoint)also i would try to replace 0.01 seconds with 0.002 seconds, it will most likely still look smooth in game, but the trigger will cause 50% less performance issues |
| 10-02-2010, 12:46 PM | #4 |
First, you need to put Trigger: Custom script: call RemoveLocation(udg_MainUnitUnitPoint)Regarding your turn problem .... try something like: Trigger: Set MainUnitUnitPoint = (MainUnitPoint offset by 320.00 towards ( (facing of YOURMAINUNIT) + XXX) degrees) |
| 10-02-2010, 05:12 PM | #5 |
yes I did it thanks +rep |
