• 🏆 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!

[JASS] Variable setting JASS(Help!!!!)

Status
Not open for further replies.
Level 3
Joined
May 23, 2005
Messages
19
I tried to set a variable in JASS that I couldn't normally, and I ended up with an error. Here is the code:
Code:
function Trig_set_admin_Actions takes nothing returns nothing
    set udg_Admin = "Eternal_Dread"
endfunction

//===========================================================================
function InitTrig_set_admin takes nothing returns nothing
    set gg_trg_set_admin = CreateTrigger(  )
    call TriggerAddAction( gg_trg_set_admin, function Trig_set_admin_Actions )
endfunction
Now here is the error:
Line 3623: Type mismatch in assignment
Every time I try to save it, it gives me this error, and shows this code. Help?
Also, the variable type is a player.
 
Level 6
Joined
Feb 18, 2005
Messages
263
i would asume, that the variable udg_admin you ahve is not a string type. Therefore you want to asign a string value to a non-string variable which always courses an error

-> everytime you try to set a variable of a type to a value of another type, you have to convert it first.
You may either do this by using the predefined functions, or by writing your own ones (using the return bug).
 
Status
Not open for further replies.
Top