Deceptively tricky trigger

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

chunkamongus
Junior Member
Posts: 31
Joined: November 14th, 2008, 5:55 am

Deceptively tricky trigger

Post by chunkamongus »

I have a trigger that works but it sometimes causes a memory leak and that c000005 error or whatever. If anyone can design a better trigger to remove the unit that constructs a structure right after he builds it I would be most greatful.
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Deceptively tricky trigger

Post by Ozzapoo »

Please paste your current trigger here.
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Deceptively tricky trigger

Post by Kryptonyte »

Code: Select all

Event - (Generic unit event)
Unit - A unit Finishes construction

Actions - (Unit - Remove)
Unit - Remove (Triggering unit) from the game
Yeah... then add any conditions you want...
Or, for a less leaky one (all GUI sucks)

use "Player-Owned Unit Event"...
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
chunkamongus
Junior Member
Posts: 31
Joined: November 14th, 2008, 5:55 am

Re: Deceptively tricky trigger

Post by chunkamongus »

Current trigger is:
Events- Unit owned by player 1, player 2, player 3.... finishes construction
Action- Remove random unit from unit group within proximity of 125

The catch is the constructed structure is the triggering unit
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Deceptively tricky trigger

Post by Kryptonyte »

Code: Select all

Unit - Remove (Constructed structure) from the game
Will remove the structure...

Code: Select all

Unit - Remove (Triggering unit) from the game
Will remove the unit that builds the structure...

BTW, instead of this...

"Events- Unit owned by player 1, player 2, player 3.... finishes construction"

Use "Generic unit event" and then add a condition for which players it is.

Code: Select all

Conditions - (Owner of (Triggering unit)) Equal to Player 1 (Red)
And so on... or if they are in a group...

Code: Select all

(Owner of (Triggering unit)) Equal to (Random player from (Player_Group))
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
chunkamongus
Junior Member
Posts: 31
Joined: November 14th, 2008, 5:55 am

Re: Deceptively tricky trigger

Post by chunkamongus »

Once again, when i put triggering unit it takes away the structure. Which is why this trigger is deceptively tricky
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Deceptively tricky trigger

Post by Kryptonyte »

That's gay of WC3... anyways, here it is.

Variables needed: "Worker" (Unit), "Structure_Count" (Unit Group)
*Array them if using this trigger for more than one player.

Triggers needed:
(For ONE player)
Spoiler:

Code: Select all

Event
Time - Elapsed game time is 1.00 seconds

Actions
Set Worker = Builder 0001 <gen>

Code: Select all

Event
Unit - A unit owned by Player 1 (Red) Finishes construction

Actions
Unit Group - Add (Triggering unit) to Structure_Count

Code: Select all

Event
Time - Every 0.10 seconds of game time

Actions
Unit - Remove Worker from the game
Set Worker = No unit
Trigger - Turn off (This trigger)
For more than one player (Example shows four players)
Spoiler:

Code: Select all

Event
Time - Elapsed game time is 1.00 seconds

Actions
Set Worker[1] = Builder 0001 <gen>
Set Worker[2] = Builder 0002 <gen>
Set Worker[3] = Builder 0003 <gen>
Set Worker[4] = Builder 0004 <gen>

Code: Select all

Event
Unit - A unit Finishes construction

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Owner of (Triggering unit)) Equal to Player 1 (Red)
    Then - Actions
        Trigger - Turn on Disable <gen>
        Unit Group - Add (Triggering unit) to Structure_Count[1]
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    Then - Actions
        Unit Group - Add (Triggering unit) to Structure_Count[2]
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Owner of (Triggering unit)) Equal to Player 3 (Teal)
    Then - Actions
        Unit Group - Add (Triggering unit) to Structure_Count[3]
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    Then - Actions
        Unit Group - Add (Triggering unit) to Structure_Count[4]
    Else - Actions

Code: Select all

Event
Time - Every 0.10 seconds of game time

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Number of units in Structure_Count[1]) Equal to 1
    Then - Actions
        Unit - Remove Worker[1] from the game
        Set Worker[1] = No unit
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Number of units in Structure_Count[2]) Equal to 1
    Then - Actions
        Unit - Remove Worker[2] from the game
        Set Worker[2] = No unit
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Number of units in Structure_Count[3]) Equal to 1
    Then - Actions
        Unit - Remove Worker[3] from the game
        Set Worker[3] = No unit
    Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Number of units in Structure_Count[4]) Equal to 1
    Then - Actions
        Unit - Remove Worker[4] from the game
        Set Worker[4] = No unit
    Else - Actions

Event
Time - Every 2.00 seconds of game time

Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        Worker[1] Equal to No unit
        Worker[2] Equal to No unit
        Worker[3] Equal to No unit
        Worker[4] Equal to No unit
    Then - Actions
        Trigger - Turn off Trigger <gen>
        Trigger - Turn off (This trigger)
    Else - Actions
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
chunkamongus
Junior Member
Posts: 31
Joined: November 14th, 2008, 5:55 am

Re: Deceptively tricky trigger

Post by chunkamongus »

You sure that won't cause a memory leak?
User avatar
Kryptonyte
Forum Staff
Posts: 1400
Joined: March 17th, 2008, 12:07 am

Re: Deceptively tricky trigger

Post by Kryptonyte »

chunkamongus wrote:You sure that won't cause a memory leak?
...You could just not use ANY triggers in your map, and you won't ever leak.
Image
Made by the late ILikeHacking

My quote from SKillER
Spoiler:
Chat wrote:(19:12:41) SKillER: newfags cant triforce
(19:20:30) SKillER: ▲
▲ ▲
(19:20:35) SKillER: aww
(19:20:37) FatherSpace: FAIL
(19:20:43) Kryptonyte: Wow stop failing.
(19:20:47) SKillER: ▲
▲ ▲
(19:21:41) Kryptonyte: .

. ▲
▲ ▲
(19:22:20) Kryptonyte: I guess you were right, newfags can't triforce.
(19:22:29) SKillER: . . ▲
▲ ▲
(19:23:04) SKillER: OMFG
(19:23:06) SKillER: ... THIS CHAT
(19:23:06) SKillER: !
(19:23:36) SKillER: ▲
▲ ▲
(19:23:46) SKillER: ▲
.▲ ▲
Apparently, SKillER is a newfag.
chunkamongus
Junior Member
Posts: 31
Joined: November 14th, 2008, 5:55 am

Re: Deceptively tricky trigger

Post by chunkamongus »

huh?