HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trigger crashes game - (Playing with order/ordered unit)

10-26-2006, 10:01 AM#1
Fulla
Ok basically I want if :

A unit is ordered to attack, then order target unit of oattack roder to attack ordered unit.

Also change ownership whilst they are fighting depending on which player.

Trigger:
Combat
Collapse Events
Unit - A unit Is issued an order targeting an object
Collapse Conditions
(Issued order) Equal to (Order(attack))
Collapse Actions
Countdown Timer - Pause Timer
Unit - Order (Target unit of issued order) to Attack (Ordered unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Owner of (Ordered unit)) Equal to Player 1 (Red)
Collapse Then - Actions
Unit - Change ownership of (Ordered unit) to Neutral Victim and Change color
Collapse Else - Actions
Unit - Change ownership of (Ordered unit) to Neutral Extra and Change color
10-26-2006, 10:03 AM#2
Captain Griffen
I couldn't possibly know how a trigger ordering a unit on an order even could possibly infinitely loop.

[/sarcasm]

Yea, it infinite loops.
10-26-2006, 10:03 AM#3
The)TideHunter(
It crashs because, imagine a unit is ordered to attack, then that instantly strikes off a unit to attack again because of:

Trigger:
Unit - Order (Target unit of issued order) to Attack (Ordered unit)

But, because of that, that instantly starts the trigger off again, which keeps going on and on and on until op limit and crash.

EDIT: Damn you griff!
10-26-2006, 10:05 AM#4
Jazradel
Turn the trigger off at the start and then turn it on at the end.
10-26-2006, 10:07 AM#5
The)TideHunter(
Quote:
Originally Posted by Jazradel
Turn the trigger off at the start and then turn it on at the end.

Success!
I wouldent have thought of that, i never handle triggers anymore..
10-26-2006, 12:25 PM#6
Rising_Dusk
Quote:
Success!
I wouldent have thought of that, i never handle triggers anymore..
I guess you don't trigger anything anymore then either.