HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Matching Condition and Order Research Trigger

02-06-2005, 02:26 PM#1
QuakeII_best
I want to do the following:
- Every 120 seconds I want a building (barrack) to research a series of Upgrades.

Question:
Does this trigger have memory leaks? Where are they and/or how can I fix them?

Code:
Automatic Research
    Events
        Time - Every 120.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AutoResearch_TrueFalse[(Integer A)] Equal to True
                    Then - Actions
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Advanced War Training (Footmen Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Critical Strike (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Cleaving Attack (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Bash (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Attack Speed (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Defense (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Attack Damage (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Hit Points (Footman Upgrade)
                        Unit - Order (Find the first unit next to ((Player((Integer A))) start location) that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Movement Speed (Footman Upgrade)
                    Else - Actions
02-06-2005, 06:43 PM#2
johnfn
I am not great with memory leaks, but I dont see any glaring ones. The biggest problems with leaks are unit groups and player groups, if I remember correctly, and I dont see any there...
02-06-2005, 07:44 PM#3
Tommi
There are no memory leaks.
02-06-2005, 09:12 PM#4
Vexorian
Quote:
Originally Posted by Tommi
There are no memory leaks.
Start Locations calls create new points at the player's location


Player((Integer A))) start location

they leak, save them in a variable use the variable on the calls and later Remove the point
02-13-2005, 09:39 PM#5
QuakeII_best
Here's the "updated" trigger but I got the feeling that I still have memory leaks (the game "pauses" when It executes).
Code:
Research Auto
    Events
        Time - Every 90.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        AutoResearch_TrueFalse[(Integer A)] Equal to True
                    Then - Actions
                        Set Rect_TempPoint = ((Player((Integer A))) start location)
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Player((Integer A))) Current gold) Greater than ((Current research level of Movement Speed (Footman Upgrade) for (Player((Integer A)))) x 10)
                            Then - Actions
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Bash (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Critical Strike (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Cleaving Attack (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Advanced War Training (Footmen Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Attack Speed (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Attack Damage (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Defense (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Hit Points (Footman Upgrade)
                                Unit - Order (Find the first unit next to Rect_TempPoint that matches ((Unit-type of (Matching unit)) Equal to Barracks (Mad))) to research Movement Speed (Footman Upgrade)
                                Point - Remove Rect_TempPoint
                                Game - Display to (Player group((Player((Integer A))))) the text: Automatic Research ...
                            Else - Actions
                                Game - Display to (Player group((Player((Integer A))))) the text: Automatic Research ...
                    Else - Actions

Note: I forgot to give out my reputation points the last time... I'll make up for that this time sorry for the dealy
02-13-2005, 09:47 PM#6
Guest
Maybe I am wrong, but this trigger seems to be fixed
02-13-2005, 09:53 PM#7
Vexorian
Quote:
Find the first unit next to Rect_TempPoint

I can bet this is a WeU function that is way unefficient, what about just saving that into a variable?

set NextUnit = Find the first unit next to Rect_TempPoint ...

Then just use the NextUnit variable to tell it the learn orders