HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

So simple.. but idk.

12-20-2006, 03:19 AM#1
Coreybowen999
Ok this is um wierd. Im tryin to get the ownership of a unit to change to brown when the owner of the unit types -quit. it dosent seem to work when i add the condition to it.

Heres what i have

Player 1 (red) types a chat message containing -quit as an exact match

Matching player) equal to (owner of circle of power 0044 )

Unit- Change ownership of Circle Of Power 0044 To Player 12 (brown) and change color

(red is the owner of the circle of power btw
12-20-2006, 03:23 AM#2
Xlightscreen
well just out of curousity why do you got Player 1 as the event then Matching player as the condition? If you got just player one on that event then only player one can type -quit maybe thats your problem not sure lol.
12-20-2006, 03:24 AM#3
Coreybowen999
well no lol i didnt wanna type all the other players on this threat my bad but in my Editer it has all the players in it
12-20-2006, 03:53 AM#4
wyrmlord
Change (Matching Player) to (Triggering Player), then it should work.
12-20-2006, 10:09 AM#5
xombie
What I'm wondering is why (Matching Player) did not work, since when converted to JASS it looks fine. GetFilterPlayer() is in the proper position in the condition, and is created since the condition is a <boolexpr>. The JASS would look like this:
Collapse JASS:
function Trig_Name_Conditions takes nothing returns boolean
    local player filter = GetFilterPlayer()
    local boolean ret = false
        if (filter == GetOwningPlayer(<unit>)) then
            set ret = true
        endif
    set filter = null
    return ret
endfunction
I modified what I would do a bit to make it a bit more clear, but wouldn't GetFilterPlayer() refer to the same player as GetTriggerPlayer()?

Consider this code:
Collapse JASS:
...
call ForceEnumPlayers( <force>, Condition(<code>) )
...
The condition would use a function "GetFilterUnit()" to refer to the picked player. In the code that would apply to THIS case:
Collapse JASS:
...
call TriggerAddCondition( <trigger>, Condition(<code>) )
...
Shouldn't it use the same GetFilterPlayer() that the other function uses? Xlightscreen caught something else though that Corey uses the event Player 1- and then runs a condition to make sure its Player 1... why??
12-20-2006, 10:49 AM#6
PipeDream
GetEnum*/GetFilter* are callbacks for enum loops, GetTrigger etc are callbacks for triggers. Two different contexts.
12-20-2006, 10:59 AM#7
xombie
Ah yes, I actually figured that out when I was like 7/8 done the post so I decided not to waste my hard efforts as somebody else could learn from them. But yea you are right.