KaidenSmith 1 Posted November 18, 2019 Is it possible to return the name of the case in which a script is in? Example: _location = getMarkerPos; _name = ?; switch (_location) do { case "Name" {player setPos getMarkerPos _name}; }; Where the _name variable is supposed to come out as "Name". Share this post Link to post Share on other sites
pierremgi 4905 Posted November 18, 2019 Could you clarify? Do you have a marker? so, just use the string as name. Do you want to know a position of a location (city, village on map) so use locationPosition, or what else? Share this post Link to post Share on other sites
KaidenSmith 1 Posted November 18, 2019 9 minutes ago, pierremgi said: Could you clarify? Do you have a marker? so, just use the string as name. Do you want to know a position of a location (city, village on map) so use locationPosition, or what else? Just simply instead of writing getMarkerPos "Name" than doing getMarkerPos _markerName which would then return the name of the case, which in this case would be "Name". Share this post Link to post Share on other sites
Dedmen 2716 Posted November 20, 2019 No. But you could maybe make a macro? Share this post Link to post Share on other sites
Larrow 2822 Posted November 20, 2019 On 11/18/2019 at 4:53 PM, KaidenSmith said: Where the _name variable is supposed to come out as "Name". Well surely _location, or whatever the string being compared in the switch statement, is the case name "Name" or what ever the corresponding match is. _location = "Name"; _name = switch (_location) do { case "Name" { player setPos getMarkerPos _location; _location }; }; if ( !isNil "_name" && { _name != "" } ) then { hint format[ "Marker '%1' was choosen", _name ]; }; 1 1 Share this post Link to post Share on other sites
KaidenSmith 1 Posted November 20, 2019 34 minutes ago, Larrow said: Well surely _location, or whatever the string being compared in the switch statement, is the case name "Name" or what ever the corresponding match is. _location = "Name"; _name = switch (_location) do { case "Name" { player setPos getMarkerPos _location; _location }; }; if ( !isNil "_name" && { _name != "" } ) then { hint format[ "Marker '%1' was choosen", _name ]; }; Feel like a complete moron when you explain it like that 🤦♂️ Share this post Link to post Share on other sites