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

Status
Not open for further replies.
Level 1
Joined
Aug 30, 2004
Messages
3
This may b a little noobish question but i've been looking on the different JASS'es available for download in here. And stumbled upon one but it didn't work when importing it to the world editor. I quickly found out that of course it needs to be modified which units it should be used on and which player and such. But when it said "null" i didn't know what to do. Can any1 give me an example plz :oops:
 
Level 3
Joined
Mar 27, 2004
Messages
70
Dude your avatar is HUGE! I can hardly read you post.

null means "nothing", and you probably shouldn't replace it.

It would really help if you told us what code you are trying to use.
 
Level 1
Joined
Aug 30, 2004
Messages
3
ok got the avatar problem fixed. And it is an arrow movement JASS. Would like to make the hero go up and down when i press the up and down buttons, and turn left and right when pressing the left and right buttons.
 
Level 3
Joined
Mar 27, 2004
Messages
70
Are you using the MapArrowKeysToUnit function? If so, you need to add this stuff to the top of your map header.
JASS:
function Handle2Trigger takes handle h returns trigger
    return h
    return null
endfunction
function Handle2Player takes handle h returns player
    return h
    return null
endfunction
function HandleToInt takes handle h returns integer
    return h
    return 0
endfunction
function IntToHandle takes integer i returns handle
    return i
    return null
endfunction

function LocalVars takes nothing returns gamecache
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, HandleToInt(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(HandleToInt(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(HandleToInt(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(HandleToInt(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(HandleToInt(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(), I2S(HandleToInt(subject)), name)
    else
        call StoreBoolean(LocalVars(), I2S(HandleToInt(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(HandleToInt(subject)), name)
endfunction
function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(HandleToInt(subject)), name)
    return null
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(HandleToInt(subject)), name)
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(HandleToInt(subject)) )
endfunction
Don't mess with the functions themselves, just call MapArrowKeysToUnit with the right parameters.
 
Status
Not open for further replies.
Top