HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bad Types for binary operator, what is this?

02-11-2009, 10:18 AM#1
Flame_Phoenix
Hi guys, I am converting a monster GUI code into an efficient code (seems hard =P) and when I was converting I had this weird binary error in the lines where I declare "x" and "y". Why do I have it?

Collapse JASS:
local unit caster = GetTriggerUnit()
        local player owner = GetOwningPlayer(caster)
        local location casterLoc = GetUnitLoc(caster)
        local real x
        local real y
        
        set bj_forLoopAIndex = 1
        set bj_forLoopAIndexEnd = ( RADIUS / FIRE_SIZE )
        loop
            exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
            //set udg_TempPoint2 = PolarProjectionBJ(casterLoc, I2R(RADIUS), ( I2R(bj_forLoopAIndex) * ( 360.00 / ( I2R(RADIUS) / FIRE_SIZE ) ) ))
            set x = casterLoc + RADIUS * Cos(bj_forLoopAIndex * ( 360.00 / ( I2R(RADIUS) / FIRE_SIZE ) ) * bj_DEGTORAD) 
            set y = casterLoc + RADIUS * Sin(bj_forLoopAIndex * ( 360.00 / ( I2R(RADIUS) / FIRE_SIZE ) ) * bj_DEGTORAD) 
            
            
            //set bj_lastCreatedUnit = CreateUnit(owner, FIRE_ID, GetLocationX(udg_TempPoint2), GetLocationY(udg_TempPoint2), casterLoc)
            call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF', GetRandomReal(8.00, 10.00))
            //call RemoveLocation(udg_TempPoint2)
            set bj_forLoopAIndex = bj_forLoopAIndex + 1
        endloop
02-11-2009, 10:27 AM#2
Tide-Arc Ephemera
Unless your Radius and Fire_Size things are integers, you can't have them for the LoopIndexEnd... as it's an integer.
02-11-2009, 11:04 AM#3
Flame_Phoenix
Quote:
Unless your Radius and Fire_Size things are integers, you can't have them for the LoopIndexEnd... as it's an integer.
Ahh, so everything must be an integer ?
They all are integers =S

Collapse JASS:
globals 
        private constant integer RADIUS = 400
        private constant integer FIRE_ID = 'h000'
        private constant integer FIRE_SIZE = 10
    endglobals
02-11-2009, 11:08 AM#4
Veev
Do you even know how to do anything for yourself.

x and y are real variables and you're using integers without typecasting them. Not only that, you're trying to add in a location to x and y. I mean, really? Come on. Take more than two looks at your code next time.
02-11-2009, 11:23 AM#5
Flame_Phoenix
Quote:
x and y are real variables and you're using integers without typecasting them. Not only that, you're trying to add in a location to x and y. I mean, really? Come on. Take more than two looks at your code next time.
My bad, I forgot "GetLocationX() and GetLocationY()" sry about that =S