• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] "Error on Compare Variable on different primatives"

Status
Not open for further replies.
Level 5
Joined
Jan 4, 2009
Messages
118
JASS:
function Trig_Check_Integer_Actions takes nothing returns nothing
    local integer Int_Kill = 0
    
    set udg_ScoreKills[Int_Kill] = udg_ScoreKills[Int_Kill] + 1
    call BJDebugMsg("CHAT : "+I2S(udg_ScoreKills[Int_Kill]))
    if(udg_ScoreKills[Int_Kill] == 3)then
        call BJDebugMsg("CHAT COMPLETE")
    endif
endfunction

//===========================================================================
function InitTrig_Check_Integer takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterPlayerChatEvent( t, Player(0), "", false )
    call TriggerAddAction( t, function Trig_Check_Integer_Actions )
    set t = null
endfunction

It's code upper. It's display error "Comparing two variables of different primatives types (except real and integer) is not allow",but the map can still run and save.

In this case is normally same when I uses global variable?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Are you sure the problem is in this trigger?

udg_ScoreKills is a REAL or an INTEGER variable?

I can't see anything wrong with this.
 
Status
Not open for further replies.
Top