{"name":"setName","operator":null,"title":"setName","type":"command","url":"https://community.bistudio.com/wiki/setName","revid":370891,"updated":"2025-02-21T10:44:05Z","groups":["Unit Identity","Locations"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.08"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.08"},"arma3_since":"0.50","branch":null,"locality":{"argument":"global","effect":"local","server_exec":false},"exec":null,"description":"Sets the name of a location or a person (person only in single player).","syntaxes":[{"syntax":"thing setName name","since":null,"effect":null,"exec":null,"params":[{"name":"thing","type":"Location or Arma 3 v1.02 Object","optional":false,"default":null,"description":null,"types":["Location","Object"],"since":null,"text":"thing: Location or Arma 3 v1.02 Object"},{"name":"name","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"name: String"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"thing","types":["Location","Object"]},"right":{"text":"name","types":["String"]}},{"syntax":"unit setName [name, firstName, lastName]","since":"arma3 1.02","effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"},{"name":"name","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"name: String"},{"name":"firstName","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"firstName: String"},{"name":"lastName","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"lastName: String"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object"]},"right":{"text":"[name, firstName, lastName]","types":["Array"]}}],"examples":[{"text":"```sqf\nmyLocation setName \"My Location Name\";\n```","code":["myLocation setName \"My Location Name\";"]},{"text":"```sqf\nplayer setName \"New Name\";\n```","code":["player setName \"New Name\";"]},{"text":"```sqf\nplayer setName [\"Ben Kerry\",\"Ben\",\"Kerry\"];\n```","code":["player setName [\"Ben Kerry\",\"Ben\",\"Kerry\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["name","nameSound","setNameSound","setIdentity"],"notes":[{"user":"Pierre MGI","date":"2014-08-18T22:15:00Z","text":"Only last name will appear in command bar i.e. `this setName _myNameArray` will display `_myNameArray select 2`.\nIf setName is used with a string e.g `this setName \"blah\"`, nothing occurs in the command bar and the default randomized name is displayed.\n\nDealing with the units' names in a script, _x (in a `forEach units _group`, for example) will return the \"object\" as `B ALFA 4-1:2` or the name written in ai unit name field in editor (if exists).\nThis context is rather a \"variable name\" for each object (ai) than an \"identity name\" as given via the setName command."}],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Locations","Command Group: Unit Identity","Introduced with Armed Assault version 1.08","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}