Transfer data backwards?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Transfer data backwards?

Post 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?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

No. Both are seperate variables which by coincidence initially have the same value :)
Image
Parts
Sergeant
Posts: 72
Joined: Thu Apr 10, 2003 12:35 pm
Location: UK
Contact:

Post 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 !
Last edited by Parts on Wed Jun 25, 2003 9:23 am, edited 1 time in total.
[VS-UK]Capt.Parts[BnHQ]
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Use waitthread though :wink:
Image
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

so typing "end local.num" returns the value backwards?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yeah if you want to put it like that that is 8)
Image
Post Reply