Warcraft III resources & community, 2003–2006 · archived

Variable setting JASS(Help!!!!)

4 posts
#1

Variable setting JASS(Help!!!!)

I tried to set a variable in JASS that I couldn't normally, and I ended up with an error. Here is the 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.
#2
There is error outside this code.
#3
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).
#4
How would I go about doing this? (Sorry, pretty new to WE)