• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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