| 08-09-2005, 03:23 AM | #1 |
Well I noticed that after about an hour of playing my map, you begin to heavily lag each time you cast an ability. I'm guessing it would be due to memory leaks caused by rects. At the start of the trigger, I center a rect (that was already pre-made and placed in the hidden corner of the map) on the target point of ability being cast. I would then create a dummy unit on that rect and order the casting unit to attack it. In a seperate trigger, when the dummy unit died, it would create explosion dummys at that rect. Very laggy. So I decided to create a rect variable and try it that way, deleting all of the rects I had already placed on the map. Now my trigger looks like this: Code:
MainAbil Copy
Events
Unit - A unit Begins casting an ability
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Big Bang
Then - Actions
Rect - Center AbilityRect[(Player number of (Triggering player))] on (Target point of ability being cast)
Unit - Create 1 Dummy for (Triggering player) at (Position of (Casting unit)) facing Default building facing (270.0) degrees
Unit - Create 1 Target for (Triggering player) at (Center of AbilityRect[(Player number of (Triggering player))]) facing Default building facing (270.0) degrees
Unit - Set Level of AOE damage upon death (blast) for (Last created unit) to (Level of Ability1 for (Triggering unit))
Unit - Order CastingDummy[(Player number of (Owner of (Triggering unit)))] to Attack (Last created unit)
Wait 2.00 seconds
Rect - Remove AbilityRect[(Player number of (Triggering player))]
Unit - Remove CastingDummy[(Player number of (Owner of (Triggering unit)))] from the game
Else - ActionsKeep in mind that the abilityrect is just an empty variable and there is no real rect that it corresponds to. Is it possible to do the trigger this way? Because it doesn't create the target unit at that rect. So either its a problem with the abilityrect, or its a problem with the array. Can you use a rect variable to perform these actions, or would I need to create a dummy rect on the map and use the trigger to center that rect instead? I wanted to do it this way to use the Remove rect action and save memory for later gameplay. |
| 08-11-2005, 07:18 PM | #2 |
Does it lag only the first time you cast the spell? or everytime? You are using 1 variable to grab 1 rect... and you are using a wait action. |
| 08-11-2005, 07:39 PM | #3 |
Yeah, remove the points created by (Center of Rect) |
