• 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] 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