Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Slasher on Thu 06/09/2018 19:18:14

Title: Lable Sting Format problem
Post by: Slasher on Thu 06/09/2018 19:18:14
Using this I am getting the comma, after the closing".


Code (ags) Select

  LSirens.Text=(String.Format("%s,%s,%s,%s",
  "It is said that Hera, queen of the gods, persuaded the Sirens to enter a singing contest with the Muses.",
  "[[The Muses won and the Sirens were banished into the sea at Ghoul as sea nymphs.",
  "[[The Sirens took revenge by luring sailors onto sharp rocks by their beautiful voices where they proceeded to devour them.",
  "[[The only way to overcome the Sirens when they are wailing is to play a beautiful song which will cause the Sirens to die."));
 
Title: Re: Lable Sting Format problem
Post by: dayowlron on Thu 06/09/2018 21:45:25
change the string format to "%s%s%s%s" and try it otherwise there will be a comma after every sentence. Is that what you want?
Title: Re: Lable Sting Format problem
Post by: dayowlron on Thu 06/09/2018 21:49:55
You could also change it to:

  LSirens.Text=(String.Format("%s[[%s[[%s[[%s",
  "It is said that Hera, queen of the gods, persuaded the Sirens to enter a singing contest with the Muses.",
  "The Muses won and the Sirens were banished into the sea at Ghoul as sea nymphs.",
  "The Sirens took revenge by luring sailors onto sharp rocks by their beautiful voices where they proceeded to devour them.",
  "The only way to overcome the Sirens when they are wailing is to play a beautiful song which will cause the Sirens to die."));
Title: Re: Lable Sting Format problem
Post by: Slasher on Thu 06/09/2018 23:04:41
Hi,

I can't believe i added an , between strings %s... What a plonker :-[

cheers
Title: Re: Lable Sting Format problem
Post by: dayowlron on Thu 06/09/2018 23:44:50
Just takes a second eye to look at it sometimes.