Even more complex character descriptions!

JenniferKline
06 Jul 2017, 18:42

Heya all,

Right, I've got a bit of stuff where I'm not sure what's going wrong. Quick Rundown:

player.tattooed is currently the placeholder for if the player has any scars or not. Boolean that starts false.
player.tattoos is the attribute that tells what the player is scarred (in this case) with.

In game, I have a Test verb that will tell me the status of these attributes.

For the sake of testing, I made a drink that applies:
player.tattooed = True
player.tattoos= Goblin
Test function returns that these two come out fine. {player.tattooed} returns true and {player.tattoos} returns Goblin.

So, I'm pretty sure that all works fine. Now the bit I'm having issues with.

body covered in {player.skincolour} skin {if player.tattooed=True:{player.tattoos=Goblin: marked all over with {player.plevel=A:horrific}{player.plevel=B:awful}{player.plevel=C:unsightly}{player.plevel=D:glossy}{player.plevel=E:faint} scars. {player.plevel=A:You itch for some way to remove the horrible marks, and the memories that come with them.}{player.plevel=B:You hope there’s some way to remove the marks.}{player.plevel=C:While you wonder if there’s some way of getting rid of the marks, you can’t deny there’s a little… Toughness to the whole thing.}{player.plevel=D:There’s something neat about having your ‘scoreboard’ spread across you like that, marks of survival.}{player.plevel=E:You wear the scars with pride, every one a badge of honour that comes with memories vivid enough to have you grinning. The one {Random:over your eye:across your cheek:down your lip:over your forhead:down your arm:across your belly} is currently your favourite.}}}

Not a finished product but an interesting test. I'm pretty sure all the brackets are correct, and that I've used things correctly, but when it comes to print:

body covered in X skin

I'm guessing I've done something wrong with the if function at the start, if this is compatible with the current version of Quest?

Bonus Question Something I've been struggling on a little while now.

I know for commands there is a way to make it so more than one word can be used to activate them. I'm trying to do the same with a get input thing.

I've tried various things, but I should probably just show my code.

if (result = ("e;east;East;E".";")) {
  msg ("You go east
  .")
}
else if (result = ("w;west;West;W".";")) {
}

Ideally it would make it so any of the inputs there would activate this Get Input. Then I just need to figure out how to make it loop if the answer is wrong. And put selectable options in text. So much work to be done x__X


hegemonkhan
06 Jul 2017, 20:46

for the 'player.tattoos = Goblin', are you using this as an Object Attribute where 'Goblin' is an actual Object in your game with its own Attributes, or are you using this as a String Attribute and 'Goblin' is just a text/string that you can then use to do whatever with (string match/check in 'if' Scripts or even get the Object of it via 'GetObject (NAME_OF_STRING_VALE)' Function) ???

if it's suppose to be a String Attribute, then you need the double quotes on 'Goblin', see here: player.tattoos = "Goblin", and if you created the Attribute through the GUI/Editor, make sure it's Attribute Type is set as a 'string' (as a String Attribute).

if it's suppose to be an Object (reference/pointer) Attribute, then it's fine as is (as Object reference/pointer Values do NOT have the double quotes)

as for your description string... this is really complicated stuff to do with the text processor commands... you might want to use normal scripting instead as it'll be far less complicated getting it correct and working...

but let me try... with using the text processor commands (will be a good challenge even for me, and one I might fail at too, lol)...


I'm going to assume your 'player.tattoos = goblin' is a String Attribute for this: player.tattoos = "Goblin", but if it's an Object Attribute, let me know and I'll see if it'd require any adjusting for the desccription string below

also, make sure all of your spellings are correct/matching, for example did you use 'colour' everywhere, or did you use 'colour' and 'color', which wouldn't be matching up. Or example: 'tattooed' vs accidentally doing: 'tattood'

// this is how I did it, to make it easier on me:
// (and hopefully, it works, lol)

msg
("
  body covered in
  {
    player.skincolour
  }
  skin,
  {
    if player.tattooed:
    {
      if player.tattoos=Goblin: marked all over with
      {
        if player.plevel=A:horrifc
      }
      {
        if player.plevel=B:awful
      }
      {
        if player.plevel=C:unsightly
      }
      {
        if player.plevel=D:glossy
      }
      {
        if player.plevel=E:faint
      }
      scars.
      {
        if player.plevel=A:You itch for some way to remove the horrible marks, and the memories that come with them.
      }
      {
        if player.plevel=B:You hope there’s some way to remove the marks.
      }
      {
        if player.plevel=C:While you wonder if there’s some way of getting rid of the marks, you can’t deny there’s a little… Toughness to the whole thing.
      }
      {
        if player.plevel=D:There’s something neat about having your ‘scoreboard’ spread across you like that, marks of survival.
      }
      {
        if player.plevel=E:You wear the scars with pride, every one a badge of honour that comes with memories vivid enough to have you grinning.
      }
      The one
      {
        Random:over your eye:across your cheek:down your lip:over your forhead:down your arm:across your belly
      }
      is currently your favourite.
    }
  }
")

// then, I put it back into a block/paragraph (making sure I get the correct/desired spacing for when it reads/displays during game play):

msg ("body covered in {player.skincolour} skin, {if player.tattooed:{if player.tattoos=Goblin:marked all over with {if player.plevel=A:horrifc}{if player.plevel=B:awful}{if player.plevel=C:unsightly}{if player.plevel=D:glossy}{if player.plevel=E:faint} scars. {if player.plevel=A:You itch for some way to remove the horrible marks, and the memories that come with them.}{if player.plevel=B:You hope there’s some way to remove the marks.}{if player.plevel=C:While you wonder if there’s some way of getting rid of the marks, you can’t deny there’s a little… Toughness to the whole thing.}{if player.plevel=D:There’s something neat about having your ‘scoreboard’ spread across you like that, marks of survival.}{if player.plevel=E:You wear the scars with pride, every one a badge of honour that comes with memories vivid enough to have you grinning.} The one {Random:over your eye:across your cheek:down your lip:over your forhead:down your arm:across your belly} is currently your favourite.}}")

ask if you need help with anything, and/or let me know if it doesn't work.


hegemonkhan
06 Jul 2017, 20:59

as for your second/bonus question:

get input {
  if (LCase (result) = "e" or LCase (result) = "east") { // if you had lots of options, then it'd be better to have them as items in a List/Dictionary Attribute and use iteration (foreach) on them, but this is a bit more complex stuff (using Lists/Dictionaries)
    msg ("You go east.")
  } else if (LCase (result) = "w" or LCase (result) = "west") {
    msg ("You go west.")
  } else if (LCase (result) = "n" or LCase (result) = "north") {
    msg ("You go north.")
  } else if (LCase (result) = "s" or LCase (result) = "south") {
    msg ("You go south.")
  }
}

http://docs.textadventures.co.uk/quest/functions/string/lcase.html

the 'LCase' Function takes whatever your String Value is (whatever pattern of upper/lower/upper+lower cases it is), and makes every letter (alphabet) character of it, be lower case. And then we care that full lower case value to another full lower case value if (LCase ("EAST") [ ----->  if ("east")] = "east") -----> if ("east" = "east")


alternatively, you could do this (but it's just better to work with lower case, so don't do this, lol):

get input {
  if (UCase (result) = "E" or UCase (result) = "EAST") {
    msg ("You go east.")
  } else if (UCase (result) = "W" or UCase (result) = "WEST") {
    msg ("You go west.")
  } else if (UCase (result) = "N" or UCase (result) = "NORTH") {
    msg ("You go north.")
  } else if (UCase (result) = "S" or UCase (result) = "SOUTH") {
    msg ("You go south.")
  }
}

The Pixie
06 Jul 2017, 21:27

You have missed a load of ifs. You have:

body covered in {player.skincolour} skin {if player.tattooed=True:{player.tattoos=Goblin: marked all over with {player.plevel=A:horrific}{player.plevel=B:awful}

Should be

body covered in {player.skincolour} skin {if player.tattooed=True:{if player.tattoos=Goblin: marked all over with {if player.plevel=A:horrific}{if player.plevel=B:awful}

Personally, I would just have one attribute. If the goblin has none, set it to null (which is the same as no attribute). Then you can just do:

body covered in {player.skincolour} skin {if player.tattoos=Goblin: marked all over with {if player.plevel=A:horrific}{if player.plevel=B:awful}

For the bonus question, see here:
http://docs.textadventures.co.uk/quest/asking_a_question.html


DarkLizerd
07 Jul 2017, 02:50

...{player.tattoos=Goblin: marked all over with {player.plevel=A:horrific}{player.plevel=B:awful}{player.plevel=C:unsightly}{player.plevel=D:glossy}{player.plevel=E:faint}
Or... If you change the player.plevel from A to E to the text value...
or ...
PL=Split("horrific, awful, unsightly, glossy, faint}", ",")
then...
change A - E to 0 - 4
so that...
scars=StringListItem(PL, player.plevel)
... marked all over with {scars} scars...