String Functions Question — upper, lower, title_case, and first_cap

I’m a newbie to Adventuron, so apologies if my query is something I should be able to deduce on my own — though I’ve scoured the documentation and these forums and haven’t been able to solve my issue.

In the game I’m writing, I ask the player for their name (an ask_string) during on_startup. I then want to identify the player by their reply later, which is easy to do. But, I want to format their reply with title_case and that doesn’t seem to be working.

At current, I’ve written an on_pre_describe element that assigns a new set_string before loading the first location with this new string being set as the formatted version of their ask_string input. It looks something like this:
on_pre_describe {
: if (is_at “room_one”) {
: set_string var=“formatted_string_output” {( title_case("{asked_string_answer}") )};
}
}

The editor won’t let me proceed as it doesn’t accept title_case as valid, which it also does when I try first_cap instead. I can use upper and lower functions, but they don’t seem to work properly — upper blanks the input and lower passes it thru unformatted.

If someone could please give me guidance as to what I’m doing wrong, it would be greatly appreciated!

Hi,

Thanks for your post.

I think this is my fault. The current version of Adventruon (adventuron.io/classroom) is a stability version of Adventuron, and hasn’t been updated for about 2 or 3 months now.

I think I accidentally updated the documentation based on the beta version (which added title_case).

If you are coding something new, then the beta is probably better to use right now.

adventuron.io/beta

I tested this as working at the beta url:

start_at = my_location

locations {
   my_location : location "You are in a room." ;
}
strings {
   name : string "" ;
}
on_startup {
   : ask_string question = "What is your name?"  var = "name" ;
   : print {(
      "Title Case Name = " +  title_case (name) + "\n" +
      "First Cap Name = " +   first_cap (name)  + "\n" +
      "Lower Case Name = " +  lower (name)      + "\n" +
      "Upper Case Name = " +  upper (name) 
   )}
   : press_any_key ;
}

The title_case() function was previously called camel(), so if the former doesn’t work, try the latter. However, be prepared to do a search and replace when the main classroom web site gets updated.

Thanks, Chris & Garry! It indeed does work as expected in the beta version. Glad I asked. Thanks again!