Look Me error

Getting this error when trying to use the question lib

Error running script: Error evaluating expression 'ListCount(lst) + 1': ListCount function expected list parameter but was passed 'Object: player'

any help would be appreciated


Did you by chance rename the player?


I have not


if it helps, the error pops up on the sample provided in the forum post for creating characters also


Can you link to the forum post you are using? I am not sure what question lib is.


"http://textadventures.co.uk /forum/samples/topic/5492/character-creation-questions-again"

had to put a space between the UK and /Forum


The error message says you have a problem in the expression ListCount(lst) + 1.

That expression is not in any of the core code, and doesn't seem to be in that QuestionLib either. Can you find where that expression appears in your game?


I haven't been able to find it, I have looked. As I have said, the error occurs in the sample QuestionDemo.aslx also when trying to look at yourself. I tried running through the QuestionLib also, but I am a bit out of my depth on trying to alter that code.


Best suggestion I can come up with is to open the aslx file in a text editor and search for that expression.

Maybe you could publish the game so we can see it? Finding the problem would probablky be easier than going back and forth with questions.


the QuestionDemo.aslx that is included on the same post as before also gets the error and you can download it, if you would like to see the error, download it, and simply use look me after the character creation.


OK, this was a lot harder than it should have been because you misquoted the error message.

That QuestionLib includes a function named "IndexOf".
Since Quest 5.7, IndexOf is now a core function.

The two versions of the function do not behave the same (their parameters are reversed).

So, in the question lib file, you need to remove this function:

  <function name="IndexOf" type="int" parameters="item, lst">
    if (lst = null) lst = race.list
    for (i, 0, ListCount(lst) - 1) {
      if (StringListItem(lst, i) = item) {
        return (i)
      }
    }
    return (-1)
  </function>

Then in the function SetTo, change

   index = IndexOf(value, lst)

to

   index = IndexOf(lst, value)

and in AskQuestion (near the bottom) change

            index = IndexOf(result, item.list)

to

            index = IndexOf(item.list, result)

Then I think it should work.


It is an error in QuestionLib. There is a function in there called IndexOf. As of Quest 5.7, there is a slightly different function IndexOf in the core libraries, and there is a conflict.

To fix it, open QuestionLib with a text editor, such as Notepad, and search for IndexOf. For each occurrence, change it to IndexOfQL (should be three). I cannot update the post as the thread is now locked.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums