Page 1 of 1

Transfer data backwards?

Posted: Wed Jun 25, 2003 4:27 am
by Alcoholic
ok you've got a variable local.playerheals. lets say its set to 5. its transferred to another thread, and that thread gives it another alias, and that alias is subtracted by 1. my Q is, will local.playerheals from the first thread be correctly changed?

heres an example:

Code: Select all

main:
local.playerheals = 5
thread changehealnumber local.playerheals
end

changehealnumber local.num:

local.num--
end
so will local.playerheals be subtracted by 1?

Posted: Wed Jun 25, 2003 7:25 am
by jv_map
No. Both are seperate variables which by coincidence initially have the same value :)

Posted: Wed Jun 25, 2003 9:12 am
by Parts
your best bet to do this is to return the value in your thread, hence updating your originial variable:

Code: Select all

main: 
local.playerheals = 5 
local.playerheals = waitthread changehealnumber local.playerheals 
end 

changehealnumber local.num: 

local.num-- 
end local.num
Code changed: good point JV !

Posted: Wed Jun 25, 2003 9:19 am
by jv_map
Use waitthread though :wink:

Posted: Thu Jun 26, 2003 4:43 pm
by Alcoholic
so typing "end local.num" returns the value backwards?

Posted: Thu Jun 26, 2003 5:32 pm
by jv_map
Yeah if you want to put it like that that is 8)