{"name":"setFSMVariable","title":"setFSMVariable","type":"command","url":"https://community.bistudio.com/wiki/setFSMVariable","revid":330070,"updated":"2022-08-15T16:49:43Z","groups":["System"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","description":"Set variable to given value in the variable space of given FSM.\nThe FSM handle is the number returned by the execFSM command.","syntaxes":[{"syntax":"handle setFSMVariable [name, value]","params":[{"name":"handle","type":"Number","description":"FSM handle","type_expr":"Number"},{"name":"name","type":"String","description":"name of the FSM variable","type_expr":"String"},{"name":"value","type":"Anything","description":"new value of the FSM variable","type_expr":"Anything"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"handle"},"right":{"text":"[name, value]"}}],"examples":[{"code":["_handle = execFSM \"test.fsm\";\n_handle setFSMVariable [\"_foo\", 23]; // sets variable _foo in the FSM to 23"]}],"see_also":["FSM","commandFSM","completedFSM","doFSM","execFSM","getFSMVariable"],"notes":[{"user":"Master85","date":"2014-03-23T00:53:00Z","text":"If the variable is not yet defined within the FSM it will be created."}]}