Hiding/Showing Conversation Topics [Resolved]

Anonynn
14 Mar 2019, 08:18

Hello!

So I know how to show and hide verbs, example below...

REMOVING VERB
this.displayverbs = ListExclude (this.displayverbs, "verbhere")

ADDING VERB
list add (this.displayverbs, "Entice")

But I'm not sure how to hide multiple conversation topics and having them revealed one at a time at the end of a topic. Would anyone be able to help me with the proper coding for that?

Thank you so much in advance.

Anonynn.


The Pixie
14 Mar 2019, 08:49

Not sure I quite understand, and assuming this in ConvLib...

If you go to the Conversation tab, there are lists where you can set topics to show and hide after that topic has been used.

More in-depth, topics are handled very differently to verbs; they are objects in the game world. Where they appear in a list depends on their location (so they are associated with the right NPC) and their "show" and "hide" attributes. The ShowTopic and HideTopic functions will set these for you, so if you want to show or hide a topic other than when another topic is used, that is the way to go.


Anonynn
14 Mar 2019, 10:53

I don't have the newest ConvoLib. Would that be...

HideTopic ("Break the Silence")

for example?

Anonynn


The Pixie
14 Mar 2019, 18:16

You show be able to just drop in the latest version (but back up first!).


Anonynn
14 Mar 2019, 21:42

I just tried and it completely crashed the entire conversation tab lol. I don't think I can update it. I have v3.2 and I think the latest version is v5.0. I didn't know it was still getting updated! I guess I'll just have to do the HideTopic and such manually.

HideTopic ("Break the Silence")
ShowTopic ("Break the Silence")

^ is that how I might do it manually?

Anonynn.


Anonynn
15 Mar 2019, 09:15

Or would it be without the quotes?

HideTopic (Break the Silence)
ShowTopic (Break the Silence)

Hm..


The Pixie
15 Mar 2019, 09:56

It looks like there may be a problem with using the #dedede form of numbers, though I have no idea why it is an issue with the latest version of ConvLib and not the earlier. It also caused a problem with something else in your game. This could be a bug in the editor not liking the # character. Maybe.

You might want to look at changing them to named colours, I think it may be safer:
https://developer.mozilla.org/en-US/docs/Web/CSS/color_value


Anonynn
17 Mar 2019, 09:55

Yup. I've systematically changed all of the language algorithms to the new {lang:} and I've been switching all of the color codes as well from <font color:"#here"> to {color:} like you suggested. So both of those are completely finished in all the libraries and the main file. There were 7000 to change! @_@

Now I just need to change the libraries of the #dedede and then I can try to re-upload the new Convo-Lib. Last time though it deleted the entire conversation tab though (so I'll back up first and let you know what happens).

Anonynn.


Anonynn
26 Mar 2019, 16:13

So I replaced the files and updated ConvLib. I've also removed the dedede color codes. However I'm still getting an error with Hide and Show Topic.

Function not found "Hide Topic" and "Show Topic"

Any quick fix that?

Thank you for the help so far by the way!

Anonynn


The Pixie
26 Mar 2019, 18:00

There should be no spaces: "HideTopic" and "ShowTopic"


Anonynn
26 Mar 2019, 18:05

Yup, none of them have spaces in the actual game. That's why I am confused about the error.

Sorry about putting the spaces in here.

Anonynn.


Anonynn
27 Mar 2019, 05:02

Any other solutions x)


Anonynn
29 Mar 2019, 22:25

I guess I can try actually putting spaces and see if that will help...


jmnevil54
30 Mar 2019, 01:07

You can go back to using Show Menu.
I don't know.


Anonynn
30 Mar 2019, 01:09

Show Menu?


jmnevil54
30 Mar 2019, 04:13

It's just a suggestion, something that may be a replacement if you give up on the whole conversation library.

A ShowMenu looks like this.


options = Split("(100);(200)", ";")
ShowMenu ("Shop", options, true) {
  if (result = "(100)") {
    player. gold = playuer.gold + 100
  }
  if (result = "(200)") {
    player.gold = player.gold +200
  }
}

Or this.

msg ("See something that catches your eye?")
options = Split("Potion (100);Hyper Potion (200);Ammo (40);Ammo (80)", ";")
ShowMenu ("Shop", options, true) {
  switch (result) {
    case ("Potion (100)") {
      if (game.hard = true) {
        if (player.gold >= 100) {
          player.gold = player.gold - 100
          player.potion = player.potion + 1
          msg ("You bought a Potion.")
        }
        else {
          msg ("You don't have enough gold.")
        }
      }
      else {
        msg ("The person shakes his head. \"Sorry, I can't do that. We're all out.\"")
      }
    }
    case ("Hyper Potion (200)") {
      if (game.hard = true) {
        if (player.gold >= 200) {
          player.gold = player.gold - 200
          player.hyper_potion = player.hyper_potion + 1
          msg ("You bought a Hyper Potion.")
        }
        else {
          msg ("You don't have enough gold.")
        }
      }
      else {
        msg ("The person shakes his head. \"Sorry, I can't do that. We're all out.\"")
      }
    }
    case ("Ammo (40)") {
      if (player.gold >= 40) {
        player.gold = player.gold - 40
        player.ammo = player.ammo + 20
      }
      else {
        msg ("You don't have enough gold.")
      }
    }
    case ("Ammo (80)") {
      if (player.gold >= 80) {
        player.gold = player.gold - 80
        player.ammo = player.ammo + 40
      }
      else {
        msg ("You don't have enough gold.")
      }
    }
  }
}

You can also put show menus inside show menus. Hegemonkhan knows more about it then me. It confuses me.

I mean look at this code I copied from HK once (this looks worse when in the GUI, especially when you recreate the whole code by hand, as I did):

msg ("What is your name?")
get input {
  game.pov.alias = result
  msg (" - " + game.pov.alias)
  show menu ("What is your gender?", split ("male;female" , ";"), false) {
    game.pov.gender = result
    show menu ("What is your race?", split ("human;dwarf;elf" , ";"), false) {
      game.pov.race = result
      show menu ("What is your class?", split ("warrior;cleric;mage;thief" , ";"), false) {
        game.pov.class = result
        msg (game.pov.alias + " is a " + game.pov.gender + " " + game.pov.race + " " + game.pov.class + ".")
        wait {
          ClearScreen
        }
      }
    }
  }
}

Anonynn
30 Mar 2019, 05:38

Well, I think redoing all the conversations to be a Show Menu would be very time consuming. Plus, a lot of my conversations for the characters end up being roughly 20k-100k words or more. Quest can handle about 20 embedded if-scripts or menu options before it crashes.

I'm really just wanting to Show and Hide conversation topics but the new updated ConvLib library is having an issue with it.

Anonynn.


Anonynn
03 Apr 2019, 21:52

I've tried separating some of the HideTopics with Hide Topics but that was a major bust. I have no idea how to fix this @_@ Perhaps I installed the library wrong? Does anyone else have this problem with the newest ConvLib?

Anonynn.


The Pixie
10 Apr 2019, 08:52

I have confirmed they are both present and work in my demo game, so it should work. The latest version is 3.2; I just realised you said early you had upgraded from 3.2 to 5.0, so that is odd...

The most recent version is here:
https://github.com/ThePix/quest/blob/master/ConvLib.aslx

I guess I would check your game is using the right version of ConvLib first (some of this may seem stupid, but in my experience when you are completely baffled it is best to go back and check the basics so you can be sure your assumptions are right). Go into full code view, and check the path to the library. If it looks like this:

  <include ref="ConvLib.aslx" />

... it is using the version in the main folder (it should work whereever it is, as long as that version is right).

Now open up ConvLib.aslx using a text editor and see if you can see ShowTopic and HideTopic in there. If not, you have an older version.

Now open your game in Quest, and set it to show library elements, down in the bottom left corner, and see if ShowTopic and HideTopic(I would use the filter/search, top left). If you click on them it should say they are from ConvLib.aslx.