| 08-09-2008, 09:01 AM | #1 |
I just want to report it. JASS:scope TestLameBug initializer init function UselessFilter takes nothing returns boolean call BJDebugMsg("fail") call BJDebugMsg("GetIssuedOrderId() == "+I2S(GetIssuedOrderId())) return false // what else ? :p endfunction public function init takes nothing returns nothing local trigger trig= CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_ORDER,Condition(function UselessFilter)) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,Condition(function UselessFilter)) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,Condition(function UselessFilter)) call CreateUnit(Player(0),'hpea',0.0,0.0,0.0) endfunction endscope |
| 08-09-2008, 10:03 AM | #2 |
Does it also return 0 if used as an actual condition with TriggerAddCondition, or as a filter in a GroupEnum? I'm asking because those are what we usualy use, not conditions added to the event like that. Have you confirmed that other event responses work in such a condition at all? |
| 08-09-2008, 10:38 AM | #3 | |
Quote:
I only tried with the filter event. I assumed it works for a condition and a group enum. It works : JASS:scope TestCondition initializer init function Check takes nothing returns boolean call BJDebugMsg("GetIssuedOrderId() == "+I2S(GetIssuedOrderId())) return false endfunction public function init takes nothing returns nothing local trigger trig= CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_ORDER,null) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null) call TriggerAddCondition(trig,Condition(function Check)) call CreateUnit(Player(0),'hpea',0.0,0.0,0.0) endfunction endscope It works also for a GroupEnum. JASS:scope TestCondition initializer init function Check takes nothing returns boolean call BJDebugMsg("GetIssuedOrderId() == "+I2S(GetIssuedOrderId())) return false endfunction function Test takes nothing returns boolean local group g= CreateGroup() call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,Condition(function Check)) call DestroyGroup(g) // yeah i know i should create only once at the init, doesn't matter set g= null return false endfunction public function init takes nothing returns nothing local trigger trig= CreateTrigger() call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_ORDER,null) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null) call TriggerRegisterPlayerUnitEvent(trig,Player(0),EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null) call TriggerAddCondition(trig,Condition(function Test)) call CreateUnit(Player(0),'hpea',0.0,0.0,0.0) endfunction endscope And you are right, i can't read any Get as far i tested. I know why blizzard don't use them now :p |
| 08-09-2008, 10:40 AM | #4 |
Interestingly, if you pause the unit, then the event responses stop working. |
| 08-09-2008, 10:42 AM | #5 | |
Quote:
|
| 08-09-2008, 10:53 AM | #6 | |
Quote:
Condition; I think I also tested it with action. Didn't test with an enum. Note the deviation from general Blizzard naming conventions. This implies that it was by different programmers, I think, and they balls it up. |
| 08-09-2008, 11:00 AM | #7 |
So it seems to using the conditions like they are not supposed to use is really unsafe, or at least there are many traps to know. |
| 08-09-2008, 11:04 AM | #8 |
Check any other event related returns, like GetTriggerUnit() |
| 08-09-2008, 11:06 AM | #9 | ||
Quote:
Quote:
|
| 08-09-2008, 11:24 AM | #10 | |
Quote:
No. It doesn't. Using boolexprs on unit events is borked, we know that. Blizzard probably meant to implement it, and then didn't do it properly (hence why GUI makes no use of it?). Nothing here indicates conditions, as opposed to unit event filters, are broken. What I reported with GetOrder stuff being broken after a pause also applies to actions - it's a bug with WC3 not storing the stuff in the stack properly, but probably storing a pointer to the unit or something. |
| 09-06-2008, 08:15 PM | #11 |
Just to say that GetFilterUnit() returns the TriggerUnit. GetUnitCurrentOrder() works as well. |
