HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Compile Problem

04-08-2006, 06:09 AM#1
mmx2000
I don't understand why I'm getting this error in my Actions function for a trigger set off by Unit Starts the Effects of An Ability:

Type-mismatch / Cannot convert player to unit
Collapse JASS:
function Trig_Equator_Shot_Actions takes nothing returns nothing
    //misc other variable declarations here
    local unit CastingUnit = GetSpellAbilityUnit()
    local unit CastingPlayer = GetOwningPlayer(CastingUnit)
    local unit TargetUnit = GetSpellTargetUnit()
    //trigger continues...
Gives me the error on the line:
Collapse JASS:
    local unit TargetUnit = GetSpellTargetUnit()

Im thinking maybe it has something to do with the line before it, but I denno...
EDIT: and/or something to do with the fact the Get...functions are constant natives?
04-08-2006, 08:29 AM#2
blu_da_noob
You are defining CastingPlayer as a unit by mistake. Should be:

Collapse JASS:
    local player CastingPlayer = GetOwningPlayer(CastingUnit)
04-08-2006, 08:31 AM#3
RodOfNOD
Quote:
Originally Posted by mmx2000
I don't understand why I'm getting this error in my Actions function for a trigger set off by Unit Starts the Effects of An Ability:

Type-mismatch / Cannot convert player to unit
Collapse JASS:
function Trig_Equator_Shot_Actions takes nothing returns nothing
    //misc other variable declarations here
    local unit CastingUnit = GetSpellAbilityUnit()
    local unit CastingPlayer = GetOwningPlayer(CastingUnit)
    local unit TargetUnit = GetSpellTargetUnit()
    //trigger continues...
Gives me the error on the line:
Collapse JASS:
    local unit TargetUnit = GetSpellTargetUnit()

Im thinking maybe it has something to do with the line before it, but I denno...
EDIT: and/or something to do with the fact the Get...functions are constant natives?


Ah yes fun with compiling... You are correct your error is the line above-- you have CastingPlayer set to a unit not an player variable type....


GL HF
04-08-2006, 03:26 PM#4
mmx2000
Jesus what an obvious mistake.
Heh, thanks for pointing it out, serves me right for staring at code for a game for the last 5 hours XD